pref: 适配 Android 13 预测性返回手势

This commit is contained in:
HuanCheng65 2022-08-31 14:05:13 +08:00
parent 819a88ba62
commit 612e73afd4
No known key found for this signature in database
GPG Key ID: E9031EF91A805148
3 changed files with 3 additions and 2 deletions

View File

@ -46,6 +46,7 @@
<application
android:name=".BaseApplication"
android:enableOnBackInvokedCallback="true"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_descriptor"

View File

@ -144,7 +144,7 @@ class AppThemeActivity : BaseActivity() {
ChatBubbleStyleAdapter.Bubble { context, _, parent ->
val view = LayoutInflater.from(context)
.inflate(R.layout.layout_bubble_toolbar_primary_color, parent, false)
view.findViewById<TintSwitch>(R.id.theme_toolbar_primary_color).apply {
view.findViewById<TintSwitch>(R.id.theme_toolbar_primary_color)?.apply {
setOnCheckedChangeListener(null)
isChecked = appPreferences.toolbarPrimaryColor
setOnCheckedChangeListener { _, isChecked ->

View File

@ -225,7 +225,7 @@ open class MainActivity : BaseActivity(), NavigationBarView.OnItemSelectedListen
.show()
dataStore.putBoolean(SP_SHOULD_SHOW_SNACKBAR, false)
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU && AccountUtil.isLoggedIn(this)) {
requestPermission {
permissions = listOf(PermissionUtils.POST_NOTIFICATIONS)
description = getString(R.string.desc_permission_post_notifications)