send the reminder title and text to ReminderActivity via extras

This commit is contained in:
tibbi 2018-03-14 13:50:51 +01:00
parent 472fc90d22
commit f1fe2cf1fa
4 changed files with 32 additions and 3 deletions

View File

@ -3,6 +3,10 @@ package com.simplemobiletools.clock.activities
import android.os.Bundle
import com.simplemobiletools.clock.R
import com.simplemobiletools.clock.extensions.showOverLockscreen
import com.simplemobiletools.clock.helpers.REMINDER_TEXT
import com.simplemobiletools.clock.helpers.REMINDER_TITLE
import com.simplemobiletools.commons.extensions.updateTextColors
import kotlinx.android.synthetic.main.activity_reminder.*
class ReminderActivity : SimpleActivity() {
@ -10,5 +14,8 @@ class ReminderActivity : SimpleActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_reminder)
showOverLockscreen()
updateTextColors(reminder_holder)
reminder_title.text = intent.getStringExtra(REMINDER_TITLE)
reminder_text.text = intent.getStringExtra(REMINDER_TEXT)
}
}

View File

@ -28,9 +28,7 @@ import com.simplemobiletools.clock.extensions.colorLeftDrawable
import com.simplemobiletools.clock.extensions.config
import com.simplemobiletools.clock.extensions.hideNotification
import com.simplemobiletools.clock.extensions.isScreenOn
import com.simplemobiletools.clock.helpers.OPEN_TAB
import com.simplemobiletools.clock.helpers.TAB_TIMER
import com.simplemobiletools.clock.helpers.TIMER_NOTIF_ID
import com.simplemobiletools.clock.helpers.*
import com.simplemobiletools.clock.receivers.TimerReceiver
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.isLollipopPlus
@ -199,6 +197,8 @@ class TimerFragment : Fragment() {
}, context?.config!!.timerMaxReminderSecs * 1000L)
} else {
Intent(context, ReminderActivity::class.java).apply {
putExtra(REMINDER_TITLE, context!!.getString(R.string.timer))
putExtra(REMINDER_TEXT, context!!.getString(R.string.time_expired))
activity?.startActivity(this)
}
}

View File

@ -22,6 +22,8 @@ const val DEFAULT_ALARM_MINUTES = 480
const val DAY_MINUTES = 1440
const val DEFAULT_MAX_ALARM_REMINDER_SECS = 300
const val DEFAULT_MAX_TIMER_REMINDER_SECS = 60
const val REMINDER_TITLE = "reminder_title"
const val REMINDER_TEXT = "reminder_text"
const val OPEN_ALARMS_TAB_INTENT_ID = 9996
const val UPDATE_WIDGET_INTENT_ID = 9997

View File

@ -1,8 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/reminder_holder"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/reminder_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="100dp"
android:textSize="@dimen/extra_big_text_size"
tools:text="Timer expired"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/reminder_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/reminder_title"
android:layout_centerHorizontal="true"
android:paddingTop="@dimen/activity_margin"
android:textSize="@dimen/big_text_size"
tools:text="14:00"/>
</RelativeLayout>