|
|
@ -45,12 +45,16 @@ class SnoozeDelayPickerActivity : FragmentActivity(), OnItemClickListener {
|
|
|
|
super.onCreate(bundle)
|
|
|
|
super.onCreate(bundle)
|
|
|
|
val intent = intent
|
|
|
|
val intent = intent
|
|
|
|
if (intent == null) finish()
|
|
|
|
if (intent == null) finish()
|
|
|
|
if (intent.data == null) finish()
|
|
|
|
|
|
|
|
val app = applicationContext as HabitsApplication
|
|
|
|
val app = applicationContext as HabitsApplication
|
|
|
|
val appComponent = app.component
|
|
|
|
val appComponent = app.component
|
|
|
|
reminderController = appComponent.reminderController
|
|
|
|
val data = intent.data
|
|
|
|
habit = appComponent.habitList.getById(ContentUris.parseId(intent.data))
|
|
|
|
if (data == null) {
|
|
|
|
|
|
|
|
finish()
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
habit = appComponent.habitList.getById(ContentUris.parseId(data))
|
|
|
|
|
|
|
|
}
|
|
|
|
if (habit == null) finish()
|
|
|
|
if (habit == null) finish()
|
|
|
|
|
|
|
|
reminderController = appComponent.reminderController
|
|
|
|
val theme = R.style.Theme_AppCompat_Light_Dialog_Alert
|
|
|
|
val theme = R.style.Theme_AppCompat_Light_Dialog_Alert
|
|
|
|
dialog = AlertDialog.Builder(ContextThemeWrapper(this, theme))
|
|
|
|
dialog = AlertDialog.Builder(ContextThemeWrapper(this, theme))
|
|
|
|
.setTitle(R.string.select_snooze_delay)
|
|
|
|
.setTitle(R.string.select_snooze_delay)
|
|
|
|