@@ -41,7 +41,6 @@ protected void onCreate(Bundle savedInstanceState) {
41
41
setContentView (binding .getRoot ());
42
42
initDatabase ();
43
43
initUI ();
44
- // initDialog();
45
44
initListener ();
46
45
}
47
46
@@ -66,47 +65,9 @@ private void initUI(){
66
65
binding .recyclerView .setAdapter (alarmAdapter );
67
66
binding .recyclerView .setLayoutManager (new LinearLayoutManager (this ));
68
67
}
69
- // private void initDialog(){
70
- // //Floating Btn
71
- // var dialogBinding = ActivityEditAlarmBinding.inflate(getLayoutInflater());
72
- // binding.floatingBtn.setOnClickListener(v -> {
73
- // AlertDialog.Builder builder = new AlertDialog.Builder(this);
74
- // alertDialog = builder.setView(dialogBinding.getRoot())
75
- // .setCancelable(false)
76
- // .create();
77
- // alertDialog.setOnShowListener(dialog -> {
78
- // alertDialog.getWindow().setBackgroundDrawableResource(R.drawable.bg_dialog);
79
- // });
80
- // alertDialog.show();
81
- // });
82
- //
83
- // dialogBinding.timePicker.setOnTimeChangedListener((view, hourOfDay, minute) -> {
84
- // calendar.set(Calendar.HOUR_OF_DAY, hourOfDay);
85
- // calendar.set(Calendar.MINUTE,minute);
86
- //
87
- // int currentHour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
88
- // int currentMinute = Calendar.getInstance().get(Calendar.MINUTE);
89
- // int totalCurrentMinute = currentHour * 60 + currentMinute;
90
- // int totalSelectedMinute = hourOfDay * 60 + minute;
91
- // int totalResultMinute = totalSelectedMinute - totalCurrentMinute;
92
- // int resultHour = totalResultMinute / 60;
93
- // int resultMinute = totalResultMinute % 60;
94
- // if(totalResultMinute < 0){
95
- // resultHour = -resultHour;
96
- // resultMinute = -resultMinute;
97
- // }
98
- // dialogBinding.hour.setText(String.valueOf(resultHour));
99
- // dialogBinding.minute.setText(String.format("%02d",resultMinute));
100
- // });
101
- //
102
- // }
103
- // private void initListener(){
104
- // dialogBinding.btnCancel.setOnClickListener(v -> {
105
- // alertDialog.cancel();
106
- // });
107
- // }
108
68
private void initListener (){
109
69
binding .floatingBtn .setOnClickListener (v -> {
70
+ refreshView ();
110
71
Intent intent = new Intent (this , EditAlarm .class );
111
72
startActivityForResult (intent ,CREATE_REQUEST_CODE );
112
73
});
0 commit comments