Skip to content

Commit

Permalink
Update PlotWidget when the widget is resized. CodeforKarlsruhe#12
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaelz committed Dec 28, 2017
1 parent 572c291 commit 2a599df
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.content.Context
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.Color
import android.os.Bundle
import android.util.Log
import android.view.View
import android.widget.RemoteViews
Expand All @@ -24,6 +25,11 @@ class PlotWidget : BaseWidget() {
update(context, appWidgetId, appWidgetManager)
}

override fun onAppWidgetOptionsChanged(context: Context, appWidgetManager: AppWidgetManager,
appWidgetId: Int, newOptions: Bundle) {
onUpdateWidget(context, appWidgetId, appWidgetManager)
}

companion object {
fun update(context: Context, appWidgetId: Int, appWidgetManager: AppWidgetManager) {
val views = RemoteViews(context.packageName, R.layout.plot_widget)
Expand Down

0 comments on commit 2a599df

Please sign in to comment.