From 9daa05ef02c74a65fddf3a3c210429095ad36f62 Mon Sep 17 00:00:00 2001 From: nullArrayList <99822064+nullArrayList@users.noreply.github.com> Date: Wed, 8 Nov 2023 19:06:41 +0800 Subject: [PATCH] Enable Predictive Back (#214) * Enable Predictive Back Tested with UP1A.231005.007, no bugs * Fix Wrong SDK behaviour --------- Co-authored-by: Lokesh Gidra --- app/src/main/AndroidManifest.xml | 4 ++-- .../com/hippo/ehviewer/ui/scene/SearchBarScene.kt | 13 ++++++++----- .../main/kotlin/com/hippo/ehviewer/util/SDKUtils.kt | 1 + 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b3215d34e..f029150a1 100755 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -23,6 +23,7 @@ android:allowBackup="true" android:appCategory="image" android:dataExtractionRules="@xml/data_extraction_rules" + android:enableOnBackInvokedCallback="true" android:fullBackupContent="@xml/backup_scheme" android:hasFragileUserData="true" android:icon="@mipmap/ic_launcher" @@ -135,8 +136,7 @@ android:launchMode="singleTask" android:taskAffinity="" android:theme="@android:style/Theme.Translucent.NoTitleBar" /> - + = Build.VERSION_CODES.O val isAtLeastP = Build.VERSION.SDK_INT >= Build.VERSION_CODES.P val isAtLeastQ = Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q val isAtLeastR = Build.VERSION.SDK_INT >= Build.VERSION_CODES.R +val isAtLeastT = Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU val isAtLeastU = Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE val isAtLeastSExtension7 = isAtLeastR && SdkExtensions.getExtensionVersion(Build.VERSION_CODES.S) >= 7