diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-06-05 00:13:25 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2015-06-05 00:34:06 -0700 |
commit | 4f3e9383eb422c87e2689548653b89f34f5516a5 (patch) | |
tree | fe42f1800be1eabeac6498e0bfb14f91b2b77ba2 /src/com/android/launcher3/Hotseat.java | |
parent | 26c2842f07668385b8f4594848cf6e93502da4a3 (diff) | |
download | android_packages_apps_Trebuchet-4f3e9383eb422c87e2689548653b89f34f5516a5.tar.gz android_packages_apps_Trebuchet-4f3e9383eb422c87e2689548653b89f34f5516a5.tar.bz2 android_packages_apps_Trebuchet-4f3e9383eb422c87e2689548653b89f34f5516a5.zip |
Code cleanup
> Removing obsolete logging
> Removing unused methods
> Removing resource leak warning due to non-static handler class in launcher
Change-Id: Ic38cc8aea82899b0b5ee3235f04e5964e49245fb
Diffstat (limited to 'src/com/android/launcher3/Hotseat.java')
-rw-r--r-- | src/com/android/launcher3/Hotseat.java | 24 |
1 files changed, 5 insertions, 19 deletions
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) { |