@@ -244,14 +244,22 @@ protected void dispatchRestoreInstanceState(SparseArray<Parcelable> container) {
244244 *
245245 * @param newOptions The bundle of options, in addition to the size information,
246246 * can be null.
247- * @param minWidth The minimum width that the widget will be displayed at.
248- * @param minHeight The maximum height that the widget will be displayed at.
249- * @param maxWidth The maximum width that the widget will be displayed at.
250- * @param maxHeight The maximum height that the widget will be displayed at.
247+ * @param minWidth The minimum width in dips that the widget will be displayed at.
248+ * @param minHeight The maximum height in dips that the widget will be displayed at.
249+ * @param maxWidth The maximum width in dips that the widget will be displayed at.
250+ * @param maxHeight The maximum height in dips that the widget will be displayed at.
251251 *
252252 */
253253 public void updateAppWidgetSize (Bundle newOptions , int minWidth , int minHeight , int maxWidth ,
254254 int maxHeight ) {
255+ updateAppWidgetSize (newOptions , minWidth , minHeight , maxWidth , maxHeight , false );
256+ }
257+
258+ /**
259+ * @hide
260+ */
261+ public void updateAppWidgetSize (Bundle newOptions , int minWidth , int minHeight , int maxWidth ,
262+ int maxHeight , boolean ignorePadding ) {
255263 if (newOptions == null ) {
256264 newOptions = new Bundle ();
257265 }
@@ -265,10 +273,10 @@ public void updateAppWidgetSize(Bundle newOptions, int minWidth, int minHeight,
265273 int xPaddingDips = (int ) ((padding .left + padding .right ) / density );
266274 int yPaddingDips = (int ) ((padding .top + padding .bottom ) / density );
267275
268- int newMinWidth = minWidth - xPaddingDips ;
269- int newMinHeight = minHeight - yPaddingDips ;
270- int newMaxWidth = maxWidth - xPaddingDips ;
271- int newMaxHeight = maxHeight - yPaddingDips ;
276+ int newMinWidth = minWidth - ( ignorePadding ? 0 : xPaddingDips ) ;
277+ int newMinHeight = minHeight - ( ignorePadding ? 0 : yPaddingDips );
278+ int newMaxWidth = maxWidth - ( ignorePadding ? 0 : xPaddingDips ) ;
279+ int newMaxHeight = maxHeight - ( ignorePadding ? 0 : yPaddingDips ) ;
272280
273281 AppWidgetManager widgetManager = AppWidgetManager .getInstance (mContext );
274282
0 commit comments