add a toggle in Settings to avoid showing Whats new

This commit is contained in:
tibbi 2018-02-12 18:29:15 +01:00
parent b58ed9d532
commit 0b147caf80
2 changed files with 32 additions and 0 deletions

View file

@ -24,6 +24,7 @@ class SettingsActivity : SimpleActivity() {
setupCustomizeColors() setupCustomizeColors()
setupUseEnglish() setupUseEnglish()
setupAvoidWhatsNew()
setupManageFavorites() setupManageFavorites()
setupShowHidden() setupShowHidden()
setupPasswordProtection() setupPasswordProtection()
@ -63,6 +64,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 setupShowHidden() { private fun setupShowHidden() {
settings_show_hidden.isChecked = config.showHidden settings_show_hidden.isChecked = config.showHidden
settings_show_hidden_holder.setOnClickListener { settings_show_hidden_holder.setOnClickListener {

View file

@ -69,6 +69,29 @@
</RelativeLayout> </RelativeLayout>
<RelativeLayout
android:id="@+id/settings_avoid_whats_new_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/normal_margin"
android:paddingRight="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_avoid_whats_new"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:text="@string/avoid_whats_new"/>
</RelativeLayout>
<View <View
android:id="@+id/visibility_divider" android:id="@+id/visibility_divider"
android:layout_width="match_parent" android:layout_width="match_parent"