Added possibility to hide call history

This commit is contained in:
Agnieszka C
2021-10-09 15:10:42 +02:00
parent 4426d42fe9
commit ee399c372f
4 changed files with 32 additions and 27 deletions

View File

@ -265,7 +265,7 @@ class MainActivity : SimpleActivity() {
var wantedTab = getDefaultTab()
// open the Recents tab if we got here by clicking a missed call notification
if (intent.action == Intent.ACTION_VIEW) {
if (intent.action == Intent.ACTION_VIEW && config.showTabs and TAB_CALL_HISTORY > 0) {
wantedTab = main_tabs_holder.tabCount - 1
}
@ -375,9 +375,11 @@ class MainActivity : SimpleActivity() {
TAB_FAVORITES -> if (showTabsMask and TAB_CONTACTS > 0) 1 else 0
else -> {
if (showTabsMask and TAB_CONTACTS > 0) {
if (showTabsMask and TAB_FAVORITES > 0) 2 else 1
if (showTabsMask and TAB_FAVORITES > 0 && showTabsMask and TAB_CALL_HISTORY > 0) 2
else if (showTabsMask and TAB_CALL_HISTORY > 0) 1
else 0
} else {
if (showTabsMask and TAB_FAVORITES > 0) 1 else 0
if (showTabsMask and TAB_FAVORITES > 0 && showTabsMask and TAB_CALL_HISTORY > 0) 1 else 0
}
}
}

View File

@ -9,6 +9,7 @@ import com.simplemobiletools.commons.helpers.TAB_CALL_HISTORY
import com.simplemobiletools.commons.views.MyAppCompatCheckbox
import com.simplemobiletools.dialer.R
import com.simplemobiletools.dialer.extensions.config
import com.simplemobiletools.dialer.helpers.ALL_TABS_MASK
class ManageVisibleTabsDialog(val activity: BaseSimpleActivity) {
private var view = activity.layoutInflater.inflate(R.layout.dialog_manage_visible_tabs, null)
@ -42,6 +43,10 @@ class ManageVisibleTabsDialog(val activity: BaseSimpleActivity) {
}
}
if (result == 0) {
result = ALL_TABS_MASK
}
activity.config.showTabs = result
}
}