Merge pull request #956 from ismailnurudeen/fix/show-tab-pref

fix: move show tab pref to own config
This commit is contained in:
Tibor Kaputa 2023-03-23 11:00:52 +01:00 committed by GitHub
commit fb6be67cfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -63,7 +63,7 @@ android {
}
dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:2794ea914a'
implementation 'com.github.SimpleMobileTools:Simple-Commons:8de9887b36'
implementation 'com.googlecode.ez-vcard:ez-vcard:0.11.3'
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'

View File

@ -2,9 +2,14 @@ package com.simplemobiletools.contacts.pro.helpers
import android.content.Context
import com.simplemobiletools.commons.helpers.BaseConfig
import com.simplemobiletools.commons.helpers.SHOW_TABS
class Config(context: Context) : BaseConfig(context) {
companion object {
fun newInstance(context: Context) = Config(context)
}
var showTabs: Int
get() = prefs.getInt(SHOW_TABS, ALL_TABS_MASK)
set(showTabs) = prefs.edit().putInt(SHOW_TABS, showTabs).apply()
}

View File

@ -28,6 +28,7 @@ val tabsList = arrayListOf(
TAB_FAVORITES,
TAB_GROUPS
)
const val ALL_TABS_MASK = TAB_CONTACTS or TAB_FAVORITES or TAB_GROUPS
// phone number/email types
const val CELL = "CELL"