diff options
Diffstat (limited to 'src/com/android/launcher3/LauncherAppWidgetProviderInfo.java')
-rw-r--r-- | src/com/android/launcher3/LauncherAppWidgetProviderInfo.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/launcher3/LauncherAppWidgetProviderInfo.java b/src/com/android/launcher3/LauncherAppWidgetProviderInfo.java index 85af92f30..9ba78530d 100644 --- a/src/com/android/launcher3/LauncherAppWidgetProviderInfo.java +++ b/src/com/android/launcher3/LauncherAppWidgetProviderInfo.java @@ -5,6 +5,7 @@ import android.appwidget.AppWidgetProviderInfo; import android.content.ComponentName; import android.content.Context; import android.content.pm.PackageManager; +import android.graphics.Point; import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Parcel; @@ -110,4 +111,15 @@ public class LauncherAppWidgetProviderInfo extends AppWidgetProviderInfo { mMinSpanY = minResizeSpan[1]; } } + + public Point getMinSpans(InvariantDeviceProfile idp, Context context) { + // Calculate the spans corresponding to any one of the orientations as it should not change + // based on orientation. + // TODO: Use the max of both profiles + int[] minSpans = CellLayout.rectToCell( + idp.portraitProfile, context, minResizeWidth, minResizeHeight, null); + return new Point( + (resizeMode & RESIZE_HORIZONTAL) != 0 ? minSpans[0] : -1, + (resizeMode & RESIZE_VERTICAL) != 0 ? minSpans[1] : -1); + } } |