show the current time at alarm notifications to avoid confusion at snooze

This commit is contained in:
tibbi 2018-03-14 20:19:50 +01:00
parent f827645522
commit 732fc3c668
4 changed files with 7 additions and 4 deletions

View File

@ -6,6 +6,7 @@ import android.os.Handler
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.*
import com.simplemobiletools.commons.helpers.MINUTE_SECONDS
@ -29,7 +30,7 @@ class ReminderActivity : SimpleActivity() {
}
reminder_title.text = getString(if (isAlarmReminder) R.string.alarm else R.string.timer)
reminder_text.text = if (isAlarmReminder) getFormattedTime(alarm!!.timeInMinutes * 60, false, false) else getString(R.string.time_expired)
reminder_text.text = if (isAlarmReminder) getFormattedTime(getPassedSeconds(), false, false) else getString(R.string.time_expired)
reminder_stop.background = resources.getColoredDrawableWithColor(R.drawable.circle_background_filled, getAdjustedPrimaryColor())
reminder_stop.setOnClickListener {
finish()

View File

@ -327,7 +327,7 @@ fun Context.getAlarmNotification(pendingIntent: PendingIntent, alarm: Alarm, add
val reminderActivityIntent = getReminderActivityIntent()
val builder = NotificationCompat.Builder(this)
.setContentTitle(getString(R.string.alarm))
.setContentText(getFormattedTime(alarm.timeInMinutes * 60, false, false))
.setContentText(getFormattedTime(getPassedSeconds(), false, false))
.setSmallIcon(R.drawable.ic_alarm)
.setContentIntent(pendingIntent)
.setPriority(Notification.PRIORITY_HIGH)

View File

@ -12,7 +12,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="100dp"
android:textSize="@dimen/extra_big_text_size"
android:textSize="@dimen/reminder_activity_title_size"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
@ -24,7 +24,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="@dimen/activity_margin"
android:textSize="@dimen/big_text_size"
android:textSize="@dimen/reminder_activity_text_size"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/reminder_title"

View File

@ -15,4 +15,6 @@
<dimen name="stopwatch_text_size">60sp</dimen>
<dimen name="widget_time_text_size">48sp</dimen>
<dimen name="widget_details_text_size">14sp</dimen>
<dimen name="reminder_activity_title_size">32sp</dimen>
<dimen name="reminder_activity_text_size">26sp</dimen>
</resources>