...
1 commit 3 files changed 0 commit comments 1 contributor
Commits on 2024-10-17
g-shimokawa UIの視認性を向上 d3b030e
Showing 3 changed files
View
18
app/src/main/java/com/example/citrusclient/views/CreateTodoFragment.java
EditText titleField = view.findViewById(R.id.todo_title_inputField);
titleField.setText(viwTitle); // 年の初期値を設定
 
NumberPicker numberPickerYear = view.findViewById(R.id.numberPickerYear);
EditText editYearText = (EditText) numberPickerYear.getChildAt(0);
numberPickerYear.setMinValue(citrus.getCurYear());
numberPickerYear.setMaxValue(citrus.getCurYear() + 30);
numberPickerYear.setValue(viwYear); // 年の初期値を設定
 
NumberPicker numberPickerMonth = view.findViewById(R.id.numberPickerMonth);
EditText editMonthText = (EditText) numberPickerMonth.getChildAt(0);
numberPickerMonth.setMinValue(1);
numberPickerMonth.setMaxValue(12);
numberPickerMonth.setValue(viwMonth); // 月の初期値を設定
 
NumberPicker numberPickerDay = view.findViewById(R.id.numberPickerDay);
EditText editDayText = (EditText) numberPickerDay.getChildAt(0);
numberPickerDay.setMinValue(1);
numberPickerDay.setMaxValue(getDaysInMonth(citrus.getCurYear(), citrus.getCurMonth())); // 日の初期値を設定
numberPickerDay.setValue(viwDay); // 日の初期値を設定
 
// 年が変更されたとき
numberPickerYear.setOnValueChangedListener((picker, oldVal, newVal) -> {
int month = numberPickerMonth.getValue();
int daysInMonth = getDaysInMonth(newVal, month);
numberPickerDay.setMaxValue(daysInMonth);
});
 
// 月が変更されたとき
numberPickerMonth.setOnValueChangedListener((picker, oldVal, newVal) -> {
int year = numberPickerYear.getValue();
int daysInMonth = getDaysInMonth(year, newVal);
numberPickerDay.setMaxValue(daysInMonth);
});
 
// 年が変更されたとき
numberPickerYear.setOnValueChangedListener((picker, oldVal, newVal) -> {
int month = numberPickerMonth.getValue();
int daysInMonth = getDaysInMonth(newVal, month);
numberPickerDay.setMaxValue(daysInMonth);
});
 
Spinner spinner = view.findViewById(R.id.select_todo_spinner);
calendar.set(Calendar.MONTH, month - 1); // Calendar.MONTHは0から始まるので-1する
return calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
}
 
 
}
View
17
app/src/main/res/layout/fragment_create_schedule.xml
android:layout_weight="1"
android:background="#00FFFFFF"
android:text="Button"
android:textAlignment="center"
android:textColor="#000000" />
android:textColor="#000000"
android:textSize="20sp" />
 
<Button
android:id="@+id/start_time_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#00FFFFFF"
android:text="Button"
android:textColor="#000000" />
android:textColor="#000000"
android:textSize="20sp" />
 
</LinearLayout>
 
<Space
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#00FFFFFF"
android:text="Button"
android:textColor="#000000" />
android:textColor="#000000"
android:textSize="20sp"/>
 
<Button
android:id="@+id/end_time_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#00FFFFFF"
android:text="Button"
android:textColor="#000000" />
android:textColor="#000000"
android:textSize="20sp"/>
 
</LinearLayout>
 
<Spinner
android:id="@+id/select_schedule_spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contextClickable="false"
android:prompt="@string/select_book_spinner" />
 
<Space
android:layout_width="match_parent"
View
app/src/main/res/layout/fragment_create_todo.xml

Showing you all comments on commits in this comparison.