split ReminderActivty setup into some smaller functions
This commit is contained in:
parent
c5f9dd2906
commit
72b31819d8
|
@ -51,6 +51,17 @@ class ReminderActivity : SimpleActivity() {
|
|||
|
||||
reminder_title.text = label
|
||||
reminder_text.text = if (isAlarmReminder) getFormattedTime(getPassedSeconds(), false, false) else getString(R.string.time_expired)
|
||||
|
||||
val maxDuration = if (isAlarmReminder) config.alarmMaxReminderSecs else config.timerMaxReminderSecs
|
||||
maxReminderDurationHandler.postDelayed({
|
||||
finishActivity()
|
||||
}, maxDuration * 1000L)
|
||||
|
||||
setupButtons()
|
||||
setupAudio()
|
||||
}
|
||||
|
||||
private fun setupButtons() {
|
||||
reminder_draggable_background.startAnimation(AnimationUtils.loadAnimation(this, R.anim.pulsing_animation))
|
||||
reminder_draggable_background.applyColorFilter(getAdjustedPrimaryColor())
|
||||
|
||||
|
@ -63,12 +74,9 @@ class ReminderActivity : SimpleActivity() {
|
|||
reminder_snooze.setOnClickListener {
|
||||
snoozeClicked()
|
||||
}
|
||||
}
|
||||
|
||||
val maxDuration = if (isAlarmReminder) config.alarmMaxReminderSecs else config.timerMaxReminderSecs
|
||||
maxReminderDurationHandler.postDelayed({
|
||||
finishActivity()
|
||||
}, maxDuration * 1000L)
|
||||
|
||||
private fun setupAudio() {
|
||||
if (!isAlarmReminder || !config.increaseVolumeGradually) {
|
||||
lastVolumeValue = 1f
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue