datePicker #40
|
@ -42,13 +42,13 @@ public class SetUpActivity extends FragmentActivity
|
||||||
String startBreakTime;
|
String startBreakTime;
|
||||||
String endBreakTime;
|
String endBreakTime;
|
||||||
int totalStudent;
|
int totalStudent;
|
||||||
private TextView setTeacherName;
|
private TextView textViewTeacherName;
|
||||||
private TextView setStartPoint;
|
private TextView textViewStartPoint;
|
||||||
private TextView setStartTime;
|
private TextView textViewStartTime;
|
||||||
private TextView setEndTime;
|
private TextView textViewEndTime;
|
||||||
private TextView setStartBreakTime;
|
private TextView textViewStartBreakTime;
|
||||||
private TextView setEndBreakTime;
|
private TextView textViewEndBreakTime;
|
||||||
private TextView setTotalStudent;
|
private TextView textViewTotalStudent;
|
||||||
private int isDateSelected;
|
private int isDateSelected;
|
||||||
private int isStartTimeSelected;
|
private int isStartTimeSelected;
|
||||||
|
|
||||||
|
@ -76,28 +76,28 @@ public class SetUpActivity extends FragmentActivity
|
||||||
|
|
||||||
int classId= getIntent().getIntExtra("classId", 100000);
|
int classId= getIntent().getIntExtra("classId", 100000);
|
||||||
|
|
||||||
setTeacherName = findViewById(R.id.teacherName); //先生の名前
|
textViewTeacherName = findViewById(R.id.teacherName); //先生の名前
|
||||||
setStartPoint = findViewById(R.id.startPoint); //開始地点
|
textViewStartPoint = findViewById(R.id.startPoint); //開始地点
|
||||||
|
|
||||||
setFirstDay = findViewById(R.id.setFirstDayButton); //1日目の日付
|
setFirstDay = findViewById(R.id.setFirstDayButton); //1日目の日付
|
||||||
setSecondDay = findViewById(R.id.setSecondDayButton); //2日目の日付
|
setSecondDay = findViewById(R.id.setSecondDayButton); //2日目の日付
|
||||||
setThirdDay = findViewById(R.id.setThirdDayButton); //3日目の日付
|
setThirdDay = findViewById(R.id.setThirdDayButton); //3日目の日付
|
||||||
|
|
||||||
setStartTimeButton = findViewById(R.id.startTimeSetButton); //開始時刻を設定するボタン
|
setStartTimeButton = findViewById(R.id.startTimeSetButton); //開始時刻を設定するボタン
|
||||||
setStartTime = findViewById(R.id.startTime); //開始時刻を出力するTextView
|
textViewStartTime = findViewById(R.id.startTime); //開始時刻を出力するTextView
|
||||||
setEndTimeButton = findViewById(R.id.endTimeSetButton); //終了時刻を設定するボタン
|
setEndTimeButton = findViewById(R.id.endTimeSetButton); //終了時刻を設定するボタン
|
||||||
setEndTime = findViewById(R.id.endTime); //終了時刻を出力するTextView
|
textViewEndTime = findViewById(R.id.endTime); //終了時刻を出力するTextView
|
||||||
|
|
||||||
RadioButton setTenMinute = findViewById(R.id.tenMinute); //訪問間隔(10分)
|
RadioButton setTenMinute = findViewById(R.id.tenMinute); //訪問間隔(10分)
|
||||||
RadioButton setFifteenMinute = findViewById(R.id.fifteenMinute); //訪問間隔(15分)
|
RadioButton setFifteenMinute = findViewById(R.id.fifteenMinute); //訪問間隔(15分)
|
||||||
RadioButton setThirtyMinute = findViewById(R.id.thirtyMinute); //訪問間隔(30分)
|
RadioButton setThirtyMinute = findViewById(R.id.thirtyMinute); //訪問間隔(30分)
|
||||||
|
|
||||||
setStartBreakTime = findViewById(R.id.startBreakTime); //休憩開始時刻
|
textViewStartBreakTime = findViewById(R.id.startBreakTime); //休憩開始時刻
|
||||||
setStartBreakTime.setPaintFlags(Paint.UNDERLINE_TEXT_FLAG);
|
textViewStartBreakTime.setPaintFlags(Paint.UNDERLINE_TEXT_FLAG);
|
||||||
setEndBreakTime = findViewById(R.id.endBreakTime); //休憩終了時刻
|
textViewEndBreakTime = findViewById(R.id.endBreakTime); //休憩終了時刻
|
||||||
setEndBreakTime.setPaintFlags(Paint.UNDERLINE_TEXT_FLAG);
|
textViewEndBreakTime.setPaintFlags(Paint.UNDERLINE_TEXT_FLAG);
|
||||||
|
|
||||||
setTotalStudent = findViewById(R.id.totalStudent); //クラスの人数
|
textViewTotalStudent = findViewById(R.id.totalStudent); //クラスの人数
|
||||||
|
|
||||||
ImageView toMain = findViewById(R.id.toMain);
|
ImageView toMain = findViewById(R.id.toMain);
|
||||||
Button setUp = findViewById(R.id.setUpButton); //画面下の設定ボタン
|
Button setUp = findViewById(R.id.setUpButton); //画面下の設定ボタン
|
||||||
|
@ -110,9 +110,9 @@ public class SetUpActivity extends FragmentActivity
|
||||||
|
|
||||||
setUp.setOnClickListener(view -> {
|
setUp.setOnClickListener(view -> {
|
||||||
|
|
||||||
teacherName = setTeacherName.getText().toString(); //各変数に値を挿入
|
teacherName = textViewTeacherName.getText().toString(); //各変数に値を挿入
|
||||||
Log.d(TAG, "Teacher Name: " + teacherName);
|
Log.d(TAG, "Teacher Name: " + teacherName);
|
||||||
startPoint = setStartPoint.getText().toString();
|
startPoint = textViewStartPoint.getText().toString();
|
||||||
Log.d(TAG, "Start Point: " + startPoint);
|
Log.d(TAG, "Start Point: " + startPoint);
|
||||||
Log.d(TAG, "First Day:" + firstDay);
|
Log.d(TAG, "First Day:" + firstDay);
|
||||||
Log.d(TAG, "Second Day:" + secondDay);
|
Log.d(TAG, "Second Day:" + secondDay);
|
||||||
|
@ -131,7 +131,7 @@ public class SetUpActivity extends FragmentActivity
|
||||||
Log.d(TAG, "Interval Time" + intervalTime);
|
Log.d(TAG, "Interval Time" + intervalTime);
|
||||||
Log.d(TAG, "Start Break Time" + startBreakTime);
|
Log.d(TAG, "Start Break Time" + startBreakTime);
|
||||||
Log.d(TAG, "End Break Time" + endBreakTime);
|
Log.d(TAG, "End Break Time" + endBreakTime);
|
||||||
totalStudent = Integer.parseInt(setTotalStudent.getText().toString()); //数値型に変更
|
totalStudent = Integer.parseInt(textViewTotalStudent.getText().toString()); //数値型に変更
|
||||||
Log.d(TAG, "Total Student" + totalStudent);
|
Log.d(TAG, "Total Student" + totalStudent);
|
||||||
Log.d(TAG, "onClick: できてるよ");
|
Log.d(TAG, "onClick: できてるよ");
|
||||||
|
|
||||||
|
@ -211,12 +211,12 @@ public class SetUpActivity extends FragmentActivity
|
||||||
showTimePickerDialog();
|
showTimePickerDialog();
|
||||||
});
|
});
|
||||||
|
|
||||||
setStartBreakTime.setOnClickListener(v -> {
|
textViewStartBreakTime.setOnClickListener(v -> {
|
||||||
isStartTimeSelected = 3;
|
isStartTimeSelected = 3;
|
||||||
showTimePickerDialog();
|
showTimePickerDialog();
|
||||||
});
|
});
|
||||||
|
|
||||||
setEndBreakTime.setOnClickListener(v -> {
|
textViewEndBreakTime.setOnClickListener(v -> {
|
||||||
isStartTimeSelected = 4;
|
isStartTimeSelected = 4;
|
||||||
showTimePickerDialog();
|
showTimePickerDialog();
|
||||||
});
|
});
|
||||||
|
@ -224,14 +224,14 @@ public class SetUpActivity extends FragmentActivity
|
||||||
//リセットボタンの処理
|
//リセットボタンの処理
|
||||||
|
|
||||||
reset.setOnClickListener(v -> { //テキストとラジオボタンの選択を消去
|
reset.setOnClickListener(v -> { //テキストとラジオボタンの選択を消去
|
||||||
setTeacherName.setText("");
|
textViewTeacherName.setText("");
|
||||||
setStartPoint.setText("");
|
textViewStartPoint.setText("");
|
||||||
setTenMinute.setChecked(false);
|
setTenMinute.setChecked(false);
|
||||||
setFifteenMinute.setChecked(false);
|
setFifteenMinute.setChecked(false);
|
||||||
setThirtyMinute.setChecked(false);
|
setThirtyMinute.setChecked(false);
|
||||||
setStartBreakTime.setText("");
|
textViewStartBreakTime.setText("");
|
||||||
setEndBreakTime.setText("");
|
textViewEndBreakTime.setText("");
|
||||||
setTotalStudent.setText("");
|
textViewTotalStudent.setText("");
|
||||||
|
|
||||||
ExecutorService executor = Executors.newSingleThreadExecutor();
|
ExecutorService executor = Executors.newSingleThreadExecutor();
|
||||||
executor.execute(() -> {
|
executor.execute(() -> {
|
||||||
|
@ -280,25 +280,25 @@ public class SetUpActivity extends FragmentActivity
|
||||||
stringHourOfDay = String.format("%02d", hourOfDay);
|
stringHourOfDay = String.format("%02d", hourOfDay);
|
||||||
stringMinute = String.format("%02d", minute);
|
stringMinute = String.format("%02d", minute);
|
||||||
startTime = stringHourOfDay + stringMinute;
|
startTime = stringHourOfDay + stringMinute;
|
||||||
setStartTime.setText(str);
|
textViewStartTime.setText(str);
|
||||||
|
|
||||||
} else if (isStartTimeSelected == 2) {
|
} else if (isStartTimeSelected == 2) {
|
||||||
stringHourOfDay = String.format("%02d", hourOfDay);
|
stringHourOfDay = String.format("%02d", hourOfDay);
|
||||||
stringMinute = String.format("%02d", minute);
|
stringMinute = String.format("%02d", minute);
|
||||||
endTime = stringHourOfDay + stringMinute;
|
endTime = stringHourOfDay + stringMinute;
|
||||||
setEndTime.setText(str);
|
textViewEndTime.setText(str);
|
||||||
|
|
||||||
} else if (isStartTimeSelected == 3) {
|
} else if (isStartTimeSelected == 3) {
|
||||||
stringHourOfDay = String.format("%02d", hourOfDay);
|
stringHourOfDay = String.format("%02d", hourOfDay);
|
||||||
stringMinute = String.format("%02d", minute);
|
stringMinute = String.format("%02d", minute);
|
||||||
startBreakTime =stringHourOfDay + stringMinute;
|
startBreakTime =stringHourOfDay + stringMinute;
|
||||||
setStartBreakTime.setText(" " + str + " ");
|
textViewStartBreakTime.setText(" " + str + " ");
|
||||||
|
|
||||||
} else if (isStartTimeSelected == 4) {
|
} else if (isStartTimeSelected == 4) {
|
||||||
stringHourOfDay = String.format("%02d", hourOfDay);
|
stringHourOfDay = String.format("%02d", hourOfDay);
|
||||||
stringMinute = String.format("%02d", minute);
|
stringMinute = String.format("%02d", minute);
|
||||||
endBreakTime = stringHourOfDay + stringMinute;
|
endBreakTime = stringHourOfDay + stringMinute;
|
||||||
setEndBreakTime.setText(" " + str + " ");
|
textViewEndBreakTime.setText(" " + str + " ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user