Skip to content

Commit 841ce67

Browse files
author
Baligh Uddin
committed
Merge commit '81af21e67cd842d16d4b45e8a2d1ec56ff8d764f' into jb-mr1-dev
2 parents 1c74365 + 81af21e commit 841ce67

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1477
-758
lines changed

core/java/android/appwidget/AppWidgetHostView.java

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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

core/java/com/android/internal/widget/LockPatternUtils.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,11 +1073,7 @@ public int[] getAppWidgets() {
10731073
}
10741074
return appWidgetIds;
10751075
}
1076-
if (appWidgetIdString == null) {
1077-
return new int[] { LockPatternUtils.ID_DEFAULT_STATUS_WIDGET };
1078-
} else {
1079-
return new int[0];
1080-
}
1076+
return new int[0];
10811077
}
10821078

10831079
private static String combineStrings(int[] list, String separator) {
1003 Bytes
Loading
802 Bytes
Loading
1.36 KB
Loading

core/res/res/layout-land/keyguard_host_view.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
android:layout_height="match_parent"
3434
android:clipChildren="false">
3535

36+
<include layout="@layout/keyguard_widget_remove_drop_target"
37+
android:id="@+id/keyguard_widget_pager_delete_target"
38+
android:layout_width="wrap_content"
39+
android:layout_height="wrap_content"
40+
android:layout_gravity="top|center_horizontal" />
41+
3642
<include layout="@layout/keyguard_widget_pager"
3743
android:id="@+id/app_widget_container"
3844
android:layout_width="match_parent"

core/res/res/layout-land/keyguard_widget_pager.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
android:paddingRight="25dp"
2626
android:paddingTop="25dp"
2727
android:paddingBottom="25dp"
28-
android:clipChildren="false"
2928
android:clipToPadding="false"
3029
androidprv:pageSpacing="10dp">
3130
</com.android.internal.policy.impl.keyguard.KeyguardWidgetCarousel>

core/res/res/layout-port/keyguard_host_view.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@
3333
android:layout_width="match_parent"
3434
android:layout_height="match_parent">
3535

36+
<FrameLayout
37+
android:layout_width="match_parent"
38+
android:layout_height="wrap_content">
39+
<include layout="@layout/keyguard_widget_remove_drop_target"
40+
android:id="@+id/keyguard_widget_pager_delete_target"
41+
android:layout_width="wrap_content"
42+
android:layout_height="wrap_content"
43+
android:layout_gravity="top|center_horizontal" />
44+
</FrameLayout>
45+
3646
<FrameLayout
3747
android:layout_width="match_parent"
3848
android:layout_height="match_parent"

core/res/res/layout-port/keyguard_widget_pager.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
android:paddingRight="25dp"
2727
android:paddingTop="25dp"
2828
android:paddingBottom="@dimen/kg_widget_pager_bottom_padding"
29-
android:clipChildren="false"
3029
android:clipToPadding="false"
3130
androidprv:pageSpacing="10dp">
3231
</com.android.internal.policy.impl.keyguard.KeyguardWidgetPager>

core/res/res/layout-sw600dp-port/keyguard_host_view.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@
3434
android:clipChildren="false"
3535
android:orientation="vertical">
3636

37+
<include layout="@layout/keyguard_widget_remove_drop_target"
38+
android:id="@+id/keyguard_widget_pager_delete_target"
39+
android:layout_width="wrap_content"
40+
android:layout_height="wrap_content"
41+
android:layout_gravity="top|center_horizontal" />
42+
3743
<include layout="@layout/keyguard_widget_pager"
3844
android:id="@+id/app_widget_container"
3945
android:layout_width="match_parent"

0 commit comments

Comments
 (0)