diff options
author | Clark Scheff <clark@cyngn.com> | 2014-08-14 17:32:52 -0700 |
---|---|---|
committer | Clark Scheff <clark@cyngn.com> | 2014-08-14 17:32:52 -0700 |
commit | ac6c78766b88e1edefdf5f63a664caeb17014d56 (patch) | |
tree | 4011962680e7bb489ae1f8a506ad36b4c79ce612 /src | |
parent | 46c859646dceac07b47799a0a9594979780c057c (diff) | |
download | packages_apps_ThemeChooser-ac6c78766b88e1edefdf5f63a664caeb17014d56.zip packages_apps_ThemeChooser-ac6c78766b88e1edefdf5f63a664caeb17014d56.tar.gz packages_apps_ThemeChooser-ac6c78766b88e1edefdf5f63a664caeb17014d56.tar.bz2 |
Increase paddingTop for scrollview when no navbar present
Change-Id: I92d317af27ef3bdb5c42de31db5efb51957522f4
Diffstat (limited to 'src')
-rw-r--r-- | src/com/cyngn/theme/chooser/ThemeFragment.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/com/cyngn/theme/chooser/ThemeFragment.java b/src/com/cyngn/theme/chooser/ThemeFragment.java index e506d90..dfc75d5 100644 --- a/src/com/cyngn/theme/chooser/ThemeFragment.java +++ b/src/com/cyngn/theme/chooser/ThemeFragment.java @@ -290,6 +290,9 @@ public class ThemeFragment extends Fragment implements LoaderManager.LoaderCallb View v = inflater.inflate(R.layout.fragment_pager_list, container, false); mScrollView = (LockableScrollView) v.findViewById(android.R.id.list); + if (!Utils.hasNavigationBar(getActivity())) { + adjustScrollViewPaddingTop(); + } mScrollContent = (ViewGroup) mScrollView.getChildAt(0); mPreviewContent = (ViewGroup) v.findViewById(R.id.preview_container); mLoadingView = v.findViewById(R.id.loading_view); @@ -448,6 +451,17 @@ public class ThemeFragment extends Fragment implements LoaderManager.LoaderCallb } } + private void adjustScrollViewPaddingTop() { + Resources res = getResources(); + int extraPadding = + res.getDimensionPixelSize(R.dimen.system_bar_height) / 2; + mScrollView.setPadding( + mScrollView.getPaddingLeft(), + mScrollView.getPaddingTop() + extraPadding, + mScrollView.getPaddingRight(), + mScrollView.getPaddingBottom()); + } + protected boolean onPopupMenuItemClick(MenuItem item) { switch(item.getItemId()) { case R.id.menu_author: @@ -568,6 +582,10 @@ public class ThemeFragment extends Fragment implements LoaderManager.LoaderCallb //Move the theme preview so that it is near the center of page per spec int paddingTop = (int) r.getDimension(R.dimen.collapsed_theme_page_padding_top); + if (!Utils.hasNavigationBar(getActivity())) { + paddingTop += + r.getDimensionPixelSize(R.dimen.system_bar_height) / 2; + } mScrollView.setPadding(0, paddingTop, 0, 0); // During expand the wallpaper size decreases slightly to makeup for 9patch padding |