mirror of
https://github.com/Michatec/Radio.git
synced 2026-11-17 05:26:53 +01:00
Update Favorites widget dimensions, preview image, and click behavior
- Adjust `minWidth` and `minHeight` and add resize constraints in `favorites_widget_info.xml`. - Update `previewImage` to use a new dedicated preview drawable. - Add a `PendingIntent` to the widget root and header to launch `MainActivity`.
This commit is contained in:
1 parent
e2ac535308
commit
cbfea35ff2
4 files changed
+21
-6
No files matched your search
@@ -114,6 +114,17 @@ class FavoritesWidgetProvider : AppWidgetProvider() {
|
||||
}
|
||||
views.setPendingIntentTemplate(R.id.favorites_list, PendingIntent.getActivity(themedContext, 0, clickIntent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE))
|
||||
|
||||
val mainIntent = Intent(themedContext, MainActivity::class.java).apply {
|
||||
action = Keys.ACTION_START
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP
|
||||
}
|
||||
val mainPendingIntent = PendingIntent.getActivity(
|
||||
context, 1, mainIntent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||
)
|
||||
views.setOnClickPendingIntent(R.id.widget_root, mainPendingIntent)
|
||||
views.setOnClickPendingIntent(R.id.widget_header, mainPendingIntent)
|
||||
|
||||
appWidgetManager.updateAppWidget(appWidgetId, views)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user