am 79e0f875: Merge "Fix small widgets not showing up on tablet (issue 7471516)" into jb-mr1-lockscreen-dev

* commit '79e0f875002d7bde5cf71053f9e9f054e9b5ffa2':
  Fix small widgets not showing up on tablet (issue 7471516)
This commit is contained in:
Adam Cohen
2012-11-06 12:43:46 -08:00
committed by Android Git Automerger
6 changed files with 19 additions and 0 deletions

View File

@@ -21,4 +21,5 @@
<bool name="kg_sim_puk_account_full_screen">false</bool>
<!-- No camera for you, tablet user -->
<bool name="kg_enable_camera_default_widget">false</bool>
<bool name="kg_center_small_widgets_vertically">true</bool>
</resources>

View File

@@ -16,6 +16,7 @@
<resources>
<bool name="kg_enable_camera_default_widget">true</bool>
<bool name="kg_center_small_widgets_vertically">false</bool>
<bool name="action_bar_embed_tabs">true</bool>
<bool name="action_bar_embed_tabs_pre_jb">false</bool>
<bool name="split_action_bar_is_narrow">true</bool>

View File

@@ -335,4 +335,9 @@
due to the appearance of the IME), then drop the multiuser selector. -->
<dimen name="kg_squashed_layout_threshold">600dp</dimen>
<!-- The height of widgets which do not support vertical resizing. This is only
used on tablets; on phones, this size is determined by the space left by the
security mode. -->
<dimen name="kg_small_widget_height">160dp</dimen>
</resources>

View File

@@ -1216,6 +1216,7 @@
<java-symbol type="bool" name="kg_share_status_area" />
<java-symbol type="bool" name="kg_sim_puk_account_full_screen" />
<java-symbol type="bool" name="target_honeycomb_needs_options_menu" />
<java-symbol type="bool" name="kg_center_small_widgets_vertically" />
<java-symbol type="color" name="kg_multi_user_text_active" />
<java-symbol type="color" name="kg_multi_user_text_inactive" />
<java-symbol type="color" name="kg_widget_pager_gradient" />
@@ -1235,6 +1236,7 @@
<java-symbol type="dimen" name="keyguard_avatar_frame_shadow_radius" />
<java-symbol type="dimen" name="kg_edge_swipe_region_size" />
<java-symbol type="dimen" name="kg_squashed_layout_threshold" />
<java-symbol type="dimen" name="kg_small_widget_height" />
<java-symbol type="drawable" name="ic_jog_dial_sound_off" />
<java-symbol type="drawable" name="ic_jog_dial_sound_on" />
<java-symbol type="drawable" name="ic_jog_dial_unlock" />

View File

@@ -112,6 +112,10 @@ public class KeyguardWidgetFrame extends FrameLayout {
mFrameStrokeAdjustment = (int) (2 * density);
// This will be overriden on phones based on the current security mode, however on tablets
// we need to specify a height.
mSmallWidgetHeight =
res.getDimensionPixelSize(com.android.internal.R.dimen.kg_small_widget_height);
mBackgroundDrawable = res.getDrawable(R.drawable.kg_bouncer_bg_white);
mGradientColor = res.getColor(com.android.internal.R.color.kg_widget_pager_gradient);
mGradientPaint.setXfermode(sAddBlendMode);

View File

@@ -64,6 +64,7 @@ public class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit
private static final long CUSTOM_WIDGET_USER_ACTIVITY_TIMEOUT = 30000;
private static final String TAG = "KeyguardWidgetPager";
private boolean mCenterSmallWidgetsVertically;
private int mPage = 0;
private Callbacks mCallbacks;
@@ -94,6 +95,8 @@ public class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit
Resources r = getResources();
mCameraWidgetEnabled = r.getBoolean(R.bool.kg_enable_camera_default_widget);
mCenterSmallWidgetsVertically =
r.getBoolean(com.android.internal.R.bool.kg_center_small_widgets_vertically);
mBackgroundWorkerThread = new HandlerThread("KeyguardWidgetPager Worker");
mBackgroundWorkerThread.start();
mBackgroundWorkerHandler = new Handler(mBackgroundWorkerThread.getLooper());
@@ -277,6 +280,9 @@ public class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit
} else {
// Lock the widget to be small.
frame.setWidgetLockedSmall(true);
if (mCenterSmallWidgetsVertically) {
lp.gravity = Gravity.CENTER;
}
}
}
} else {