mirror of
https://github.com/SimpleMobileTools/Simple-Launcher.git
synced 2025-06-05 21:59:15 +02:00
adding some crashfixes
This commit is contained in:
@@ -54,6 +54,7 @@
|
|||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.SettingsActivity"
|
android:name=".activities.SettingsActivity"
|
||||||
|
android:configChanges="orientation"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:label="@string/settings"
|
android:label="@string/settings"
|
||||||
android:parentActivityName=".activities.MainActivity">
|
android:parentActivityName=".activities.MainActivity">
|
||||||
|
@@ -131,8 +131,12 @@ class MainActivity : SimpleActivity(), FlingListener {
|
|||||||
|
|
||||||
// delay showing the shortcut both to let the user see adding it in realtime and hackily avoid concurrent modification exception at HomeScreenGrid
|
// delay showing the shortcut both to let the user see adding it in realtime and hackily avoid concurrent modification exception at HomeScreenGrid
|
||||||
Thread.sleep(2000)
|
Thread.sleep(2000)
|
||||||
|
|
||||||
|
try {
|
||||||
item.accept()
|
item.accept()
|
||||||
home_screen_grid.storeAndShowGridItem(gridItem)
|
home_screen_grid.storeAndShowGridItem(gridItem)
|
||||||
|
} catch (ignored: IllegalStateException) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -171,7 +175,7 @@ class MainActivity : SimpleActivity(), FlingListener {
|
|||||||
|
|
||||||
main_holder.onGlobalLayout {
|
main_holder.onGlobalLayout {
|
||||||
if (isPiePlus()) {
|
if (isPiePlus()) {
|
||||||
val addTopPadding = main_holder.rootWindowInsets.displayCutout != null
|
val addTopPadding = main_holder.rootWindowInsets?.displayCutout != null
|
||||||
(all_apps_fragment as AllAppsFragment).setupViews(addTopPadding)
|
(all_apps_fragment as AllAppsFragment).setupViews(addTopPadding)
|
||||||
(widgets_fragment as WidgetsFragment).setupViews(addTopPadding)
|
(widgets_fragment as WidgetsFragment).setupViews(addTopPadding)
|
||||||
}
|
}
|
||||||
@@ -248,8 +252,8 @@ class MainActivity : SimpleActivity(), FlingListener {
|
|||||||
|
|
||||||
override fun onConfigurationChanged(newConfig: Configuration) {
|
override fun onConfigurationChanged(newConfig: Configuration) {
|
||||||
super.onConfigurationChanged(newConfig)
|
super.onConfigurationChanged(newConfig)
|
||||||
(all_apps_fragment as AllAppsFragment).onConfigurationChanged()
|
(all_apps_fragment as? AllAppsFragment)?.onConfigurationChanged()
|
||||||
(widgets_fragment as WidgetsFragment).onConfigurationChanged()
|
(widgets_fragment as? WidgetsFragment)?.onConfigurationChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onTouchEvent(event: MotionEvent?): Boolean {
|
override fun onTouchEvent(event: MotionEvent?): Boolean {
|
||||||
@@ -651,7 +655,10 @@ class MainActivity : SimpleActivity(), FlingListener {
|
|||||||
|
|
||||||
@SuppressLint("WrongConstant")
|
@SuppressLint("WrongConstant")
|
||||||
fun getAllAppLaunchers(): ArrayList<AppLauncher> {
|
fun getAllAppLaunchers(): ArrayList<AppLauncher> {
|
||||||
val hiddenIcons = hiddenIconsDB.getHiddenIcons().map { it.getIconIdentifier() }
|
val hiddenIcons = hiddenIconsDB.getHiddenIcons().map {
|
||||||
|
it.getIconIdentifier()
|
||||||
|
}
|
||||||
|
|
||||||
val allApps = ArrayList<AppLauncher>()
|
val allApps = ArrayList<AppLauncher>()
|
||||||
val intent = Intent(Intent.ACTION_MAIN, null)
|
val intent = Intent(Intent.ACTION_MAIN, null)
|
||||||
intent.addCategory(Intent.CATEGORY_LAUNCHER)
|
intent.addCategory(Intent.CATEGORY_LAUNCHER)
|
||||||
|
@@ -511,11 +511,11 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel
|
|||||||
|
|
||||||
@SuppressLint("DrawAllocation")
|
@SuppressLint("DrawAllocation")
|
||||||
override fun onDraw(canvas: Canvas?) {
|
override fun onDraw(canvas: Canvas?) {
|
||||||
super.onDraw(canvas)
|
|
||||||
if (canvas == null) {
|
if (canvas == null) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
super.onDraw(canvas)
|
||||||
if (cellXCoords.isEmpty()) {
|
if (cellXCoords.isEmpty()) {
|
||||||
fillCellSizes()
|
fillCellSizes()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user