diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2016-03-24 17:28:25 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2016-03-24 17:29:23 -0700 |
commit | f37a21412afb16f61ca23b5aca2e90691b57e171 (patch) | |
tree | 6e4281017ab0a7247ca4d98f2e77e9b33d4711ff /src/com/android/launcher3/DeviceProfile.java | |
parent | 17763cb1d2060fb95873a8920196720c862f0e14 (diff) | |
download | android_packages_apps_Trebuchet-f37a21412afb16f61ca23b5aca2e90691b57e171.tar.gz android_packages_apps_Trebuchet-f37a21412afb16f61ca23b5aca2e90691b57e171.tar.bz2 android_packages_apps_Trebuchet-f37a21412afb16f61ca23b5aca2e90691b57e171.zip |
Defining separate layouts for horizontal and vertical drop target bars
instead of chaning the layouts in DeviceProfile
Bug: 27721989
Change-Id: I9a22c21e643f4fd0058c9be5e9d705aaf7649204
Diffstat (limited to 'src/com/android/launcher3/DeviceProfile.java')
-rw-r--r-- | src/com/android/launcher3/DeviceProfile.java | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 5bfa716ee..7c6f39e9c 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -31,7 +31,6 @@ import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.view.ViewGroup.MarginLayoutParams; import android.widget.FrameLayout; -import android.widget.LinearLayout; import com.android.launcher3.config.FeatureFlags; @@ -469,7 +468,7 @@ public class DeviceProfile { // Layout the search bar space Rect searchBarBounds = getSearchBarBounds(isLayoutRtl); View searchBar = launcher.getSearchDropTargetBar(); - lp = getDropTargetBarLayoutParams(hasVerticalBarLayout, searchBar, Gravity.TOP); + lp = (FrameLayout.LayoutParams) searchBar.getLayoutParams(); lp.width = searchBarBounds.width(); lp.height = searchBarBounds.height(); lp.topMargin = searchBarTopExtraPaddingPx; @@ -477,7 +476,7 @@ public class DeviceProfile { // Layout the app info bar space View appInfoBar = launcher.getAppInfoDropTargetBar(); - lp = getDropTargetBarLayoutParams(hasVerticalBarLayout, appInfoBar, Gravity.BOTTOM); + lp = (FrameLayout.LayoutParams) appInfoBar.getLayoutParams(); lp.bottomMargin = hotseatBarHeightPx; appInfoBar.setLayoutParams(lp); @@ -584,28 +583,6 @@ public class DeviceProfile { } } - private FrameLayout.LayoutParams getDropTargetBarLayoutParams(boolean hasVerticalBarLayout, - View dropTargetBar, int verticalGravity) { - FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) dropTargetBar.getLayoutParams(); - if (hasVerticalBarLayout) { - // Vertical drop target bar space -- The drop target bar is fixed in the layout to be on - // the left of the screen regardless of RTL - lp.gravity = Gravity.LEFT; - lp.width = normalSearchBarSpaceHeightPx; - - LinearLayout targets = (LinearLayout) dropTargetBar.findViewById(R.id.drag_target_bar); - targets.setOrientation(LinearLayout.VERTICAL); - FrameLayout.LayoutParams targetsLp = (FrameLayout.LayoutParams) targets.getLayoutParams(); - targetsLp.gravity = verticalGravity; - targetsLp.height = LayoutParams.WRAP_CONTENT; - } else { - // Horizontal drop target bar space - lp.gravity = verticalGravity | Gravity.CENTER_HORIZONTAL; - lp.height = searchBarSpaceHeightPx; - } - return lp; - } - private int getCurrentWidth() { return isLandscape ? Math.max(widthPx, heightPx) |