Push scrollbars to screen edges.

Push scrollbar to screen edges on custom ListView and ScrollViews to
match Preferences framework behavior.

Bug: 7633165
Change-Id: Ideecd0e243c7de7bf977caef2b1585e707a00ca4
This commit is contained in:
Jeff Sharkey
2012-11-30 12:36:53 -08:00
parent 6f8cd76870
commit 97d07fa3ae
18 changed files with 219 additions and 159 deletions

View File

@@ -419,13 +419,20 @@ public class Utils {
return statusString;
}
public static void forcePrepareCustomPreferencesList(
ViewGroup parent, View child, ListView list, boolean ignoreSidePadding) {
list.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
list.setClipToPadding(false);
prepareCustomPreferencesList(parent, child, list, ignoreSidePadding);
}
/**
* Prepare a custom preferences layout, moving padding to {@link ListView}
* when outside scrollbars are requested. Usually used to display
* {@link ListView} and {@link TabWidget} with correct padding.
*/
public static void prepareCustomPreferencesList(
ViewGroup parent, View child, ListView list, boolean ignoreSidePadding) {
ViewGroup parent, View child, View list, boolean ignoreSidePadding) {
final boolean movePadding = list.getScrollBarStyle() == View.SCROLLBARS_OUTSIDE_OVERLAY;
if (movePadding && parent instanceof PreferenceFrameLayout) {
((PreferenceFrameLayout.LayoutParams) child.getLayoutParams()).removeBorders = true;