From 060f966f0760b713414fb22f56083173a2695458 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 27 Feb 2018 20:49:08 +0100 Subject: [PATCH] add the toggle for sleep preventing in release notes --- .../calculator/activities/MainActivity.kt | 9 +++++++++ app/src/main/res/values/donottranslate.xml | 7 +++++++ 2 files changed, 16 insertions(+) create mode 100644 app/src/main/res/values/donottranslate.xml diff --git a/app/src/main/kotlin/com/simplemobiletools/calculator/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calculator/activities/MainActivity.kt index c5f168e5..098bf613 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calculator/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calculator/activities/MainActivity.kt @@ -18,6 +18,7 @@ import com.simplemobiletools.commons.helpers.LICENSE_ESPRESSO import com.simplemobiletools.commons.helpers.LICENSE_KOTLIN import com.simplemobiletools.commons.helpers.LICENSE_ROBOLECTRIC import com.simplemobiletools.commons.models.FAQItem +import com.simplemobiletools.commons.models.Release import kotlinx.android.synthetic.main.activity_main.* import me.grantland.widget.AutofitHelper @@ -58,6 +59,7 @@ class MainActivity : SimpleActivity(), Calculator { AutofitHelper.create(formula) storeStateVariables() updateViewColors(calculator_holder, config.textColor) + checkWhatsNewDialog() } override fun onResume() { @@ -147,6 +149,13 @@ class MainActivity : SimpleActivity(), Calculator { result.text = value } + private fun checkWhatsNewDialog() { + arrayListOf().apply { + add(Release(18, R.string.release_18)) + checkWhatsNew(this, BuildConfig.VERSION_CODE) + } + } + // used only by Robolectric override fun setValueDouble(d: Double) { calc.setValue(Formatter.doubleToString(d)) diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml new file mode 100644 index 00000000..17078ecb --- /dev/null +++ b/app/src/main/res/values/donottranslate.xml @@ -0,0 +1,7 @@ + + + + + Added a toggle for preventing the phone from sleeping, enabled by default + +