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() var wantedTab = getDefaultTab()
// open the Recents tab if we got here by clicking a missed call notification // 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 wantedTab = main_tabs_holder.tabCount - 1
} }
@ -375,9 +375,11 @@ class MainActivity : SimpleActivity() {
TAB_FAVORITES -> if (showTabsMask and TAB_CONTACTS > 0) 1 else 0 TAB_FAVORITES -> if (showTabsMask and TAB_CONTACTS > 0) 1 else 0
else -> { else -> {
if (showTabsMask and TAB_CONTACTS > 0) { 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 { } 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.commons.views.MyAppCompatCheckbox
import com.simplemobiletools.dialer.R import com.simplemobiletools.dialer.R
import com.simplemobiletools.dialer.extensions.config import com.simplemobiletools.dialer.extensions.config
import com.simplemobiletools.dialer.helpers.ALL_TABS_MASK
class ManageVisibleTabsDialog(val activity: BaseSimpleActivity) { class ManageVisibleTabsDialog(val activity: BaseSimpleActivity) {
private var view = activity.layoutInflater.inflate(R.layout.dialog_manage_visible_tabs, null) 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 activity.config.showTabs = result
} }
} }

View File

@ -139,6 +139,27 @@
</RelativeLayout> </RelativeLayout>
<RelativeLayout
android:id="@+id/settings_manage_tabs_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingStart="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/normal_margin"
android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_manage_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingStart="@dimen/medium_margin"
android:text="@string/manage_shown_tabs" />
</RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/settings_font_size_holder" android:id="@+id/settings_font_size_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -171,27 +192,6 @@
</RelativeLayout> </RelativeLayout>
<RelativeLayout
android:id="@+id/settings_manage_tabs_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingStart="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/normal_margin"
android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_manage_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingStart="@dimen/medium_margin"
android:text="@string/manage_shown_tabs" />
</RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/settings_default_tab_holder" android:id="@+id/settings_default_tab_holder"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -36,9 +36,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_margin" android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin" android:paddingTop="@dimen/activity_margin"
android:text="@string/call_history_tab" android:text="@string/call_history_tab"/>
android:alpha="0.5"
android:enabled="false"/>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>