Merge pull request #1137 from qwertyfinger/dynamic-biometric-tab-title

Add biometric tab dynamically
This commit is contained in:
Tibor Kaputa 2021-08-26 15:34:07 +02:00 committed by GitHub
commit 4db1cfe9d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 8 deletions

View file

@ -50,8 +50,9 @@ class SecurityDialog(
if (showTabIndex == SHOW_ALL_TABS) {
val textColor = context.baseConfig.textColor
if (!shouldShowBiometricIdTab()) {
dialog_tab_layout.removeTabAt(PROTECTION_FINGERPRINT)
if (shouldShowBiometricIdTab()) {
val tabTitle = if (context.isTargetSdkVersion30Plus()) R.string.biometrics else R.string.fingerprint
dialog_tab_layout.addTab(dialog_tab_layout.newTab().setText(tabTitle), PROTECTION_FINGERPRINT)
}
dialog_tab_layout.setTabTextColors(textColor, textColor)

View file

@ -27,12 +27,6 @@
android:layout_height="wrap_content"
android:text="@string/pin"/>
<com.google.android.material.tabs.TabItem
android:id="@+id/dialog_tab_fingerprint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/biometrics"/>
</com.google.android.material.tabs.TabLayout>
<com.simplemobiletools.commons.views.MyDialogViewPager