From 97ba10d3a73653ba2a0bca880db047205d38a7d5 Mon Sep 17 00:00:00 2001 From: MM20 <15646950+MM2-0@users.noreply.github.com> Date: Sat, 29 Jan 2022 19:32:53 +0100 Subject: [PATCH] Remove obsolete API level checks --- .../launcher2/activity/AddItemActivity.kt | 23 ++-- .../fragment/PreferencesAppearanceFragment.kt | 5 - .../launcher2/applications/AppRepository.kt | 6 +- .../launcher2/search/data/AppSerialization.kt | 2 - .../mm20/launcher2/search/data/AppShortcut.kt | 3 +- .../mm20/launcher2/search/data/LauncherApp.kt | 45 ++++--- .../mm20/launcher2/graphics/BadgeDrawable.kt | 2 +- .../crashreporter/utils/CrashUtil.java | 12 +- .../icons/ClockDynamicLauncherIcon.kt | 1 - .../providers/GoogleClockIconProvider.kt | 1 - .../icons/providers/IconPackIconProvider.kt | 2 +- .../icons/providers/ThemedIconProvider.kt | 3 - .../launcher2/ui/LauncherIconShapeAmbient.kt | 9 +- .../search/ApplicationDetailRepresentation.kt | 118 +++++++++--------- .../search/ShortcutDetailRepresentation.kt | 1 - .../ui/legacy/searchable/SearchableView.kt | 6 +- .../ui/legacy/view/LauncherIconView.kt | 1 - 17 files changed, 105 insertions(+), 135 deletions(-) diff --git a/app/src/main/java/de/mm20/launcher2/activity/AddItemActivity.kt b/app/src/main/java/de/mm20/launcher2/activity/AddItemActivity.kt index fe71a43d..259e43b5 100644 --- a/app/src/main/java/de/mm20/launcher2/activity/AddItemActivity.kt +++ b/app/src/main/java/de/mm20/launcher2/activity/AddItemActivity.kt @@ -3,7 +3,6 @@ package de.mm20.launcher2.activity; import android.app.Activity import android.content.Context import android.content.pm.LauncherApps -import android.os.Build import android.os.Bundle import de.mm20.launcher2.favorites.FavoritesRepository import de.mm20.launcher2.search.data.AppShortcut @@ -15,18 +14,16 @@ class AddItemActivity : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - val launcherApps = getSystemService(Context.LAUNCHER_APPS_SERVICE) as LauncherApps - val pinRequest = launcherApps.getPinItemRequest(intent) ?: return run { finish() } - val shortcutInfo = pinRequest.shortcutInfo ?: return run { finish() } - val shortcut = AppShortcut( - this.applicationContext, shortcutInfo, - packageManager.getApplicationInfo(shortcutInfo.`package`, 0) - .loadLabel(packageManager).toString() - ) - if (pinRequest.accept()) { - favoritesRepository.pinItem(shortcut) - } + val launcherApps = getSystemService(Context.LAUNCHER_APPS_SERVICE) as LauncherApps + val pinRequest = launcherApps.getPinItemRequest(intent) ?: return run { finish() } + val shortcutInfo = pinRequest.shortcutInfo ?: return run { finish() } + val shortcut = AppShortcut( + this.applicationContext, shortcutInfo, + packageManager.getApplicationInfo(shortcutInfo.`package`, 0) + .loadLabel(packageManager).toString() + ) + if (pinRequest.accept()) { + favoritesRepository.pinItem(shortcut) } finish() } diff --git a/app/src/main/java/de/mm20/launcher2/fragment/PreferencesAppearanceFragment.kt b/app/src/main/java/de/mm20/launcher2/fragment/PreferencesAppearanceFragment.kt index c0c174fd..c1deece7 100644 --- a/app/src/main/java/de/mm20/launcher2/fragment/PreferencesAppearanceFragment.kt +++ b/app/src/main/java/de/mm20/launcher2/fragment/PreferencesAppearanceFragment.kt @@ -96,11 +96,6 @@ class PreferencesAppearanceFragment : PreferenceFragmentCompat() { .show() true } - - val systemBarsCategory = findPreference("system_bars")!! - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { - systemBarsCategory.removePreference(findPreference("light_nav_bar")) - } } diff --git a/applications/src/main/java/de/mm20/launcher2/applications/AppRepository.kt b/applications/src/main/java/de/mm20/launcher2/applications/AppRepository.kt index 399320ef..5cabc788 100644 --- a/applications/src/main/java/de/mm20/launcher2/applications/AppRepository.kt +++ b/applications/src/main/java/de/mm20/launcher2/applications/AppRepository.kt @@ -40,11 +40,7 @@ internal class AppRepositoryImpl( private val profiles: List = - if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { - launcherApps.profiles.takeIf { it.isNotEmpty() } ?: listOf(Process.myUserHandle()) - } else { - listOf(Process.myUserHandle()) - } + launcherApps.profiles.takeIf { it.isNotEmpty() } ?: listOf(Process.myUserHandle()) private val installingPackages = mutableMapOf() diff --git a/applications/src/main/java/de/mm20/launcher2/search/data/AppSerialization.kt b/applications/src/main/java/de/mm20/launcher2/search/data/AppSerialization.kt index d0a9ad15..26e61abf 100644 --- a/applications/src/main/java/de/mm20/launcher2/search/data/AppSerialization.kt +++ b/applications/src/main/java/de/mm20/launcher2/search/data/AppSerialization.kt @@ -48,7 +48,6 @@ class LauncherAppDeserializer(val context: Context) : SearchableDeserializer { } class AppShortcutSerializer : SearchableSerializer { - @RequiresApi(Build.VERSION_CODES.N_MR1) override fun serialize(searchable: Searchable): String { searchable as AppShortcut return jsonObjectOf( @@ -67,7 +66,6 @@ class AppShortcutDeserializer( val context: Context ) : SearchableDeserializer, KoinComponent { - @RequiresApi(Build.VERSION_CODES.N_MR1) override fun deserialize(serialized: String): Searchable? { val launcherApps = context.getSystemService(Context.LAUNCHER_APPS_SERVICE) as LauncherApps if (!launcherApps.hasShortcutHostPermission()) return null diff --git a/applications/src/main/java/de/mm20/launcher2/search/data/AppShortcut.kt b/applications/src/main/java/de/mm20/launcher2/search/data/AppShortcut.kt index ea883673..6d67c96c 100644 --- a/applications/src/main/java/de/mm20/launcher2/search/data/AppShortcut.kt +++ b/applications/src/main/java/de/mm20/launcher2/search/data/AppShortcut.kt @@ -22,7 +22,6 @@ import de.mm20.launcher2.preferences.Settings.IconSettings.LegacyIconBackground import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext -@RequiresApi(Build.VERSION_CODES.N_MR1) class AppShortcut( context: Context, val launcherShortcut: ShortcutInfo, @@ -78,7 +77,7 @@ class AppShortcut( context.resources.displayMetrics.densityDpi ) } ?: return null - if (isAtLeastApiLevel(Build.VERSION_CODES.O) && icon is AdaptiveIconDrawable) { + if (icon is AdaptiveIconDrawable) { return LauncherIcon( foreground = icon.foreground, background = icon.background, diff --git a/applications/src/main/java/de/mm20/launcher2/search/data/LauncherApp.kt b/applications/src/main/java/de/mm20/launcher2/search/data/LauncherApp.kt index 4fe3d563..9f31ae3c 100644 --- a/applications/src/main/java/de/mm20/launcher2/search/data/LauncherApp.kt +++ b/applications/src/main/java/de/mm20/launcher2/search/data/LauncherApp.kt @@ -8,15 +8,12 @@ import android.content.pm.LauncherApps import android.content.pm.PackageManager import android.content.pm.ShortcutInfo import android.graphics.drawable.AdaptiveIconDrawable -import android.os.Build import android.os.Bundle import android.os.Process import android.os.UserHandle import androidx.core.content.getSystemService import de.mm20.launcher2.icons.LauncherIcon import de.mm20.launcher2.ktx.getSerialNumber -import de.mm20.launcher2.preferences.LauncherPreferences -import de.mm20.launcher2.preferences.Settings import de.mm20.launcher2.preferences.Settings.IconSettings.LegacyIconBackground import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext @@ -36,26 +33,24 @@ class LauncherApp( version = getPackageVersionName(context, launcherActivityInfo.applicationInfo.packageName), shortcuts = run { val appShortcuts = mutableListOf() - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) { - val launcherApps = context.getSystemService()!! - if (!launcherApps.hasShortcutHostPermission()) return@run appShortcuts - val query = LauncherApps.ShortcutQuery() - .setPackage(launcherActivityInfo.applicationInfo.packageName) - .setQueryFlags(LauncherApps.ShortcutQuery.FLAG_MATCH_DYNAMIC or LauncherApps.ShortcutQuery.FLAG_MATCH_MANIFEST) - val shortcuts = try { - launcherApps.getShortcuts(query, launcherActivityInfo.user) - } catch (e: IllegalStateException) { - emptyList() - } - appShortcuts.addAll(shortcuts?.map { - AppShortcut( - context, - it, - launcherActivityInfo.label.toString() - ) - } - ?: emptyList()) + val launcherApps = context.getSystemService()!! + if (!launcherApps.hasShortcutHostPermission()) return@run appShortcuts + val query = LauncherApps.ShortcutQuery() + .setPackage(launcherActivityInfo.applicationInfo.packageName) + .setQueryFlags(LauncherApps.ShortcutQuery.FLAG_MATCH_DYNAMIC or LauncherApps.ShortcutQuery.FLAG_MATCH_MANIFEST) + val shortcuts = try { + launcherApps.getShortcuts(query, launcherActivityInfo.user) + } catch (e: IllegalStateException) { + emptyList() } + appShortcuts.addAll(shortcuts?.map { + AppShortcut( + context, + it, + launcherActivityInfo.label.toString() + ) + } + ?: emptyList()) appShortcuts } ), KoinComponent { @@ -73,7 +68,11 @@ class LauncherApp( return launcherActivityInfo.user } - override suspend fun loadIcon(context: Context, size: Int, legacyIconBackground: LegacyIconBackground): LauncherIcon? { + override suspend fun loadIcon( + context: Context, + size: Int, + legacyIconBackground: LegacyIconBackground + ): LauncherIcon? { try { val icon = withContext(Dispatchers.IO) { diff --git a/base/src/main/java/de/mm20/launcher2/graphics/BadgeDrawable.kt b/base/src/main/java/de/mm20/launcher2/graphics/BadgeDrawable.kt index 369b2c65..d3ccb2cc 100644 --- a/base/src/main/java/de/mm20/launcher2/graphics/BadgeDrawable.kt +++ b/base/src/main/java/de/mm20/launcher2/graphics/BadgeDrawable.kt @@ -17,7 +17,7 @@ class BadgeDrawable(context: Context, drawable: Drawable) : Drawable() { init { val size = (28.8 * context.dp).roundToInt() - val drw: Drawable = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && drawable is AdaptiveIconDrawable) { + val drw: Drawable = if (drawable is AdaptiveIconDrawable) { LayerDrawable(arrayOf( drawable.background, drawable.foreground diff --git a/crashreporter/src/main/java/com/balsikandar/crashreporter/utils/CrashUtil.java b/crashreporter/src/main/java/com/balsikandar/crashreporter/utils/CrashUtil.java index 85e56319..32004420 100644 --- a/crashreporter/src/main/java/com/balsikandar/crashreporter/utils/CrashUtil.java +++ b/crashreporter/src/main/java/com/balsikandar/crashreporter/utils/CrashUtil.java @@ -124,13 +124,11 @@ public class CrashUtil { } private static void createNotificationChannel(NotificationManager notificationManager, Context context) { - if (Build.VERSION.SDK_INT >= 26) { - CharSequence name = context.getString(R.string.notification_crash_report_title); - String description = ""; - NotificationChannel channel = new NotificationChannel(CHANNEL_NOTIFICATION_ID, name, NotificationManager.IMPORTANCE_DEFAULT); - channel.setDescription(description); - notificationManager.createNotificationChannel(channel); - } + CharSequence name = context.getString(R.string.notification_crash_report_title); + String description = ""; + NotificationChannel channel = new NotificationChannel(CHANNEL_NOTIFICATION_ID, name, NotificationManager.IMPORTANCE_DEFAULT); + channel.setDescription(description); + notificationManager.createNotificationChannel(channel); } private static String getStackTrace(Throwable e) { diff --git a/icons/src/main/java/de/mm20/launcher2/icons/ClockDynamicLauncherIcon.kt b/icons/src/main/java/de/mm20/launcher2/icons/ClockDynamicLauncherIcon.kt index b74fd8e5..c596db9e 100644 --- a/icons/src/main/java/de/mm20/launcher2/icons/ClockDynamicLauncherIcon.kt +++ b/icons/src/main/java/de/mm20/launcher2/icons/ClockDynamicLauncherIcon.kt @@ -10,7 +10,6 @@ import androidx.annotation.RequiresApi import java.util.* import kotlin.math.roundToInt -@RequiresApi(Build.VERSION_CODES.O) class ClockDynamicLauncherIcon( foreground: LayerDrawable, background: Drawable?, diff --git a/icons/src/main/java/de/mm20/launcher2/icons/providers/GoogleClockIconProvider.kt b/icons/src/main/java/de/mm20/launcher2/icons/providers/GoogleClockIconProvider.kt index bdd88d08..51885791 100644 --- a/icons/src/main/java/de/mm20/launcher2/icons/providers/GoogleClockIconProvider.kt +++ b/icons/src/main/java/de/mm20/launcher2/icons/providers/GoogleClockIconProvider.kt @@ -14,7 +14,6 @@ import de.mm20.launcher2.search.data.Searchable class GoogleClockIconProvider(val context: Context) : IconProvider { override suspend fun getIcon(searchable: Searchable, size: Int): LauncherIcon? { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) return null if (searchable !is Application) return null if (searchable.`package` != "com.google.android.deskclock") return null val pm = context.packageManager diff --git a/icons/src/main/java/de/mm20/launcher2/icons/providers/IconPackIconProvider.kt b/icons/src/main/java/de/mm20/launcher2/icons/providers/IconPackIconProvider.kt index 1957c529..5da6cac6 100644 --- a/icons/src/main/java/de/mm20/launcher2/icons/providers/IconPackIconProvider.kt +++ b/icons/src/main/java/de/mm20/launcher2/icons/providers/IconPackIconProvider.kt @@ -48,7 +48,7 @@ class IconPackIconProvider( ?: return generateIcon(context, searchable.launcherActivityInfo, size) val drawable = ResourcesCompat.getDrawable(res, resId, context.theme) ?: return null return when { - Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && drawable is AdaptiveIconDrawable -> { + drawable is AdaptiveIconDrawable -> { LauncherIcon( foreground = drawable.foreground, background = drawable.background, diff --git a/icons/src/main/java/de/mm20/launcher2/icons/providers/ThemedIconProvider.kt b/icons/src/main/java/de/mm20/launcher2/icons/providers/ThemedIconProvider.kt index 5b941733..0f75043a 100644 --- a/icons/src/main/java/de/mm20/launcher2/icons/providers/ThemedIconProvider.kt +++ b/icons/src/main/java/de/mm20/launcher2/icons/providers/ThemedIconProvider.kt @@ -81,9 +81,6 @@ class ThemedIconProvider( } private fun getClockIcon(resources: Resources, resId: Int): LauncherIcon? { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { - return null - } try { val array = resources.obtainTypedArrayOrNull(resId) ?: return null var i = 0 diff --git a/ui/src/main/java/de/mm20/launcher2/ui/LauncherIconShapeAmbient.kt b/ui/src/main/java/de/mm20/launcher2/ui/LauncherIconShapeAmbient.kt index cd2627fa..39e90bbf 100644 --- a/ui/src/main/java/de/mm20/launcher2/ui/LauncherIconShapeAmbient.kt +++ b/ui/src/main/java/de/mm20/launcher2/ui/LauncherIconShapeAmbient.kt @@ -33,7 +33,6 @@ object LauncherIconShape { } val platformDefault: Shape = run { val platformShape = getSystemShape() - if (platformShape == null || Build.VERSION.SDK_INT < Build.VERSION_CODES.O) return@run CircleShape GenericShape { size, _ -> Log.d("MM20", "GenericShape {}") val matrix = Matrix() @@ -45,11 +44,7 @@ object LauncherIconShape { } } - private fun getSystemShape(): Path? { - return if (isAtLeastApiLevel(Build.VERSION_CODES.O)) { - AdaptiveIconDrawable(null, null).iconMask - } else { - null - } + private fun getSystemShape(): Path { + return AdaptiveIconDrawable(null, null).iconMask } } \ No newline at end of file diff --git a/ui/src/main/java/de/mm20/launcher2/ui/legacy/search/ApplicationDetailRepresentation.kt b/ui/src/main/java/de/mm20/launcher2/ui/legacy/search/ApplicationDetailRepresentation.kt index bd6b81ec..43caee3d 100644 --- a/ui/src/main/java/de/mm20/launcher2/ui/legacy/search/ApplicationDetailRepresentation.kt +++ b/ui/src/main/java/de/mm20/launcher2/ui/legacy/search/ApplicationDetailRepresentation.kt @@ -18,7 +18,6 @@ import android.graphics.drawable.LayerDrawable import android.graphics.drawable.ShapeDrawable import android.graphics.drawable.shapes.OvalShape import android.net.Uri -import android.os.Build import android.os.Handler import android.os.Process import android.service.notification.StatusBarNotification @@ -37,8 +36,10 @@ import de.mm20.launcher2.badges.BadgeRepository import de.mm20.launcher2.crashreporter.CrashReporter import de.mm20.launcher2.favorites.FavoritesRepository import de.mm20.launcher2.icons.IconRepository -import de.mm20.launcher2.ktx.* -import de.mm20.launcher2.ui.legacy.helper.ActivityStarter +import de.mm20.launcher2.ktx.castToOrNull +import de.mm20.launcher2.ktx.dp +import de.mm20.launcher2.ktx.getBadgeIcon +import de.mm20.launcher2.ktx.lifecycleOwner import de.mm20.launcher2.notifications.NotificationRepository import de.mm20.launcher2.search.data.AppInstallation import de.mm20.launcher2.search.data.Application @@ -46,11 +47,13 @@ import de.mm20.launcher2.search.data.LauncherApp import de.mm20.launcher2.search.data.Searchable import de.mm20.launcher2.transition.ChangingLayoutTransition import de.mm20.launcher2.ui.R +import de.mm20.launcher2.ui.legacy.helper.ActivityStarter import de.mm20.launcher2.ui.legacy.searchable.SearchableView import de.mm20.launcher2.ui.legacy.view.* -import kotlinx.coroutines.* +import kotlinx.coroutines.Job import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.map +import kotlinx.coroutines.launch import org.koin.core.component.KoinComponent import org.koin.core.component.inject import java.util.concurrent.Executors @@ -176,7 +179,10 @@ class ApplicationDetailRepresentation : Representation, KoinComponent { return scene } - private fun updateNotifications(chipGroup: ChipGroup, notifications: List) { + private fun updateNotifications( + chipGroup: ChipGroup, + notifications: List + ) { val context = chipGroup.context chipGroup.removeAllViews() notifications.forEach { @@ -299,69 +305,67 @@ class ApplicationDetailRepresentation : Representation, KoinComponent { private fun setupShortcuts(appShortcuts: ChipGroup, app: Application) { val context = appShortcuts.context - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) { - val launcherApps = - context.getSystemService(Context.LAUNCHER_APPS_SERVICE) as LauncherApps - if (launcherApps.hasShortcutHostPermission()) { - val shortcuts = app.shortcuts + val launcherApps = + context.getSystemService(Context.LAUNCHER_APPS_SERVICE) as LauncherApps + if (launcherApps.hasShortcutHostPermission()) { + val shortcuts = app.shortcuts - val repository: FavoritesRepository by inject() + val repository: FavoritesRepository by inject() - var count = 0 - for (si in shortcuts) { - if (count > 4) break - count++ - val view = Chip(context) - view.text = si.label + var count = 0 + for (si in shortcuts) { + if (count > 4) break + count++ + val view = Chip(context) + view.text = si.label - view.chipIcon = createShortcutDrawable( - launcherApps.getShortcutBadgedIconDrawable( - si.launcherShortcut, - context.resources.displayMetrics.densityDpi - ) + view.chipIcon = createShortcutDrawable( + launcherApps.getShortcutBadgedIconDrawable( + si.launcherShortcut, + context.resources.displayMetrics.densityDpi ) + ) - view.chipIconSize = 24 * context.dp + view.chipIconSize = 24 * context.dp - view.chipIconTint = null + view.chipIconTint = null - view.chipStrokeWidth = 1 * context.dp - view.chipStrokeColor = - ContextCompat.getColorStateList(context, R.color.chip_stroke) - view.chipBackgroundColor = - ContextCompat.getColorStateList(context, R.color.chip_background) - view.setTextAppearanceResource(R.style.ChipTextAppearance) - view.closeIcon = context.getDrawable(R.drawable.ic_star_solid) - view.closeIconTint = ColorStateList.valueOf( - ContextCompat.getColor( - context, - R.color.text_color_primary - ) + view.chipStrokeWidth = 1 * context.dp + view.chipStrokeColor = + ContextCompat.getColorStateList(context, R.color.chip_stroke) + view.chipBackgroundColor = + ContextCompat.getColorStateList(context, R.color.chip_background) + view.setTextAppearanceResource(R.style.ChipTextAppearance) + view.closeIcon = context.getDrawable(R.drawable.ic_star_solid) + view.closeIconTint = ColorStateList.valueOf( + ContextCompat.getColor( + context, + R.color.text_color_primary ) - val isPinned = repository.isPinned(si).asLiveData() + ) + val isPinned = repository.isPinned(si).asLiveData() - isPinned.observe(context as LifecycleOwner, Observer { - view.isCloseIconVisible = isPinned.value == true - }) + isPinned.observe(context as LifecycleOwner, Observer { + view.isCloseIconVisible = isPinned.value == true + }) - view.setOnClickListener { - ActivityStarter.start(context, view) - launcherApps.startShortcut(si.launcherShortcut, null, null) - } - view.setOnLongClickListener { - if (isPinned.value == true) { - repository.unpinItem(si) - } else { - repository.pinItem(si) - } - true - } - view.setOnCloseIconClickListener { - repository.unpinItem(si) - view.isCloseIconVisible = false - } - appShortcuts.addView(view) + view.setOnClickListener { + ActivityStarter.start(context, view) + launcherApps.startShortcut(si.launcherShortcut, null, null) } + view.setOnLongClickListener { + if (isPinned.value == true) { + repository.unpinItem(si) + } else { + repository.pinItem(si) + } + true + } + view.setOnCloseIconClickListener { + repository.unpinItem(si) + view.isCloseIconVisible = false + } + appShortcuts.addView(view) } } } diff --git a/ui/src/main/java/de/mm20/launcher2/ui/legacy/search/ShortcutDetailRepresentation.kt b/ui/src/main/java/de/mm20/launcher2/ui/legacy/search/ShortcutDetailRepresentation.kt index 23b7da10..aef52eaa 100644 --- a/ui/src/main/java/de/mm20/launcher2/ui/legacy/search/ShortcutDetailRepresentation.kt +++ b/ui/src/main/java/de/mm20/launcher2/ui/legacy/search/ShortcutDetailRepresentation.kt @@ -25,7 +25,6 @@ import kotlinx.coroutines.launch import org.koin.core.component.KoinComponent import org.koin.core.component.inject -@RequiresApi(Build.VERSION_CODES.N_MR1) class AppShortcutDetailRepresentation : Representation, KoinComponent { private val iconRepository: IconRepository by inject() diff --git a/ui/src/main/java/de/mm20/launcher2/ui/legacy/searchable/SearchableView.kt b/ui/src/main/java/de/mm20/launcher2/ui/legacy/searchable/SearchableView.kt index f2c00ec8..c87a0f7b 100644 --- a/ui/src/main/java/de/mm20/launcher2/ui/legacy/searchable/SearchableView.kt +++ b/ui/src/main/java/de/mm20/launcher2/ui/legacy/searchable/SearchableView.kt @@ -101,11 +101,7 @@ open class SearchableView(context: Context, representation: Int) : FrameLayout(c is Contact -> ContactDetailRepresentation() is CalendarEvent -> CalendarDetailRepresentation() is Wikipedia -> WikipediaDetailRepresentation() - is AppShortcut -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) { - AppShortcutDetailRepresentation() - } else { - return - } + is AppShortcut -> AppShortcutDetailRepresentation() else -> return } applyScene(representation.getScene(this, searchable, previousRepresentation)) diff --git a/ui/src/main/java/de/mm20/launcher2/ui/legacy/view/LauncherIconView.kt b/ui/src/main/java/de/mm20/launcher2/ui/legacy/view/LauncherIconView.kt index 61b33f18..d2c3791f 100644 --- a/ui/src/main/java/de/mm20/launcher2/ui/legacy/view/LauncherIconView.kt +++ b/ui/src/main/java/de/mm20/launcher2/ui/legacy/view/LauncherIconView.kt @@ -59,7 +59,6 @@ class LauncherIconView : View, KoinComponent { private var platformShapeBounds: RectF? = null - @RequiresApi(Build.VERSION_CODES.O) private fun getSystemShape(): Path { return AdaptiveIconDrawable(null, null).iconMask }