Change-Id: If59b9cf13297d3a556810501621cce65947ccf95
This commit is contained in:
Jean-Baptiste Queru
2012-11-06 15:16:09 -08:00
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

@@ -106,6 +106,10 @@ public class KeyguardWidgetFrame extends FrameLayout {
int padding = (int) (res.getDisplayMetrics().density * 8);
setPadding(padding, padding, padding, padding);
// 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

@@ -67,6 +67,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;
@@ -95,6 +96,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);
mBgPersistenceWorkerThread = new HandlerThread("KeyguardWidgetPager Persistence");
mBgPersistenceWorkerThread.start();
mBgPersistenceWorkerHandler = new Handler(mBgPersistenceWorkerThread.getLooper());
@@ -274,6 +277,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 {