Skip to content

Commit b2fe9e6

Browse files
committed
add a toggle for avoiding showing Whats New on startup
1 parent e66ec05 commit b2fe9e6

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ ext {
4545
}
4646

4747
dependencies {
48-
implementation 'com.simplemobiletools:commons:3.9.9'
48+
implementation 'com.simplemobiletools:commons:3.9.10'
4949
implementation 'joda-time:joda-time:2.9.9'
5050

5151
debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion"

app/src/main/kotlin/com/simplemobiletools/contacts/activities/SettingsActivity.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class SettingsActivity : SimpleActivity() {
2020

2121
setupCustomizeColors()
2222
setupUseEnglish()
23+
setupAvoidWhatsNew()
2324
setupShowInfoBubble()
2425
setupShowContactThumbnails()
2526
setupShowPhoneNumbers()
@@ -44,6 +45,14 @@ class SettingsActivity : SimpleActivity() {
4445
}
4546
}
4647

48+
private fun setupAvoidWhatsNew() {
49+
settings_avoid_whats_new.isChecked = config.avoidWhatsNew
50+
settings_avoid_whats_new_holder.setOnClickListener {
51+
settings_avoid_whats_new.toggle()
52+
config.avoidWhatsNew = settings_avoid_whats_new.isChecked
53+
}
54+
}
55+
4756
private fun setupShowInfoBubble() {
4857
settings_show_info_bubble.isChecked = config.showInfoBubble
4958
settings_show_info_bubble_holder.setOnClickListener {

app/src/main/res/layout/activity_settings.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,26 @@
5050

5151
</RelativeLayout>
5252

53+
<RelativeLayout
54+
android:id="@+id/settings_avoid_whats_new_holder"
55+
android:layout_width="match_parent"
56+
android:layout_height="wrap_content"
57+
android:layout_marginTop="@dimen/medium_margin"
58+
android:background="?attr/selectableItemBackground"
59+
android:padding="@dimen/activity_margin">
60+
61+
<com.simplemobiletools.commons.views.MySwitchCompat
62+
android:id="@+id/settings_avoid_whats_new"
63+
android:layout_width="match_parent"
64+
android:layout_height="wrap_content"
65+
android:background="@null"
66+
android:clickable="false"
67+
android:paddingLeft="@dimen/medium_margin"
68+
android:paddingStart="@dimen/medium_margin"
69+
android:text="@string/avoid_whats_new"/>
70+
71+
</RelativeLayout>
72+
5373
<RelativeLayout
5474
android:id="@+id/settings_show_info_bubble_holder"
5575
android:layout_width="match_parent"

0 commit comments

Comments
 (0)