From 789b66b9ed57659f6948e56348f5b303cf14ec60 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 5 Apr 2018 13:37:34 +0200 Subject: [PATCH] add a toggle button for avoiding showing Whats New --- .../flashlight/activities/SettingsActivity.kt | 9 ++++ app/src/main/res/layout/activity_settings.xml | 48 +++++++++++++++++-- 2 files changed, 52 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/SettingsActivity.kt index 381e8be..b03fe8c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/SettingsActivity.kt @@ -19,6 +19,7 @@ class SettingsActivity : SimpleActivity() { setupCustomizeColors() setupUseEnglish() + setupAvoidWhatsNew() setupTurnFlashlightOn() setupBrightDisplay() setupStroboscope() @@ -41,6 +42,14 @@ class SettingsActivity : SimpleActivity() { } } + private fun setupAvoidWhatsNew() { + settings_avoid_whats_new.isChecked = config.avoidWhatsNew + settings_avoid_whats_new_holder.setOnClickListener { + settings_avoid_whats_new.toggle() + config.avoidWhatsNew = settings_avoid_whats_new.isChecked + } + } + private fun setupTurnFlashlightOn() { settings_turn_flashlight_on.isChecked = config.turnFlashlightOn settings_turn_flashlight_on_holder.setOnClickListener { diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 9d63951..4455dae 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -17,7 +17,10 @@ android:layout_height="wrap_content" android:layout_marginTop="@dimen/medium_margin" android:background="?attr/selectableItemBackground" - android:padding="@dimen/activity_margin"> + android:paddingBottom="@dimen/activity_margin" + android:paddingLeft="@dimen/normal_margin" + android:paddingRight="@dimen/normal_margin" + android:paddingTop="@dimen/activity_margin"> + android:paddingBottom="@dimen/activity_margin" + android:paddingLeft="@dimen/normal_margin" + android:paddingRight="@dimen/normal_margin" + android:paddingTop="@dimen/activity_margin"> + + + + + + + android:paddingBottom="@dimen/activity_margin" + android:paddingLeft="@dimen/normal_margin" + android:paddingRight="@dimen/normal_margin" + android:paddingTop="@dimen/activity_margin"> + android:paddingBottom="@dimen/activity_margin" + android:paddingLeft="@dimen/normal_margin" + android:paddingRight="@dimen/normal_margin" + android:paddingTop="@dimen/activity_margin"> + android:paddingBottom="@dimen/activity_margin" + android:paddingLeft="@dimen/normal_margin" + android:paddingRight="@dimen/normal_margin" + android:paddingTop="@dimen/activity_margin">