From 500f24f4f5eb246d984c67d8306931672b0b0d6f Mon Sep 17 00:00:00 2001 From: Ekamo-11 <148836598+Ekamo-11@users.noreply.github.com> Date: Wed, 3 Jul 2024 16:18:04 +0900 Subject: [PATCH 01/10] =?UTF-8?q?String=E3=81=AE=E3=83=AA=E3=82=BD?= =?UTF-8?q?=E3=83=BC=E3=82=B9=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=AB?= =?UTF-8?q?DatePicker=E3=81=AE=E8=A1=A8=E7=A4=BA=E5=BD=A2=E5=BC=8F?= =?UTF-8?q?=E3=82=92=E6=97=A5=E6=9C=AC=E8=AA=9E=E3=81=AB=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=81=9F=E3=82=81=E3=81=AE=E3=83=AA=E3=82=BD=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/values/strings.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7d0fc4a..588fadf 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -16,4 +16,18 @@ 10分 15分 30分 + + 1月 + 2月 + 3月 + 4月 + 5月 + 6月 + 7月 + 8月 + 9月 + 10月 + 11月 + 12月 + \ No newline at end of file -- 2.45.1 From 0e40dea54c67047504643775d309b16e55df2e5f Mon Sep 17 00:00:00 2001 From: Ekamo-11 <148836598+Ekamo-11@users.noreply.github.com> Date: Wed, 3 Jul 2024 16:35:33 +0900 Subject: [PATCH 02/10] =?UTF-8?q?setUpActivity=E3=81=AE=E6=8B=85=E4=BB=BB?= =?UTF-8?q?=E3=81=AE=E5=90=8D=E5=89=8D=E3=81=A8=E9=96=8B=E5=A7=8B=E5=9C=B0?= =?UTF-8?q?=E7=82=B9=E3=82=92=E6=97=A5=E6=9C=AC=E8=AA=9E=E3=82=AD=E3=83=BC?= =?UTF-8?q?=E3=83=9C=E3=83=BC=E3=83=89=E3=81=A7=E5=85=A5=E5=8A=9B=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=BE=E3=81=97?= =?UTF-8?q?=E3=81=9F=E3=80=82=E5=A4=9A=E5=88=86=E7=AB=AF=E6=9C=AB=E3=81=94?= =?UTF-8?q?=E3=81=A8=E3=81=AE=E8=A8=AD=E5=AE=9A=E3=81=AA=E6=B0=97=E3=81=8C?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=81=91=E3=81=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/layout/activity_set_up.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/layout/activity_set_up.xml b/app/src/main/res/layout/activity_set_up.xml index 84bc0c8..d693ab8 100644 --- a/app/src/main/res/layout/activity_set_up.xml +++ b/app/src/main/res/layout/activity_set_up.xml @@ -52,7 +52,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:autofillHints="" - android:inputType="" + android:inputType="text" tools:ignore="LabelFor" /> @@ -76,7 +76,7 @@ android:layout_height="wrap_content" android:hint="@string/startpoint" android:autofillHints="" - android:inputType="" + android:inputType="text" tools:ignore="LabelFor" /> -- 2.45.1 From 036352858fb53dbfe1bcdeb29e8a957a99b1eb47 Mon Sep 17 00:00:00 2001 From: Ekamo-11 <148836598+Ekamo-11@users.noreply.github.com> Date: Wed, 3 Jul 2024 16:46:22 +0900 Subject: [PATCH 03/10] =?UTF-8?q?=E8=AD=A6=E5=91=8A=E3=82=92=E6=B6=88?= =?UTF-8?q?=E3=81=99=E3=81=9F=E3=82=81=E3=81=AB=E3=83=AA=E3=82=BD=E3=83=BC?= =?UTF-8?q?=E3=82=B9=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=97=E3=81=BE=E3=81=97?= =?UTF-8?q?=E3=81=9F=E3=80=81=E3=81=9D=E3=81=AE=E4=BB=96=E3=81=AE=E8=AD=A6?= =?UTF-8?q?=E5=91=8A=E3=82=82=E6=B6=88=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/layout/activity_set_up.xml | 20 ++++++++++---------- app/src/main/res/values/strings.xml | 6 ++++++ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/app/src/main/res/layout/activity_set_up.xml b/app/src/main/res/layout/activity_set_up.xml index d693ab8..966ccbc 100644 --- a/app/src/main/res/layout/activity_set_up.xml +++ b/app/src/main/res/layout/activity_set_up.xml @@ -1,6 +1,5 @@ + android:layout_gravity="start" + android:layout_marginStart="10dp" + android:src="@drawable/back_button" + android:contentDescription="@string/todo" /> @@ -109,7 +109,7 @@ android:id="@+id/setFirstDayButton" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="1日目" + android:text="@string/firstDay" android:layout_marginStart="7sp" android:layout_marginEnd="7sp" tools:ignore="DuplicateIds" /> @@ -118,7 +118,7 @@ android:id="@+id/setSecondDayButton" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="2日目" + android:text="@string/secondDay" android:layout_marginStart="7sp" android:layout_marginEnd="7sp" tools:ignore="DuplicateIds" /> @@ -127,7 +127,7 @@ android:id="@+id/setThirdDayButton" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="3日目" + android:text="@string/threeDay" android:layout_marginStart="7sp" android:layout_marginEnd="7sp" tools:ignore="DuplicateIds" /> @@ -151,7 +151,7 @@ android:id="@+id/startTime" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:hint="未設定" + android:hint="@string/notSetUp" android:textSize="20sp" android:textAlignment="center" android:autofillHints="" @@ -186,7 +186,7 @@ android:id="@+id/endTime" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:hint="未設定" + android:hint="@string/notSetUp" android:textSize="20sp" android:textAlignment="center" android:autofillHints="" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 588fadf..639e09a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -16,6 +16,12 @@ 10分 15分 30分 + TODO + 日付設定 + 1日目 + 2日目 + 3日目 + 未設定 1月 2月 -- 2.45.1 From 3109d9666d950966d615413706ca2c17c1e3295f Mon Sep 17 00:00:00 2001 From: Ekamo-11 <148836598+Ekamo-11@users.noreply.github.com> Date: Fri, 5 Jul 2024 11:45:23 +0900 Subject: [PATCH 04/10] =?UTF-8?q?=E5=A4=89=E6=95=B0=E5=90=8D=E3=82=92?= =?UTF-8?q?=E5=9E=8B=E3=81=8C=E5=88=86=E3=81=8B=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E4=B8=80=E9=83=A8=E5=A4=89=E6=9B=B4=E3=81=97=E3=81=BE?= =?UTF-8?q?=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/example/oplogy/SetUpActivity.java | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/app/src/main/java/com/example/oplogy/SetUpActivity.java b/app/src/main/java/com/example/oplogy/SetUpActivity.java index d533095..ab4f1c8 100644 --- a/app/src/main/java/com/example/oplogy/SetUpActivity.java +++ b/app/src/main/java/com/example/oplogy/SetUpActivity.java @@ -42,13 +42,13 @@ public class SetUpActivity extends FragmentActivity String startBreakTime; String endBreakTime; int totalStudent; - private TextView setTeacherName; - private TextView setStartPoint; - private TextView setStartTime; - private TextView setEndTime; - private TextView setStartBreakTime; - private TextView setEndBreakTime; - private TextView setTotalStudent; + private TextView textViewTeacherName; + private TextView textViewStartPoint; + private TextView textViewStartTime; + private TextView textViewEndTime; + private TextView textViewStartBreakTime; + private TextView textViewEndBreakTime; + private TextView textViewTotalStudent; private int isDateSelected; private int isStartTimeSelected; @@ -76,28 +76,28 @@ public class SetUpActivity extends FragmentActivity int classId= getIntent().getIntExtra("classId", 100000); - setTeacherName = findViewById(R.id.teacherName); //先生の名前 - setStartPoint = findViewById(R.id.startPoint); //開始地点 + textViewTeacherName = findViewById(R.id.teacherName); //先生の名前 + textViewStartPoint = findViewById(R.id.startPoint); //開始地点 setFirstDay = findViewById(R.id.setFirstDayButton); //1日目の日付 setSecondDay = findViewById(R.id.setSecondDayButton); //2日目の日付 setThirdDay = findViewById(R.id.setThirdDayButton); //3日目の日付 setStartTimeButton = findViewById(R.id.startTimeSetButton); //開始時刻を設定するボタン - setStartTime = findViewById(R.id.startTime); //開始時刻を出力するTextView + textViewStartTime = findViewById(R.id.startTime); //開始時刻を出力するTextView 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 setFifteenMinute = findViewById(R.id.fifteenMinute); //訪問間隔(15分) RadioButton setThirtyMinute = findViewById(R.id.thirtyMinute); //訪問間隔(30分) - setStartBreakTime = findViewById(R.id.startBreakTime); //休憩開始時刻 - setStartBreakTime.setPaintFlags(Paint.UNDERLINE_TEXT_FLAG); - setEndBreakTime = findViewById(R.id.endBreakTime); //休憩終了時刻 - setEndBreakTime.setPaintFlags(Paint.UNDERLINE_TEXT_FLAG); + textViewStartBreakTime = findViewById(R.id.startBreakTime); //休憩開始時刻 + textViewStartBreakTime.setPaintFlags(Paint.UNDERLINE_TEXT_FLAG); + textViewEndBreakTime = findViewById(R.id.endBreakTime); //休憩終了時刻 + textViewEndBreakTime.setPaintFlags(Paint.UNDERLINE_TEXT_FLAG); - setTotalStudent = findViewById(R.id.totalStudent); //クラスの人数 + textViewTotalStudent = findViewById(R.id.totalStudent); //クラスの人数 ImageView toMain = findViewById(R.id.toMain); Button setUp = findViewById(R.id.setUpButton); //画面下の設定ボタン @@ -110,9 +110,9 @@ public class SetUpActivity extends FragmentActivity setUp.setOnClickListener(view -> { - teacherName = setTeacherName.getText().toString(); //各変数に値を挿入 + teacherName = textViewTeacherName.getText().toString(); //各変数に値を挿入 Log.d(TAG, "Teacher Name: " + teacherName); - startPoint = setStartPoint.getText().toString(); + startPoint = textViewStartPoint.getText().toString(); Log.d(TAG, "Start Point: " + startPoint); Log.d(TAG, "First Day:" + firstDay); Log.d(TAG, "Second Day:" + secondDay); @@ -131,7 +131,7 @@ public class SetUpActivity extends FragmentActivity Log.d(TAG, "Interval Time" + intervalTime); Log.d(TAG, "Start Break Time" + startBreakTime); 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, "onClick: できてるよ"); @@ -211,12 +211,12 @@ public class SetUpActivity extends FragmentActivity showTimePickerDialog(); }); - setStartBreakTime.setOnClickListener(v -> { + textViewStartBreakTime.setOnClickListener(v -> { isStartTimeSelected = 3; showTimePickerDialog(); }); - setEndBreakTime.setOnClickListener(v -> { + textViewEndBreakTime.setOnClickListener(v -> { isStartTimeSelected = 4; showTimePickerDialog(); }); @@ -224,14 +224,14 @@ public class SetUpActivity extends FragmentActivity //リセットボタンの処理 reset.setOnClickListener(v -> { //テキストとラジオボタンの選択を消去 - setTeacherName.setText(""); - setStartPoint.setText(""); + textViewTeacherName.setText(""); + textViewStartPoint.setText(""); setTenMinute.setChecked(false); setFifteenMinute.setChecked(false); setThirtyMinute.setChecked(false); - setStartBreakTime.setText(""); - setEndBreakTime.setText(""); - setTotalStudent.setText(""); + textViewStartBreakTime.setText(""); + textViewEndBreakTime.setText(""); + textViewTotalStudent.setText(""); ExecutorService executor = Executors.newSingleThreadExecutor(); executor.execute(() -> { @@ -280,25 +280,25 @@ public class SetUpActivity extends FragmentActivity stringHourOfDay = String.format("%02d", hourOfDay); stringMinute = String.format("%02d", minute); startTime = stringHourOfDay + stringMinute; - setStartTime.setText(str); + textViewStartTime.setText(str); } else if (isStartTimeSelected == 2) { stringHourOfDay = String.format("%02d", hourOfDay); stringMinute = String.format("%02d", minute); endTime = stringHourOfDay + stringMinute; - setEndTime.setText(str); + textViewEndTime.setText(str); } else if (isStartTimeSelected == 3) { stringHourOfDay = String.format("%02d", hourOfDay); stringMinute = String.format("%02d", minute); startBreakTime =stringHourOfDay + stringMinute; - setStartBreakTime.setText(" " + str + " "); + textViewStartBreakTime.setText(" " + str + " "); } else if (isStartTimeSelected == 4) { stringHourOfDay = String.format("%02d", hourOfDay); stringMinute = String.format("%02d", minute); endBreakTime = stringHourOfDay + stringMinute; - setEndBreakTime.setText(" " + str + " "); + textViewEndBreakTime.setText(" " + str + " "); } } -- 2.45.1 From 34bbf40951faa312cbc3e922cedd2365f6e23737 Mon Sep 17 00:00:00 2001 From: Ekamo-11 <148836598+Ekamo-11@users.noreply.github.com> Date: Fri, 5 Jul 2024 11:50:08 +0900 Subject: [PATCH 05/10] =?UTF-8?q?=E5=A4=89=E6=95=B0=E5=90=8D=E3=82=92?= =?UTF-8?q?=E5=9E=8B=E3=81=8C=E5=88=86=E3=81=8B=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=81=95=E3=82=89=E3=81=AB=E4=B8=80=E9=83=A8=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/example/oplogy/SetUpActivity.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/com/example/oplogy/SetUpActivity.java b/app/src/main/java/com/example/oplogy/SetUpActivity.java index ab4f1c8..adc4511 100644 --- a/app/src/main/java/com/example/oplogy/SetUpActivity.java +++ b/app/src/main/java/com/example/oplogy/SetUpActivity.java @@ -49,8 +49,8 @@ public class SetUpActivity extends FragmentActivity private TextView textViewStartBreakTime; private TextView textViewEndBreakTime; private TextView textViewTotalStudent; - private int isDateSelected; - private int isStartTimeSelected; + private int intIsDateSelected; + private int intIsStartTimeSelected; String stringYear; String stringMonth; @@ -187,37 +187,37 @@ public class SetUpActivity extends FragmentActivity }); setFirstDay.setOnClickListener(v ->{ - isDateSelected = 1; + intIsDateSelected = 1; showDatePickerDialog(); //DatePickerの表示 }); setSecondDay.setOnClickListener(v ->{ - isDateSelected = 2; + intIsDateSelected = 2; showDatePickerDialog(); }); setThirdDay.setOnClickListener(v ->{ - isDateSelected = 3; + intIsDateSelected = 3; showDatePickerDialog(); }); setStartTimeButton.setOnClickListener(v -> { - isStartTimeSelected = 1; //ボタンの判別 + intIsStartTimeSelected = 1; //ボタンの判別 showTimePickerDialog(); //TimePickerの表示 }); setEndTimeButton.setOnClickListener(v -> { - isStartTimeSelected = 2; + intIsStartTimeSelected = 2; showTimePickerDialog(); }); textViewStartBreakTime.setOnClickListener(v -> { - isStartTimeSelected = 3; + intIsStartTimeSelected = 3; showTimePickerDialog(); }); textViewEndBreakTime.setOnClickListener(v -> { - isStartTimeSelected = 4; + intIsStartTimeSelected = 4; showTimePickerDialog(); }); @@ -247,13 +247,13 @@ public class SetUpActivity extends FragmentActivity // DatePickerDialogで選択された日付を処理する String str = String.format(Locale.JAPAN, "%02d/%02d", month + 1, dayOfMonth); // TextViewに表示する日付の形式を設定 - if (isDateSelected == 1) { + if (intIsDateSelected == 1) { stringYear = String.valueOf(year); //年 stringMonth = String.format(Locale.JAPAN, "%02d", month + 1); //月 stringDayOfMonth = String.format(Locale.JAPAN, "%02d", dayOfMonth); //日 firstDay = stringYear + stringMonth + stringDayOfMonth; setFirstDay.setText(str); - } else if (isDateSelected == 2) { + } else if (intIsDateSelected == 2) { stringYear = String.valueOf(year); stringMonth = String.format(Locale.JAPAN, "%02d", month + 1); stringDayOfMonth = String.format(Locale.JAPAN, "%02d", dayOfMonth); @@ -261,7 +261,7 @@ public class SetUpActivity extends FragmentActivity setSecondDay.setText(str); - } else if (isDateSelected == 3) { + } else if (intIsDateSelected == 3) { stringYear = String.valueOf(year); stringMonth = String.format(Locale.JAPAN, "%02d", month + 1); stringDayOfMonth = String.format(Locale.JAPAN, "%02d", dayOfMonth); @@ -276,25 +276,25 @@ public class SetUpActivity extends FragmentActivity public void onTimeSet(TimePicker view, int hourOfDay, int minute) { String str = String.format(Locale.JAPAN, "%02d:%02d", hourOfDay, minute); // Textviewに保存する形式を設定 - if (isStartTimeSelected == 1) { + if (intIsStartTimeSelected == 1) { stringHourOfDay = String.format("%02d", hourOfDay); stringMinute = String.format("%02d", minute); startTime = stringHourOfDay + stringMinute; textViewStartTime.setText(str); - } else if (isStartTimeSelected == 2) { + } else if (intIsStartTimeSelected == 2) { stringHourOfDay = String.format("%02d", hourOfDay); stringMinute = String.format("%02d", minute); endTime = stringHourOfDay + stringMinute; textViewEndTime.setText(str); - } else if (isStartTimeSelected == 3) { + } else if (intIsStartTimeSelected == 3) { stringHourOfDay = String.format("%02d", hourOfDay); stringMinute = String.format("%02d", minute); startBreakTime =stringHourOfDay + stringMinute; textViewStartBreakTime.setText(" " + str + " "); - } else if (isStartTimeSelected == 4) { + } else if (intIsStartTimeSelected == 4) { stringHourOfDay = String.format("%02d", hourOfDay); stringMinute = String.format("%02d", minute); endBreakTime = stringHourOfDay + stringMinute; -- 2.45.1 From 55f5033fc6552d4c5dbc6129a6114286a87cf6ba Mon Sep 17 00:00:00 2001 From: Ekamo-11 <148836598+Ekamo-11@users.noreply.github.com> Date: Fri, 5 Jul 2024 11:53:29 +0900 Subject: [PATCH 06/10] =?UTF-8?q?=E5=A4=89=E6=95=B0=E5=90=8D=E3=82=92?= =?UTF-8?q?=E5=9E=8B=E3=81=8C=E5=88=86=E3=81=8B=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=81=95=E3=82=89=E3=81=AB=E3=81=95=E3=82=89=E3=81=AB?= =?UTF-8?q?=E4=B8=80=E9=83=A8=E5=A4=89=E6=9B=B4=E3=81=97=E3=81=BE=E3=81=97?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/example/oplogy/SetUpActivity.java | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/com/example/oplogy/SetUpActivity.java b/app/src/main/java/com/example/oplogy/SetUpActivity.java index adc4511..313cfb2 100644 --- a/app/src/main/java/com/example/oplogy/SetUpActivity.java +++ b/app/src/main/java/com/example/oplogy/SetUpActivity.java @@ -60,11 +60,11 @@ public class SetUpActivity extends FragmentActivity String stringHourOfDay; String stringMinute; - Button setFirstDay; - Button setSecondDay; - Button setThirdDay; - Button setStartTimeButton; - Button setEndTimeButton; + Button buttonFirstDay; + Button buttonSecondDay; + Button buttonThirdDay; + Button buttonStartTimeButton; + Button buttonEndTimeButton; @@ -79,13 +79,13 @@ public class SetUpActivity extends FragmentActivity textViewTeacherName = findViewById(R.id.teacherName); //先生の名前 textViewStartPoint = findViewById(R.id.startPoint); //開始地点 - setFirstDay = findViewById(R.id.setFirstDayButton); //1日目の日付 - setSecondDay = findViewById(R.id.setSecondDayButton); //2日目の日付 - setThirdDay = findViewById(R.id.setThirdDayButton); //3日目の日付 + buttonFirstDay = findViewById(R.id.setFirstDayButton); //1日目の日付 + buttonSecondDay = findViewById(R.id.setSecondDayButton); //2日目の日付 + buttonThirdDay = findViewById(R.id.setThirdDayButton); //3日目の日付 - setStartTimeButton = findViewById(R.id.startTimeSetButton); //開始時刻を設定するボタン + buttonStartTimeButton = findViewById(R.id.startTimeSetButton); //開始時刻を設定するボタン textViewStartTime = findViewById(R.id.startTime); //開始時刻を出力するTextView - setEndTimeButton = findViewById(R.id.endTimeSetButton); //終了時刻を設定するボタン + buttonEndTimeButton = findViewById(R.id.endTimeSetButton); //終了時刻を設定するボタン textViewEndTime = findViewById(R.id.endTime); //終了時刻を出力するTextView RadioButton setTenMinute = findViewById(R.id.tenMinute); //訪問間隔(10分) @@ -186,27 +186,27 @@ public class SetUpActivity extends FragmentActivity }); - setFirstDay.setOnClickListener(v ->{ + buttonFirstDay.setOnClickListener(v ->{ intIsDateSelected = 1; showDatePickerDialog(); //DatePickerの表示 }); - setSecondDay.setOnClickListener(v ->{ + buttonSecondDay.setOnClickListener(v ->{ intIsDateSelected = 2; showDatePickerDialog(); }); - setThirdDay.setOnClickListener(v ->{ + buttonThirdDay.setOnClickListener(v ->{ intIsDateSelected = 3; showDatePickerDialog(); }); - setStartTimeButton.setOnClickListener(v -> { + buttonStartTimeButton.setOnClickListener(v -> { intIsStartTimeSelected = 1; //ボタンの判別 showTimePickerDialog(); //TimePickerの表示 }); - setEndTimeButton.setOnClickListener(v -> { + buttonEndTimeButton.setOnClickListener(v -> { intIsStartTimeSelected = 2; showTimePickerDialog(); }); @@ -252,13 +252,13 @@ public class SetUpActivity extends FragmentActivity stringMonth = String.format(Locale.JAPAN, "%02d", month + 1); //月 stringDayOfMonth = String.format(Locale.JAPAN, "%02d", dayOfMonth); //日 firstDay = stringYear + stringMonth + stringDayOfMonth; - setFirstDay.setText(str); + buttonFirstDay.setText(str); } else if (intIsDateSelected == 2) { stringYear = String.valueOf(year); stringMonth = String.format(Locale.JAPAN, "%02d", month + 1); stringDayOfMonth = String.format(Locale.JAPAN, "%02d", dayOfMonth); secondDay = stringYear + stringMonth + stringDayOfMonth; - setSecondDay.setText(str); + buttonSecondDay.setText(str); } else if (intIsDateSelected == 3) { @@ -266,7 +266,7 @@ public class SetUpActivity extends FragmentActivity stringMonth = String.format(Locale.JAPAN, "%02d", month + 1); stringDayOfMonth = String.format(Locale.JAPAN, "%02d", dayOfMonth); thirdDay = stringYear + stringMonth + stringDayOfMonth; - setThirdDay.setText(str); + buttonThirdDay.setText(str); } } -- 2.45.1 From 2bb15876686185f1685b43a09d9787afa24c61b1 Mon Sep 17 00:00:00 2001 From: Ekamo-11 <148836598+Ekamo-11@users.noreply.github.com> Date: Fri, 5 Jul 2024 11:56:09 +0900 Subject: [PATCH 07/10] =?UTF-8?q?=E5=A4=89=E6=95=B0=E5=90=8D=E3=82=92?= =?UTF-8?q?=E5=9E=8B=E3=81=8C=E5=88=86=E3=81=8B=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=81=95=E3=82=89=E3=81=AB=E3=81=95=E3=82=89=E3=81=AB?= =?UTF-8?q?=E3=81=95=E3=82=89=E3=81=AB=E4=B8=80=E9=83=A8=E5=A4=89=E6=9B=B4?= =?UTF-8?q?=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/example/oplogy/SetUpActivity.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/com/example/oplogy/SetUpActivity.java b/app/src/main/java/com/example/oplogy/SetUpActivity.java index 313cfb2..8b5a419 100644 --- a/app/src/main/java/com/example/oplogy/SetUpActivity.java +++ b/app/src/main/java/com/example/oplogy/SetUpActivity.java @@ -88,9 +88,9 @@ public class SetUpActivity extends FragmentActivity buttonEndTimeButton = findViewById(R.id.endTimeSetButton); //終了時刻を設定するボタン textViewEndTime = findViewById(R.id.endTime); //終了時刻を出力するTextView - RadioButton setTenMinute = findViewById(R.id.tenMinute); //訪問間隔(10分) - RadioButton setFifteenMinute = findViewById(R.id.fifteenMinute); //訪問間隔(15分) - RadioButton setThirtyMinute = findViewById(R.id.thirtyMinute); //訪問間隔(30分) + RadioButton radioButtonTenMinute = findViewById(R.id.tenMinute); //訪問間隔(10分) + RadioButton radioButtonFifteenMinute = findViewById(R.id.fifteenMinute); //訪問間隔(15分) + RadioButton radioButtonThirtyMinute = findViewById(R.id.thirtyMinute); //訪問間隔(30分) textViewStartBreakTime = findViewById(R.id.startBreakTime); //休憩開始時刻 textViewStartBreakTime.setPaintFlags(Paint.UNDERLINE_TEXT_FLAG); @@ -119,11 +119,11 @@ public class SetUpActivity extends FragmentActivity Log.d(TAG, "Third Day:" + thirdDay); Log.d(TAG, "Start Time" + startTime); Log.d(TAG, "End Time" + endTime); - if (setTenMinute.isChecked()){ //ラジオボタンの状態を取得 + if (radioButtonTenMinute.isChecked()){ //ラジオボタンの状態を取得 intervalTime = "10"; - } else if (setFifteenMinute.isChecked()) { + } else if (radioButtonFifteenMinute.isChecked()) { intervalTime = "15"; - } else if (setThirtyMinute.isChecked()) { + } else if (radioButtonThirtyMinute.isChecked()) { intervalTime = "30"; } else { intervalTime = "0"; @@ -226,9 +226,9 @@ public class SetUpActivity extends FragmentActivity reset.setOnClickListener(v -> { //テキストとラジオボタンの選択を消去 textViewTeacherName.setText(""); textViewStartPoint.setText(""); - setTenMinute.setChecked(false); - setFifteenMinute.setChecked(false); - setThirtyMinute.setChecked(false); + radioButtonTenMinute.setChecked(false); + radioButtonFifteenMinute.setChecked(false); + radioButtonThirtyMinute.setChecked(false); textViewStartBreakTime.setText(""); textViewEndBreakTime.setText(""); textViewTotalStudent.setText(""); -- 2.45.1 From 01c3a27930b22fb765a14d640751c30f308d0231 Mon Sep 17 00:00:00 2001 From: Ekamo-11 <148836598+Ekamo-11@users.noreply.github.com> Date: Fri, 5 Jul 2024 12:06:06 +0900 Subject: [PATCH 08/10] =?UTF-8?q?=E6=A9=9F=E8=83=BD=E3=82=92=E8=AA=AC?= =?UTF-8?q?=E6=98=8E=E3=81=99=E3=82=8B=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/example/oplogy/SetUpActivity.java | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/com/example/oplogy/SetUpActivity.java b/app/src/main/java/com/example/oplogy/SetUpActivity.java index 8b5a419..12060e4 100644 --- a/app/src/main/java/com/example/oplogy/SetUpActivity.java +++ b/app/src/main/java/com/example/oplogy/SetUpActivity.java @@ -175,9 +175,10 @@ public class SetUpActivity extends FragmentActivity SharedPreferences sharedPreferences=getSharedPreferences("visitingDate",MODE_PRIVATE); SharedPreferences.Editor editor= sharedPreferences.edit(); - editor.putString("day1",firstDay); - editor.putString("day2",secondDay); - editor.putString("day3",thirdDay); + //editorに値を渡す + editor.putString("day1",firstDay); //1日目 + editor.putString("day2",secondDay); //2日目 + editor.putString("day3",thirdDay); //3日目 editor.apply(); @@ -186,8 +187,9 @@ public class SetUpActivity extends FragmentActivity }); + //DatePicker用 buttonFirstDay.setOnClickListener(v ->{ - intIsDateSelected = 1; + intIsDateSelected = 1; //ボタンの判別(Date) showDatePickerDialog(); //DatePickerの表示 }); @@ -201,9 +203,10 @@ public class SetUpActivity extends FragmentActivity showDatePickerDialog(); }); + //TimePicker用 buttonStartTimeButton.setOnClickListener(v -> { - intIsStartTimeSelected = 1; //ボタンの判別 - showTimePickerDialog(); //TimePickerの表示 + intIsStartTimeSelected = 1; //ボタンの判別(Time) + showTimePickerDialog(); //TimePickerの表示 }); buttonEndTimeButton.setOnClickListener(v -> { @@ -251,8 +254,9 @@ public class SetUpActivity extends FragmentActivity stringYear = String.valueOf(year); //年 stringMonth = String.format(Locale.JAPAN, "%02d", month + 1); //月 stringDayOfMonth = String.format(Locale.JAPAN, "%02d", dayOfMonth); //日 - firstDay = stringYear + stringMonth + stringDayOfMonth; - buttonFirstDay.setText(str); + firstDay = stringYear + stringMonth + stringDayOfMonth; //8桁の文字列を作成 例)20240604 + buttonFirstDay.setText(str); //buttonにformatされた文字列を挿入 + } else if (intIsDateSelected == 2) { stringYear = String.valueOf(year); stringMonth = String.format(Locale.JAPAN, "%02d", month + 1); @@ -277,10 +281,10 @@ public class SetUpActivity extends FragmentActivity String str = String.format(Locale.JAPAN, "%02d:%02d", hourOfDay, minute); // Textviewに保存する形式を設定 if (intIsStartTimeSelected == 1) { - stringHourOfDay = String.format("%02d", hourOfDay); - stringMinute = String.format("%02d", minute); - startTime = stringHourOfDay + stringMinute; - textViewStartTime.setText(str); + stringHourOfDay = String.format("%02d", hourOfDay); //時 + stringMinute = String.format("%02d", minute); //分 + startTime = stringHourOfDay + stringMinute; //4桁の文字列を作成 例)0930 + textViewStartTime.setText(str); //textViewにformatされている文字列を挿入 } else if (intIsStartTimeSelected == 2) { stringHourOfDay = String.format("%02d", hourOfDay); @@ -302,12 +306,12 @@ public class SetUpActivity extends FragmentActivity } } - private void showDatePickerDialog() { + private void showDatePickerDialog() { //DatePickerDialogを表示する DialogFragment newFragment = new DatePick(); newFragment.show(getSupportFragmentManager(), "datePicker"); } - private void showTimePickerDialog() { // Dialogを表示する + private void showTimePickerDialog() { // TimePickerDialogを表示する DialogFragment newFragment = new TimePick(); newFragment.show(getSupportFragmentManager(), "timePicker"); } -- 2.45.1 From 4808e7a761217d4b4ea949ecf27b1dfc9546ec54 Mon Sep 17 00:00:00 2001 From: Ekamo-11 <148836598+Ekamo-11@users.noreply.github.com> Date: Fri, 5 Jul 2024 12:50:53 +0900 Subject: [PATCH 09/10] =?UTF-8?q?=E5=BF=85=E9=A0=88=E9=A0=85=E7=9B=AE?= =?UTF-8?q?=E3=81=8C=E8=A8=98=E5=85=A5=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F=E3=82=89=E3=80=82Toast?= =?UTF-8?q?=E3=81=A7=E3=81=9D=E3=81=AE=E7=8A=B6=E6=85=8B=E3=82=92=E7=9F=A5?= =?UTF-8?q?=E3=82=89=E3=81=9B=E3=82=8B=E3=83=97=E3=83=AD=E3=82=B0=E3=83=A9?= =?UTF-8?q?=E3=83=A0=E3=82=92=E4=BD=9C=E6=88=90=E3=81=97=E3=81=BE=E3=81=97?= =?UTF-8?q?=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/example/oplogy/SetUpActivity.java | 23 ++++++++++++++++++- app/src/main/res/layout/activity_set_up.xml | 6 ++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/example/oplogy/SetUpActivity.java b/app/src/main/java/com/example/oplogy/SetUpActivity.java index 12060e4..24dcdd9 100644 --- a/app/src/main/java/com/example/oplogy/SetUpActivity.java +++ b/app/src/main/java/com/example/oplogy/SetUpActivity.java @@ -10,6 +10,7 @@ import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Paint; import android.os.Bundle; +import android.text.TextUtils; import android.util.Log; import android.widget.Button; import android.widget.DatePicker; @@ -131,10 +132,25 @@ public class SetUpActivity extends FragmentActivity Log.d(TAG, "Interval Time" + intervalTime); Log.d(TAG, "Start Break Time" + startBreakTime); Log.d(TAG, "End Break Time" + endBreakTime); - totalStudent = Integer.parseInt(textViewTotalStudent.getText().toString()); //数値型に変更 Log.d(TAG, "Total Student" + totalStudent); Log.d(TAG, "onClick: できてるよ"); + // クラスの人数を数値に変換して取得 + try { + totalStudent = Integer.parseInt(textViewTotalStudent.getText().toString()); + } catch (NumberFormatException e) { + totalStudent = 0; // デフォルト値を設定するか、エラー処理を追加することも考慮する必要があります + } + + // 入力データのバリデーション + if (TextUtils.isEmpty(teacherName) || TextUtils.isEmpty(startPoint) || TextUtils.isEmpty(startTime) + || TextUtils.isEmpty(firstDay) || TextUtils.isEmpty(secondDay) || TextUtils.isEmpty(thirdDay) + || TextUtils.isEmpty(endTime) || TextUtils.isEmpty(intervalTime) || TextUtils.isEmpty(startBreakTime) + || TextUtils.isEmpty(endBreakTime) || totalStudent <= 0) { + Toast.makeText(SetUpActivity.this, "必須項目を入力してください", Toast.LENGTH_SHORT).show(); + return; + } + // データベースへの登録処理 ExecutorService executor = Executors.newSingleThreadExecutor(); @@ -229,9 +245,14 @@ public class SetUpActivity extends FragmentActivity reset.setOnClickListener(v -> { //テキストとラジオボタンの選択を消去 textViewTeacherName.setText(""); textViewStartPoint.setText(""); + buttonFirstDay.setText(""); + buttonSecondDay.setText(""); + buttonThirdDay.setText(""); radioButtonTenMinute.setChecked(false); radioButtonFifteenMinute.setChecked(false); radioButtonThirtyMinute.setChecked(false); + textViewStartTime.setText(""); + textViewEndTime.setText(""); textViewStartBreakTime.setText(""); textViewEndBreakTime.setText(""); textViewTotalStudent.setText(""); diff --git a/app/src/main/res/layout/activity_set_up.xml b/app/src/main/res/layout/activity_set_up.xml index 966ccbc..bc037db 100644 --- a/app/src/main/res/layout/activity_set_up.xml +++ b/app/src/main/res/layout/activity_set_up.xml @@ -109,7 +109,7 @@ android:id="@+id/setFirstDayButton" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/firstDay" + android:hint="@string/firstDay" android:layout_marginStart="7sp" android:layout_marginEnd="7sp" tools:ignore="DuplicateIds" /> @@ -118,7 +118,7 @@ android:id="@+id/setSecondDayButton" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/secondDay" + android:hint="@string/secondDay" android:layout_marginStart="7sp" android:layout_marginEnd="7sp" tools:ignore="DuplicateIds" /> @@ -127,7 +127,7 @@ android:id="@+id/setThirdDayButton" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/threeDay" + android:hint="@string/threeDay" android:layout_marginStart="7sp" android:layout_marginEnd="7sp" tools:ignore="DuplicateIds" /> -- 2.45.1 From 6f9f4bce7534363c89998c393a53c469395c24fa Mon Sep 17 00:00:00 2001 From: Ekamo-11 <148836598+Ekamo-11@users.noreply.github.com> Date: Fri, 5 Jul 2024 13:11:12 +0900 Subject: [PATCH 10/10] =?UTF-8?q?=E5=BF=85=E9=A0=88=E9=A0=85=E7=9B=AE?= =?UTF-8?q?=E3=81=8C=E8=A8=98=E5=85=A5=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=82=92=E7=94=BB=E9=9D=A2=E3=81=AB=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E3=81=99=E3=82=8B=E6=9D=A1=E4=BB=B6=E3=82=92=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/example/oplogy/SetUpActivity.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/example/oplogy/SetUpActivity.java b/app/src/main/java/com/example/oplogy/SetUpActivity.java index 24dcdd9..d982431 100644 --- a/app/src/main/java/com/example/oplogy/SetUpActivity.java +++ b/app/src/main/java/com/example/oplogy/SetUpActivity.java @@ -25,6 +25,7 @@ import androidx.fragment.app.FragmentActivity; import androidx.room.Room; import java.util.Locale; +import java.util.Objects; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -145,7 +146,7 @@ public class SetUpActivity extends FragmentActivity // 入力データのバリデーション if (TextUtils.isEmpty(teacherName) || TextUtils.isEmpty(startPoint) || TextUtils.isEmpty(startTime) || TextUtils.isEmpty(firstDay) || TextUtils.isEmpty(secondDay) || TextUtils.isEmpty(thirdDay) - || TextUtils.isEmpty(endTime) || TextUtils.isEmpty(intervalTime) || TextUtils.isEmpty(startBreakTime) + || TextUtils.isEmpty(endTime) || Objects.equals(intervalTime, "0") || TextUtils.isEmpty(startBreakTime) || TextUtils.isEmpty(endBreakTime) || totalStudent <= 0) { Toast.makeText(SetUpActivity.this, "必須項目を入力してください", Toast.LENGTH_SHORT).show(); return; @@ -257,6 +258,18 @@ public class SetUpActivity extends FragmentActivity textViewEndBreakTime.setText(""); textViewTotalStudent.setText(""); + teacherName = ""; + startPoint = ""; + firstDay = ""; + secondDay = ""; + thirdDay = ""; + startTime = ""; + endTime = ""; + intervalTime = ""; + startBreakTime = ""; + endBreakTime ="" ; + + ExecutorService executor = Executors.newSingleThreadExecutor(); executor.execute(() -> { AppDatabase db = Room.databaseBuilder(getApplicationContext(), AppDatabase.class, "SetUpTable").build(); -- 2.45.1