Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bde5d34a authored by Abhishek Aggarwal's avatar Abhishek Aggarwal
Browse files

fixup!: (feat) widgets: properly migrate widget host

parent 3872d092
Loading
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -200,7 +200,6 @@ class WidgetContainer(context: Context, attrs: AttributeSet?) :
                mWidgetHost.startListening()
                loadWidgets()
            }

            return mWrapper
        }

@@ -251,14 +250,18 @@ class WidgetContainer(context: Context, attrs: AttributeSet?) :
                widgetsDbHelper
                    .getWidgets()
                    .sortedBy { it.position }
                    .forEach { addView(it.widgetId, false) }
                    .forEach { addView(it.widgetId) }
            } else {
                if (mOldWidgets.isNotEmpty()) {
                    mOldWidgets
                        .filter { mWidgetHost.appWidgetIds.contains(it.id) }
                        .sortedWith(
                            compareBy(BlissDbUtils.WidgetItems::order, BlissDbUtils.WidgetItems::id)
                        )
                        .forEach { addView(it.id, true) }
                } else {
                    mWidgetHost.appWidgetIds.sorted().forEach { addView(it, true) }
                }
            }
        }