diff --git a/Omega/src/com/saggitt/omega/OmegaPreferences.kt b/Omega/src/com/saggitt/omega/OmegaPreferences.kt index 1825ae8a76..12b993a0c2 100644 --- a/Omega/src/com/saggitt/omega/OmegaPreferences.kt +++ b/Omega/src/com/saggitt/omega/OmegaPreferences.kt @@ -57,7 +57,7 @@ import kotlin.collections.HashSet import kotlin.reflect.KProperty class OmegaPreferences(val context: Context) : SharedPreferences.OnSharedPreferenceChangeListener { - val mContext = context; + val mContext = context val doNothing = { } val restart = { restart() } diff --git a/Omega/src/com/saggitt/omega/gestures/ui/LauncherGesturePreference.kt b/Omega/src/com/saggitt/omega/gestures/ui/LauncherGesturePreference.kt index edd821cb87..b17b1402e9 100644 --- a/Omega/src/com/saggitt/omega/gestures/ui/LauncherGesturePreference.kt +++ b/Omega/src/com/saggitt/omega/gestures/ui/LauncherGesturePreference.kt @@ -32,9 +32,9 @@ class LauncherGesturePreference(context: Context, attrs: AttributeSet?) : Recycl field = value notifyChanged() } - var defaultValue = BlankGestureHandler::class.java.name!! + var defaultValue = BlankGestureHandler::class.java.name lateinit var onSelectHandler: (GestureHandler) -> Unit - private val mContext = context; + private val mContext = context private val blankGestureHandler = BlankGestureHandler(mContext, null) private val handler get() = GestureController.createGestureHandler(mContext, value.toString(), blankGestureHandler) diff --git a/Omega/src/com/saggitt/omega/groups/FlowerpotTabs.kt b/Omega/src/com/saggitt/omega/groups/FlowerpotTabs.kt index b1f028f06f..0b31cd00e2 100644 --- a/Omega/src/com/saggitt/omega/groups/FlowerpotTabs.kt +++ b/Omega/src/com/saggitt/omega/groups/FlowerpotTabs.kt @@ -142,7 +142,7 @@ class FlowerpotTabs(manager: AppGroupsManager) : DrawerTabs(manager, AppGroupsMa } private fun updateSummary(view: View) { - view.findViewById(R.id.current_category).setText(displayName) + view.findViewById(R.id.current_category).text = displayName } override fun clone(): AppGroups.Group.Customization { diff --git a/Omega/src/com/saggitt/omega/iconpack/IconMask.kt b/Omega/src/com/saggitt/omega/iconpack/IconMask.kt index b329d94805..e943e97fba 100644 --- a/Omega/src/com/saggitt/omega/iconpack/IconMask.kt +++ b/Omega/src/com/saggitt/omega/iconpack/IconMask.kt @@ -58,7 +58,7 @@ class IconMask { val canvas = Canvas(bitmap) // Draw the app icon - var bb = baseIcon.toBitmap()!! + var bb = baseIcon.toBitmap() if (!bb.isMutable) bb = bb.copy(bb.config, true) matrix.setScale((size * scale) / bb.width, (size * scale) / bb.height) matrix.postTranslate((size / 2) * (1 - scale), (size / 2) * (1 - scale)) @@ -67,7 +67,7 @@ class IconMask { // Mask the app icon if (iconMask != null && iconMask.drawableId != 0) { - iconMask.drawable.toBitmap()?.let { + iconMask.drawable.toBitmap().let { paint.xfermode = PorterDuffXfermode(PorterDuff.Mode.DST_OUT) matrix.setScale(size.toFloat() / it.width, size.toFloat() / it.height) canvas.drawBitmap(it, matrix, paint) @@ -82,7 +82,7 @@ class IconMask { if (Utilities.ATLEAST_OREO && drawable is AdaptiveIconCompat) { adaptiveBackground = drawable.background } else { - drawable.toBitmap()!!.let { + drawable.toBitmap().let { paint.xfermode = PorterDuffXfermode(PorterDuff.Mode.DST_OVER) matrix.setScale(size.toFloat() / it.width, size.toFloat() / it.height) canvas.drawBitmap(it, matrix, paint) @@ -94,7 +94,7 @@ class IconMask { // Draw iconUpon if (iconUpon != null && iconUpon.drawableId != 0) { - iconUpon.drawable.toBitmap()!!.let { + iconUpon.drawable.toBitmap().let { matrix.setScale(size.toFloat() / it.width, size.toFloat() / it.height) canvas.drawBitmap(it, matrix, paint) matrix.reset() diff --git a/Omega/src/com/saggitt/omega/iconpack/IconPackList.kt b/Omega/src/com/saggitt/omega/iconpack/IconPackList.kt index 0c3a2ff606..3e50314ca0 100644 --- a/Omega/src/com/saggitt/omega/iconpack/IconPackList.kt +++ b/Omega/src/com/saggitt/omega/iconpack/IconPackList.kt @@ -152,7 +152,7 @@ class IconPackList(private val context: Context, private val manager: IconPackMa } override val displayIcon by lazy { - context.packageManager.getApplicationIcon(applicationInfo)!! + context.packageManager.getApplicationIcon(applicationInfo) } override val displayName by lazy { diff --git a/Omega/src/com/saggitt/omega/icons/IconShapeOverride.java b/Omega/src/com/saggitt/omega/icons/IconShapeOverride.java index 052494e822..6dc7109d8f 100644 --- a/Omega/src/com/saggitt/omega/icons/IconShapeOverride.java +++ b/Omega/src/com/saggitt/omega/icons/IconShapeOverride.java @@ -108,7 +108,6 @@ public static String getAppliedValue(Context context) { if (!TextUtils.isEmpty(devValue)) { // Migrate to general preferences to back up shape overrides getPrefs(context).edit().putString(KEY_PREFERENCE, devValue).apply(); - ; getDevicePrefs(context).edit().remove(KEY_PREFERENCE).apply(); } diff --git a/Omega/src/com/saggitt/omega/preferences/MultiSelectTabPreference.kt b/Omega/src/com/saggitt/omega/preferences/MultiSelectTabPreference.kt index 8db8537116..c68e0c3f88 100644 --- a/Omega/src/com/saggitt/omega/preferences/MultiSelectTabPreference.kt +++ b/Omega/src/com/saggitt/omega/preferences/MultiSelectTabPreference.kt @@ -42,9 +42,7 @@ class MultiSelectTabPreference(context: Context, attrs: AttributeSet?) : Recycle private val selections = mutableMapOf() private val tabs = context.omegaPrefs.drawerTabs.getGroups().mapNotNull { it as? DrawerTabs.CustomTab } var edited = false - private set(value) { - field = value - } + private set override fun onBindRecyclerView(recyclerView: RecyclerView) { recyclerView.adapter = Adapter() diff --git a/Omega/src/com/saggitt/omega/preferences/SelectSearchProviderFragment.kt b/Omega/src/com/saggitt/omega/preferences/SelectSearchProviderFragment.kt index c4d5aeca14..fc7ff1f3fe 100644 --- a/Omega/src/com/saggitt/omega/preferences/SelectSearchProviderFragment.kt +++ b/Omega/src/com/saggitt/omega/preferences/SelectSearchProviderFragment.kt @@ -86,7 +86,7 @@ class SelectSearchProviderFragment : PreferenceDialogFragmentCompat() { } inner class Holder(itemView: View) : RecyclerView.ViewHolder(itemView), View.OnClickListener { - val providerIcon = itemView.findViewById(R.id.provider_icon); + val providerIcon = itemView.findViewById(R.id.provider_icon) val text = itemView.findViewById(android.R.id.text1)!!.apply { setOnClickListener(this@Holder) val tintList = ColorStateList.valueOf(context.omegaPrefs.accentColor) diff --git a/Omega/src/com/saggitt/omega/search/providers/GoogleSearchProvider.kt b/Omega/src/com/saggitt/omega/search/providers/GoogleSearchProvider.kt index f64bd3f9c2..bb63997cf0 100644 --- a/Omega/src/com/saggitt/omega/search/providers/GoogleSearchProvider.kt +++ b/Omega/src/com/saggitt/omega/search/providers/GoogleSearchProvider.kt @@ -33,7 +33,7 @@ class GoogleSearchProvider(context: Context) : SearchProvider(context) { val launcher = OmegaLauncher.getLauncher(context) if (launcher.googleNow != null) { //TODO OPEN GOOGLE FEED. - launcher.googleNow!!.showOverlay(true); + launcher.googleNow!!.showOverlay(true) } else { callback(Intent(Intent.ACTION_MAIN).setClassName(PACKAGE, "$PACKAGE.SearchActivity")) } diff --git a/Omega/src/com/saggitt/omega/settings/search/SettingsSearchView.kt b/Omega/src/com/saggitt/omega/settings/search/SettingsSearchView.kt index 374c260f49..f50084f8d9 100644 --- a/Omega/src/com/saggitt/omega/settings/search/SettingsSearchView.kt +++ b/Omega/src/com/saggitt/omega/settings/search/SettingsSearchView.kt @@ -31,7 +31,7 @@ class SettingsSearchView(context: Context, attrs: AttributeSet?) : SearchView(co private var customTypeface: Typeface? = null init { - isIconified = false; + isIconified = false } fun setTypeface(typeface: Typeface) { diff --git a/Omega/src/com/saggitt/omega/theme/ThemeManager.kt b/Omega/src/com/saggitt/omega/theme/ThemeManager.kt index bc4701b54c..7386663604 100644 --- a/Omega/src/com/saggitt/omega/theme/ThemeManager.kt +++ b/Omega/src/com/saggitt/omega/theme/ThemeManager.kt @@ -153,7 +153,7 @@ class ThemeManager(val context: Context) : WallpaperColorInfo.OnChangeListener, BlankActivity.requestPermission(context, android.Manifest.permission.ACCESS_COARSE_LOCATION, REQUEST_PERMISSION_LOCATION_ACCESS) { granted -> - if (granted as Boolean) { + if (granted) { listenToTwilight = true } else { prefs.launcherTheme = theme.removeFlag(THEME_DARK_MASK) diff --git a/Omega/src_ui_overrides/com/android/launcher3/touch/SwipeDetector.java b/Omega/src_ui_overrides/com/android/launcher3/touch/SwipeDetector.java index 2d03797056..c42d001cce 100644 --- a/Omega/src_ui_overrides/com/android/launcher3/touch/SwipeDetector.java +++ b/Omega/src_ui_overrides/com/android/launcher3/touch/SwipeDetector.java @@ -192,11 +192,8 @@ private boolean shouldScrollStart(MotionEvent ev, int pointerIndex) { } // Check if the client is interested in scroll in current direction. - if (((mScrollConditions & DIRECTION_NEGATIVE) > 0 && mDisplacement > 0) || - ((mScrollConditions & DIRECTION_POSITIVE) > 0 && mDisplacement < 0)) { - return true; - } - return false; + return ((mScrollConditions & DIRECTION_NEGATIVE) > 0 && mDisplacement > 0) || + ((mScrollConditions & DIRECTION_POSITIVE) > 0 && mDisplacement < 0); } public boolean onTouchEvent(MotionEvent ev) {