Maximum allowed size of Android widget

We can set the MINIMUM widget size, for example,

android:minHeight="40dp"
android:minResizeHeight="40dp"
android:minResizeWidth="40dp"
android:minWidth="40dp"

No properties android:max___.

Is there a way to limit the MAXIMUM size of a resizable widget?

(maybe I don't see a resize callback or something like that?)


Noting that the docs say that a common use case for resizing is lists or grids. Which do not require installation of the maximum size.

My use case is simply "the client asked for one widget that is either 1x1 or 2x2." Will he get what he wants, or will I have to change my mind for him?

+3
source share
1 answer

?

, , XML .

:

<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:initialLayout="@layout/widget_layout"
android:minHeight="220dp"
android:minWidth="180dp"
android:resizeMode="horizontal"
android:updatePeriodMillis="0" 
android:previewImage="@drawable/widget_all_in_one_preview"/>

:

<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:initialLayout="@layout/widget_layout"
android:minHeight="220dp"
android:minWidth="180dp"
android:resizeMode="vertical"
android:updatePeriodMillis="0" 
android:previewImage="@drawable/widget_all_in_one_preview"/>

:

android:resizeMode="horizontal|vertical"

, NinePatch Background .

Widget :)

,

+4

All Articles