Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Have you implemented <code>AppWidgetProvider.onAppWidgetOptionsChanged(Context, AppWidgetManager, int, Bundle)</code>? All well-behaved launchers should report some metrics about your placed widget, which you can retrieve from the bundle, using code like:</p> <pre><code>int minwidth_dp = bundle.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH); int maxwidth_dp = bundle.getInt(AppWidgetManager.OPTION_APPWIDGET_MAX_WIDTH); int minheight_dp = bundle.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT); int maxheight_dp = bundle.getInt(AppWidgetManager.OPTION_APPWIDGET_MAX_HEIGHT); </code></pre> <p>Note that there is no concept of cell here - these metrics correspond to the actual size of your widget, however many cells it takes up.</p> <p>The stock launcher maps these to different orientations like so:</p> <blockquote> <p>minwidth -> portrait width<br> minheight -> landscape height<br> maxwidth -> landscape width<br> maxheight -> portrait height</p> </blockquote> <p>Any launcher that keeps the same number of rows and columns in both orientations, and that resizes the cells to fit the screen, ought to map these the same way. Be aware, assuming these relationships always hold may produce undesired results if you're embedded in a launcher that does something unusual with its widgets - placing them in only part of the screen, or using a different number of rows or columns in different orientations.</p> <p>Alternately, some launchers may report the metrics of the current orientation in both min- and max- values, and simply call you again with new metrics when the orientation changes. However, if you are only interested in the current orientation, the behavior of these launchers is compatible with that of the stock launcher.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload