From 4f3e9383eb422c87e2689548653b89f34f5516a5 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Fri, 5 Jun 2015 00:13:25 -0700 Subject: Code cleanup > Removing obsolete logging > Removing unused methods > Removing resource leak warning due to non-static handler class in launcher Change-Id: Ic38cc8aea82899b0b5ee3235f04e5964e49245fb --- src/com/android/launcher3/Hotseat.java | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'src/com/android/launcher3/Hotseat.java') diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java index 6e33d1014..ff4c93ab7 100644 --- a/src/com/android/launcher3/Hotseat.java +++ b/src/com/android/launcher3/Hotseat.java @@ -36,8 +36,7 @@ public class Hotseat extends FrameLayout private int mAllAppsButtonRank; - private boolean mTransposeLayoutWithOrientation; - private boolean mIsLandscape; + private final boolean mHasVerticalHotseat; public Hotseat(Context context) { this(context, null); @@ -49,13 +48,8 @@ public class Hotseat extends FrameLayout public Hotseat(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); - - Resources r = context.getResources(); - mTransposeLayoutWithOrientation = - r.getBoolean(R.bool.hotseat_transpose_layout_with_orientation); - mIsLandscape = context.getResources().getConfiguration().orientation == - Configuration.ORIENTATION_LANDSCAPE; mLauncher = (Launcher) context; + mHasVerticalHotseat = mLauncher.getDeviceProfile().isVerticalBarLayout(); } CellLayout getLayout() { @@ -77,26 +71,18 @@ public class Hotseat extends FrameLayout mContent.setOnLongClickListener(l); } - private boolean hasVerticalHotseat() { - return (mIsLandscape && mTransposeLayoutWithOrientation); - } - /* Get the orientation invariant order of the item in the hotseat for persistence. */ int getOrderInHotseat(int x, int y) { - return hasVerticalHotseat() ? (mContent.getCountY() - y - 1) : x; + return mHasVerticalHotseat ? (mContent.getCountY() - y - 1) : x; } /* Get the orientation specific coordinates given an invariant order in the hotseat. */ int getCellXFromOrder(int rank) { - return hasVerticalHotseat() ? 0 : rank; + return mHasVerticalHotseat ? 0 : rank; } int getCellYFromOrder(int rank) { - return hasVerticalHotseat() ? (mContent.getCountY() - (rank + 1)) : 0; - } - - public int getAllAppsButtonRank() { - return mAllAppsButtonRank; + return mHasVerticalHotseat ? (mContent.getCountY() - (rank + 1)) : 0; } public boolean isAllAppsButtonRank(int rank) { -- cgit v1.2.3