diff --git a/app/build.gradle b/app/build.gradle index 5948cf7..421e0ff 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,14 +4,14 @@ plugins { } android { - compileSdk 32 + compileSdk 33 defaultConfig { applicationId "rasel.lunar.launcher" minSdk 26 - targetSdk 32 - versionCode 17 - versionName "17.3" + targetSdk 33 + versionCode 18 + versionName "17.4" } buildTypes { @@ -50,13 +50,14 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + namespace 'rasel.lunar.launcher' } dependencies { implementation 'androidx.appcompat:appcompat:1.5.1' implementation 'androidx.biometric:biometric-ktx:1.2.0-alpha04' - implementation 'androidx.core:core-ktx:1.8.0' + implementation 'androidx.core:core-ktx:1.9.0' implementation 'com.google.android.material:material:1.6.1' implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation 'dev.chrisbanes.insetter:insetter:0.6.1' diff --git a/app/src/main/java/rasel/lunar/launcher/apps/AppDrawer.kt b/app/src/main/java/rasel/lunar/launcher/apps/AppDrawer.kt index 331f1f2..f0fdd43 100644 --- a/app/src/main/java/rasel/lunar/launcher/apps/AppDrawer.kt +++ b/app/src/main/java/rasel/lunar/launcher/apps/AppDrawer.kt @@ -28,6 +28,7 @@ import android.content.Context import android.content.Intent import android.content.pm.PackageManager import android.content.pm.ResolveInfo +import android.os.Build import android.os.Bundle import android.view.LayoutInflater import android.view.View @@ -53,8 +54,8 @@ internal class AppDrawer : Fragment() { private lateinit var binding: AppDrawerBinding private lateinit var fragmentActivity: FragmentActivity private val leftSearchArray = arrayOf("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m") - private val leftSearchArrayII = arrayOf("0", "1", "2", "3", "4") - private val rightSearchArray = arrayOf("9", "8", "7", "6", "5") + private val leftSearchArrayII = arrayOf("0", "1", "2", "3", "4", "\u290A") + private val rightSearchArray = arrayOf("9", "8", "7", "6", "5", "\u290B") private val rightSearchArrayII = arrayOf("z", "y", "x", "w", "v", "u", "t", "s", "r", "q", "p", "o", "n") private lateinit var packageNamesArrayList: ArrayList private lateinit var appsAdapter: ArrayAdapter @@ -102,7 +103,6 @@ internal class AppDrawer : Fragment() { super.onSwipeDown() UniUtils().expandNotificationPanel(requireContext()) } - override fun onDoubleClick() { super.onDoubleClick() UniUtils().lockMethod( @@ -140,8 +140,13 @@ internal class AppDrawer : Fragment() { get() { searchString = "" // Fetch all the installed apps - packageList = packageManager.queryIntentActivities( - Intent(Intent.ACTION_MAIN, null).addCategory(Intent.CATEGORY_LAUNCHER), 0) + packageList = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + packageManager.queryIntentActivities( + Intent(Intent.ACTION_MAIN, null).addCategory(Intent.CATEGORY_LAUNCHER), PackageManager.ResolveInfoFlags.of(0)) + } else { + @Suppress("DEPRECATION") packageManager.queryIntentActivities( + Intent(Intent.ACTION_MAIN, null).addCategory(Intent.CATEGORY_LAUNCHER), 0) + } // Sort the app list (packageList as MutableList).sortWith(ResolveInfo.DisplayNameComparator(packageManager)) } @@ -195,12 +200,18 @@ internal class AppDrawer : Fragment() { // Left column 2 binding.leftSearchListII.onItemClickListener = OnItemClickListener { adapterView: AdapterView<*>, _: View?, i: Int, _: Long -> - searchClickHelper(adapterView, i) + when (i) { + leftSearchArrayII.size - 1 -> binding.appsList.setSelection(0) + else -> searchClickHelper(adapterView, i) + } } // Right column 1 binding.rightSearchList.onItemClickListener = OnItemClickListener { adapterView: AdapterView<*>, _: View?, i: Int, _: Long -> - searchClickHelper(adapterView, i) + when (i) { + rightSearchArray.size - 1 -> binding.appsList.setSelection(appsAdapter.count - 1) + else -> searchClickHelper(adapterView, i) + } } // Right column 2 binding.rightSearchListII.onItemClickListener = diff --git a/app/src/main/java/rasel/lunar/launcher/apps/AppMenuUtils.kt b/app/src/main/java/rasel/lunar/launcher/apps/AppMenuUtils.kt index 77c2bef..1e47ba4 100644 --- a/app/src/main/java/rasel/lunar/launcher/apps/AppMenuUtils.kt +++ b/app/src/main/java/rasel/lunar/launcher/apps/AppMenuUtils.kt @@ -38,7 +38,7 @@ internal class AppMenuUtils { @Throws(PackageManager.NameNotFoundException::class) fun getAppName(packageManager: PackageManager, packageName: String): String { return packageManager.getApplicationLabel( - packageManager.getApplicationInfo(packageName, PackageManager.GET_META_DATA) + @Suppress("DEPRECATION") packageManager.getApplicationInfo(packageName, PackageManager.GET_META_DATA) // Todo: deprecated ) as String } diff --git a/fastlane/metadata/android/en-US/changelogs/18.txt b/fastlane/metadata/android/en-US/changelogs/18.txt new file mode 100644 index 0000000..caef432 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/18.txt @@ -0,0 +1,2 @@ +- [New] Scroll to top/bottom of apps list +- [Fix] Few visual improvements \ No newline at end of file