SpreadSheet #3

Merged
Utahshi merged 6 commits from SpreadSheet into master 2024-06-19 05:51:27 +00:00
2 changed files with 23 additions and 5 deletions

View File

@ -4,6 +4,7 @@ import static android.content.ContentValues.TAG;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.TimePickerDialog; import android.app.TimePickerDialog;
import android.content.Intent;
import android.graphics.Paint; import android.graphics.Paint;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log; import android.util.Log;
@ -16,6 +17,7 @@ import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentActivity;
import java.util.Locale; import java.util.Locale;
import java.util.Set;
public class SetUpActivity extends FragmentActivity public class SetUpActivity extends FragmentActivity
@ -73,9 +75,14 @@ public class SetUpActivity extends FragmentActivity
startTimeSetButton = findViewById(R.id.startTimeSetButton); //開始時刻を設定するためのボタン startTimeSetButton = findViewById(R.id.startTimeSetButton); //開始時刻を設定するためのボタン
endTimeSetButton = findViewById(R.id.endTimeSetButton); //終了時刻を設定するためのボタン endTimeSetButton = findViewById(R.id.endTimeSetButton); //終了時刻を設定するためのボタン
TextView backMain = findViewById(R.id.backMain);
Button setUp = findViewById(R.id.setUpButton); //画面下の設定ボタン Button setUp = findViewById(R.id.setUpButton); //画面下の設定ボタン
Button reset = findViewById(R.id.resetButton);
backMain.setOnClickListener(view -> {
Intent intent = new Intent(SetUpActivity.this,MainActivity.class); //main画面へ戻る処理
startActivity(intent);
});
setUp.setOnClickListener(view -> { setUp.setOnClickListener(view -> {
@ -97,12 +104,10 @@ 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(setTotalStudent.getText().toString()); //数値型に変更
Log.d(TAG, "Total Student" + totalStudent); Log.d(TAG, "Total Student" + totalStudent);
Log.d(TAG, "onClick: できてるよ"); Log.d(TAG, "onClick: できてるよ");
}); });
startTimeSetButton.setOnClickListener(v -> { startTimeSetButton.setOnClickListener(v -> {
isStartTimeSelected = 1; //ボタンの判別 isStartTimeSelected = 1; //ボタンの判別
@ -123,6 +128,19 @@ public class SetUpActivity extends FragmentActivity
isStartTimeSelected = 4; isStartTimeSelected = 4;
showTimePickerDialog(); showTimePickerDialog();
}); });
reset.setOnClickListener(v -> { //テキストとラジオボタンの選択を消去
setTeacherName.setText("");
setStartPoint.setText("");
setStartTime.setText("");
setEndTime.setText("");
setTenMinute.setChecked(false);
setFifteenMinute.setChecked(false);
setThirtyMinute.setChecked(false);
setStartBreakTime.setText("");
setEndBreakTime.setText("");
setTotalStudent.setText("");
});
} }
@SuppressLint({"DefaultLocale", "SetTextI18n"}) @SuppressLint({"DefaultLocale", "SetTextI18n"})

View File

@ -10,7 +10,7 @@
<TextView <TextView
android:id="@+id/toMain" android:id="@+id/backMain"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="left" android:layout_gravity="left"