Skip to content

Commit 6b7ea00

Browse files
committed
Fixed showing default tab
1 parent 792584b commit 6b7ea00

File tree

1 file changed

+15
-3
lines changed
  • app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities

1 file changed

+15
-3
lines changed

app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/MainActivity.kt

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,11 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
154154
override fun onPause() {
155155
super.onPause()
156156
storeStateVariables()
157+
config.lastUsedViewPagerPage = viewpager.currentItem
157158
}
158159

159160
override fun onDestroy() {
160161
super.onDestroy()
161-
config.lastUsedViewPagerPage = viewpager.currentItem
162162
if (!isChangingConfigurations) {
163163
ContactsDatabase.destroyInstance()
164164
}
@@ -595,8 +595,20 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
595595
TAB_CONTACTS -> 0
596596
TAB_FAVORITES -> if (showTabsMask and TAB_CONTACTS > 0) 1 else 0
597597
else -> {
598-
if (showTabsMask and TAB_CONTACTS > 0) {
599-
if (showTabsMask and TAB_FAVORITES > 0) 2 else 1
598+
if (showTabsMask and TAB_GROUPS > 0) {
599+
if (showTabsMask and TAB_CONTACTS > 0) {
600+
if (showTabsMask and TAB_FAVORITES > 0) {
601+
2
602+
} else {
603+
1
604+
}
605+
} else {
606+
if (showTabsMask and TAB_FAVORITES > 0) {
607+
1
608+
} else {
609+
0
610+
}
611+
}
600612
} else {
601613
0
602614
}

0 commit comments

Comments
 (0)