a few more list widget corrections
This commit is contained in:
parent
216e133194
commit
8ec5e795d4
|
@ -127,7 +127,7 @@ class WidgetListConfigureActivity : AppCompatActivity() {
|
|||
}
|
||||
|
||||
private fun requestWidgetUpdate() {
|
||||
Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE, null, this, MyWidgetMonthlyProvider::class.java).apply {
|
||||
Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE, null, this, MyWidgetListProvider::class.java).apply {
|
||||
putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, intArrayOf(mWidgetId))
|
||||
sendBroadcast(this)
|
||||
}
|
||||
|
|
|
@ -41,15 +41,15 @@ class MyWidgetListProvider : AppWidgetProvider() {
|
|||
|
||||
mWidgetManager = AppWidgetManager.getInstance(mContext)
|
||||
|
||||
mRemoteViews = RemoteViews(mContext.packageName, R.layout.fragment_month)
|
||||
mIntent = Intent(mContext, MyWidgetMonthlyProvider::class.java)
|
||||
mRemoteViews = RemoteViews(mContext.packageName, R.layout.widget_event_list)
|
||||
mIntent = Intent(mContext, MyWidgetListProvider::class.java)
|
||||
|
||||
val bgColor = prefs.getInt(WIDGET_BG_COLOR, Color.BLACK)
|
||||
mRemoteViews.setInt(R.id.calendar_holder, "setBackgroundColor", bgColor)
|
||||
mRemoteViews.setInt(R.id.widget_event_list, "setBackgroundColor", bgColor)
|
||||
}
|
||||
|
||||
private fun updateWidget() {
|
||||
val thisWidget = ComponentName(mContext, MyWidgetMonthlyProvider::class.java)
|
||||
val thisWidget = ComponentName(mContext, MyWidgetListProvider::class.java)
|
||||
AppWidgetManager.getInstance(mContext).updateAppWidget(thisWidget, mRemoteViews)
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ListView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/widget_event_list_holder"
|
||||
android:id="@+id/widget_event_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
</ListView>
|
||||
android:layout_height="match_parent"/>
|
||||
|
|
Loading…
Reference in New Issue