summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaj Yengisetty <rajesh@cyngn.com>2014-08-11 19:46:17 (GMT)
committerGerrit Code Review <gerrit@cyanogenmod.org>2014-08-15 20:17:56 (GMT)
commit3493881701556f359d29dba1be9f53b5fbb8d85b (patch)
treef13efc193b80c9506659eaec6f549caaeb3735b1
parentfa3f1597d55347db92d4c3ced74e62db3a6d6d84 (diff)
downloadandroid_packages_apps_Trebuchet-3493881701556f359d29dba1be9f53b5fbb8d85b.zip
android_packages_apps_Trebuchet-3493881701556f359d29dba1be9f53b5fbb8d85b.tar.gz
android_packages_apps_Trebuchet-3493881701556f359d29dba1be9f53b5fbb8d85b.tar.bz2
Fix spacing issues on devices with/without nav-bar in overview settings panel
Change-Id: I329b63b780e5727307770e076bf03e3bc4d82dd0
-rw-r--r--res/layout/settings_pane.xml6
-rw-r--r--res/layout/settings_transitions_screen.xml1
-rw-r--r--src/com/android/launcher3/DragLayer.java7
-rw-r--r--src/com/android/launcher3/DynamicGridSizeFragment.java10
-rw-r--r--src/com/android/launcher3/TransitionEffectsFragment.java12
5 files changed, 28 insertions, 8 deletions
diff --git a/res/layout/settings_pane.xml b/res/layout/settings_pane.xml
index 495d099..d3f3fdb 100644
--- a/res/layout/settings_pane.xml
+++ b/res/layout/settings_pane.xml
@@ -1,15 +1,15 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
+ android:background="@color/settings_bg_color"
android:layout_height="match_parent" >
<LinearLayout
+ android:id="@+id/settings_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal|bottom"
- android:background="@color/settings_bg_color"
- android:orientation="vertical"
- android:paddingBottom="@dimen/overview_panel_bottom_padding" >
+ android:orientation="vertical" >
<LinearLayout
android:id="@+id/settings_pane_header"
diff --git a/res/layout/settings_transitions_screen.xml b/res/layout/settings_transitions_screen.xml
index 37535e9..8457841 100644
--- a/res/layout/settings_transitions_screen.xml
+++ b/res/layout/settings_transitions_screen.xml
@@ -4,7 +4,6 @@
android:layout_gravity="center_horizontal|bottom"
android:background="@color/settings_bg_color"
android:orientation="vertical"
- android:paddingBottom="@dimen/overview_panel_bottom_padding"
android:paddingTop="@dimen/overview_panel_bottom_padding"
android:clickable="true" >
diff --git a/src/com/android/launcher3/DragLayer.java b/src/com/android/launcher3/DragLayer.java
index 2dde8e4..5ab5614 100644
--- a/src/com/android/launcher3/DragLayer.java
+++ b/src/com/android/launcher3/DragLayer.java
@@ -36,6 +36,7 @@ import android.view.accessibility.AccessibilityManager;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
import android.widget.FrameLayout;
+import android.widget.LinearLayout;
import android.widget.TextView;
import java.util.ArrayList;
@@ -109,6 +110,12 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
for (int i = 0; i < n; i++) {
final View child = getChildAt(i);
if (child.getId() == R.id.overview_panel) {
+ LinearLayout layout = (LinearLayout)
+ child.findViewById(R.id.settings_container);
+ FrameLayout.LayoutParams lp =
+ (FrameLayout.LayoutParams) layout.getLayoutParams();
+ lp.bottomMargin += insets.bottom - mInsets.bottom;
+ layout.setLayoutParams(lp);
continue;
}
setInsets(child, insets, mInsets);
diff --git a/src/com/android/launcher3/DynamicGridSizeFragment.java b/src/com/android/launcher3/DynamicGridSizeFragment.java
index 9ab1ad0..69720a5 100644
--- a/src/com/android/launcher3/DynamicGridSizeFragment.java
+++ b/src/com/android/launcher3/DynamicGridSizeFragment.java
@@ -36,6 +36,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
+import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
@@ -88,6 +89,14 @@ public class DynamicGridSizeFragment extends Fragment
Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.dynamic_grid_size_screen, container, false);
mDynamicGrid = (GridSizeView) v.findViewById(R.id.dynamic_grid_size_image);
+ mListView = (ListView) v.findViewById(R.id.dynamic_grid_list);
+
+ Launcher launcher = (Launcher) getActivity();
+ LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams)
+ mListView.getLayoutParams();
+ lp.bottomMargin = ((FrameLayout.LayoutParams) launcher.getOverviewPanel()
+ .findViewById(R.id.settings_container).getLayoutParams()).bottomMargin;
+ mListView.setLayoutParams(lp);
LinearLayout titleLayout = (LinearLayout) v.findViewById(R.id.dynamic_grid_title);
titleLayout.setOnClickListener(new View.OnClickListener() {
@@ -103,7 +112,6 @@ public class DynamicGridSizeFragment extends Fragment
updateGridMetrics();
- mListView = (ListView) v.findViewById(R.id.dynamic_grid_list);
Resources res = getResources();
String[] values = {
res.getString(R.string.grid_size_comfortable),
diff --git a/src/com/android/launcher3/TransitionEffectsFragment.java b/src/com/android/launcher3/TransitionEffectsFragment.java
index 88c6481..bb7c5ab 100644
--- a/src/com/android/launcher3/TransitionEffectsFragment.java
+++ b/src/com/android/launcher3/TransitionEffectsFragment.java
@@ -20,6 +20,7 @@ import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
+import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
@@ -34,7 +35,6 @@ public class TransitionEffectsFragment extends Fragment {
ImageView mTransitionIcon;
ListView mListView;
View mCurrentSelection;
- ScrollView mScrollView;
String[] mTransitionStates;
TypedArray mTransitionDrawables;
@@ -76,6 +76,14 @@ public class TransitionEffectsFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.settings_transitions_screen, container, false);
+ mListView = (ListView) v.findViewById(R.id.settings_transitions_list);
+
+ Launcher launcher = (Launcher) getActivity();
+ LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams)
+ mListView.getLayoutParams();
+ lp.bottomMargin = ((FrameLayout.LayoutParams) launcher.getOverviewPanel()
+ .findViewById(R.id.settings_container).getLayoutParams()).bottomMargin;
+ mListView.setLayoutParams(lp);
mPageOrDrawer = getArguments().getBoolean(PAGE_OR_DRAWER_SCROLL_SELECT);
@@ -86,8 +94,6 @@ public class TransitionEffectsFragment extends Fragment {
: R.string.preferences_interface_homescreen_scrolling_transition_effect;
mTransitionIcon = (ImageView) v.findViewById(R.id.settings_transition_image);
- mListView = (ListView) v.findViewById(R.id.settings_transitions_list);
- mScrollView = (ScrollView) v.findViewById(R.id.scroll_view);
TextView title = (TextView) v.findViewById(R.id.transition_effect_title);
title.setText(getResources().getString(R.string.scroll_effect_text));
LinearLayout titleLayout = (LinearLayout) v.findViewById(R.id.transition_title);