add a stop button to the reminder activity

This commit is contained in:
tibbi
2018-03-14 15:54:58 +01:00
parent 50f5cf3cc5
commit afe7c695af
5 changed files with 27 additions and 7 deletions

View File

@ -161,8 +161,8 @@ class MainActivity : SimpleActivity() {
val faqItems = arrayListOf(
FAQItem(R.string.faq_1_title, R.string.faq_1_text),
FAQItem(R.string.faq_1_title_commons, R.string.faq_1_text_commons),
FAQItem(R.string.faq_2_title_commons, R.string.faq_2_text_commons),
FAQItem(R.string.faq_4_title_commons, R.string.faq_4_text_commons)
FAQItem(R.string.faq_4_title_commons, R.string.faq_4_text_commons),
FAQItem(R.string.faq_2_title_commons, R.string.faq_2_text_commons)
)
startAboutActivity(R.string.app_name, LICENSE_STETHO or LICENSE_NUMBER_PICKER, BuildConfig.VERSION_NAME, faqItems)

View File

@ -1,10 +1,13 @@
package com.simplemobiletools.clock.activities
import android.os.Bundle
import android.os.Handler
import com.simplemobiletools.clock.R
import com.simplemobiletools.clock.extensions.hideTimerNotification
import com.simplemobiletools.clock.extensions.showOverLockscreen
import com.simplemobiletools.clock.extensions.showTimerNotification
import com.simplemobiletools.commons.extensions.getAdjustedPrimaryColor
import com.simplemobiletools.commons.extensions.getColoredDrawableWithColor
import com.simplemobiletools.commons.extensions.updateTextColors
import kotlinx.android.synthetic.main.activity_reminder.*
@ -15,13 +18,21 @@ class ReminderActivity : SimpleActivity() {
setContentView(R.layout.activity_reminder)
showOverLockscreen()
updateTextColors(reminder_holder)
reminder_title.text = getString(R.string.timer)
reminder_text.text = getString(R.string.time_expired)
showTimerNotification()
reminder_stop.background = resources.getColoredDrawableWithColor(R.drawable.circle_background_filled, getAdjustedPrimaryColor())
reminder_stop.setOnClickListener {
finish()
}
Handler().postDelayed({
showTimerNotification()
}, 1000L)
}
override fun onDestroy() {
super.onDestroy()
override fun onStop() {
super.onStop()
hideTimerNotification()
}
}

View File

@ -19,7 +19,6 @@ import com.simplemobiletools.clock.extensions.*
import com.simplemobiletools.commons.extensions.*
import kotlinx.android.synthetic.main.fragment_timer.view.*
class TimerFragment : Fragment() {
private val UPDATE_INTERVAL = 1000L