add a pulsing background to the reminder activity draggable element

This commit is contained in:
tibbi 2018-07-08 14:17:25 +02:00
parent 5552ac2c65
commit d7c2323489
5 changed files with 48 additions and 4 deletions

View File

@ -6,18 +6,17 @@ import android.media.MediaPlayer
import android.net.Uri
import android.os.Bundle
import android.os.Handler
import android.view.animation.AnimationUtils
import com.simplemobiletools.clock.R
import com.simplemobiletools.clock.extensions.*
import com.simplemobiletools.clock.helpers.ALARM_ID
import com.simplemobiletools.clock.helpers.getPassedSeconds
import com.simplemobiletools.clock.models.Alarm
import com.simplemobiletools.commons.extensions.applyColorFilter
import com.simplemobiletools.commons.extensions.beVisibleIf
import com.simplemobiletools.commons.extensions.showPickSecondsDialog
import com.simplemobiletools.commons.extensions.updateTextColors
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.MINUTE_SECONDS
import kotlinx.android.synthetic.main.activity_reminder.*
class ReminderActivity : SimpleActivity() {
private val INCREASE_VOLUME_DELAY = 3000L
@ -52,6 +51,9 @@ class ReminderActivity : SimpleActivity() {
reminder_title.text = label
reminder_text.text = if (isAlarmReminder) getFormattedTime(getPassedSeconds(), false, false) else getString(R.string.time_expired)
reminder_draggable_background.startAnimation(AnimationUtils.loadAnimation(this, R.anim.pulsing_animation))
reminder_draggable_background.applyColorFilter(getAdjustedPrimaryColor())
reminder_stop.setOnClickListener {
finish()
}

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<scale
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1000"
android:fillAfter="false"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="infinite"
android:repeatMode="reverse"
android:toXScale="2.0"
android:toYScale="2.0"/>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid
android:color="@android:color/white"/>
<size
android:width="@dimen/reminder_background_min_size"
android:height="@dimen/reminder_background_min_size"/>
</shape>

View File

@ -43,6 +43,20 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/reminder_draggable"/>
<ImageView
android:id="@+id/reminder_draggable_background"
android:layout_width="@dimen/reminder_background_min_size"
android:layout_height="@dimen/reminder_background_min_size"
android:layout_marginBottom="@dimen/activity_margin"
android:alpha="0.2"
android:padding="@dimen/normal_margin"
android:src="@drawable/pulsing_background"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/reminder_stop"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/reminder_snooze"
app:layout_constraintTop_toBottomOf="@+id/reminder_text"/>
<ImageView
android:id="@+id/reminder_draggable"
android:layout_width="@dimen/stopwatch_button_small_size"

View File

@ -2,6 +2,7 @@
<dimen name="alarm_day_size">38dp</dimen>
<dimen name="stopwatch_button_small_size">60dp</dimen>
<dimen name="stopwatch_button_size">64dp</dimen>
<dimen name="reminder_background_min_size">70dp</dimen>
<dimen name="lap_time_size">80dp</dimen>
<dimen name="widget_alarm_icon_size">18dp</dimen>
<dimen name="widget_time_height">48dp</dimen>