Widget layout change after widget resize

android, android-widget, resize

Solution

I got it, as documentation says: You need to override onAppWidgetOptionsChanged in your AppWidgetProvider, so you will recieve Broadcast when widget resized.

public class YourWidgetProvider extends AppWidgetProvider {

    ...

    @Override
    public void onAppWidgetOptionsChanged (Context context, 
                                      AppWidgetManager appWidgetManager,
                                      int appWidgetId, Bundle newOptions) {
        // Here you can update your widget view
    }

    ...

}

Problem

My widget supports widget resizing. But when the widget size is changed, the text size remains the same. What should I do to handle it? I looking for something like percentage of the text size which would depend on the widget size.

Original source