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

Commit bd0e54a7 authored by Isaac Katzenelson's avatar Isaac Katzenelson
Browse files

Add support for keyguard

Bug: 7390795
Added support for keyguard.
Right now, the widget gets the size callback with zeros as sizes. Put a workaround for it.

Change-Id: I531e12e324341e94545f8ff1ef5d9ab927ac3f3c
parent 5c464d35
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -23,5 +23,6 @@
    android:resizeMode="vertical|horizontal"
    android:minResizeWidth="@dimen/min_digital_widget_resize_width"
    android:minResizeHeight="@dimen/min_digital_widget_resize_height"
    android:widgetCategory="keyguard|home_screen"
    >
</appwidget-provider>
+4 −1
Original line number Diff line number Diff line
@@ -75,7 +75,10 @@ public class DigitalAppWidgetProvider extends AppWidgetProvider {
        if (options != null) {
            int minWidth = options.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH);
            int minHeight = options.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT);

            if (minWidth == 0 || minHeight == 0) {
                return 0.9f;
            }
            Log.v(TAG,"------------------------- " + minWidth + " , " + minHeight);
            Resources res = context.getResources();
            float widthRatio = minWidth / res.getDimension(R.dimen.min_digital_widget_width);
            float heightRatio = minHeight / res.getDimension(R.dimen.min_digital_widget_height);