revert to the old UI if a Timer invokes the reminder activity

This commit is contained in:
tibbi 2018-07-08 22:48:03 +02:00
parent 037ff0c55f
commit 4010ce3317
2 changed files with 34 additions and 3 deletions

View File

@ -65,8 +65,19 @@ class ReminderActivity : SimpleActivity() {
}
private fun setupButtons() {
if (isAlarmReminder) {
setupAlarmButtons()
} else {
setupTimerButtons()
}
}
private fun setupAlarmButtons() {
reminder_stop.beGone()
reminder_draggable_background.startAnimation(AnimationUtils.loadAnimation(this, R.anim.pulsing_animation))
reminder_draggable_background.applyColorFilter(getAdjustedPrimaryColor())
reminder_snooze.applyColorFilter(config.textColor)
var minDragX = 0f
var maxDragX = 0f
var initialDraggableX = 0f
@ -116,9 +127,17 @@ class ReminderActivity : SimpleActivity() {
}
true
}
}
reminder_snooze.beVisibleIf(isAlarmReminder)
reminder_snooze.applyColorFilter(config.textColor)
private fun setupTimerButtons() {
reminder_stop.background = resources.getColoredDrawableWithColor(R.drawable.circle_background_filled, getAdjustedPrimaryColor())
arrayOf(reminder_snooze, reminder_draggable_background, reminder_draggable, reminder_dismiss).forEach {
it.beGone()
}
reminder_stop.setOnClickListener {
finish()
}
}
private fun setupAudio() {

View File

@ -17,7 +17,7 @@
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Timer expired"/>
tools:text="@string/time_expired"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/reminder_text"
@ -94,4 +94,16 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/reminder_draggable"/>
<ImageView
android:id="@+id/reminder_stop"
android:layout_width="@dimen/stopwatch_button_size"
android:layout_height="@dimen/stopwatch_button_size"
android:layout_marginBottom="@dimen/big_margin"
android:padding="@dimen/normal_margin"
android:src="@drawable/ic_stop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"/>
</android.support.constraint.ConstraintLayout>