diff options
author | nebkat <nebkat@teamhacksung.org> | 2012-05-12 13:44:31 +0100 |
---|---|---|
committer | nebkat <nebkat@teamhacksung.org> | 2012-12-24 10:51:23 +0000 |
commit | 31ea6333b6f9cd92d89d4bf19bdc3430ca5c6959 (patch) | |
tree | 0a8cb9b6fe104848de39187bb6d5fe546a98f94f /src/com/cyanogenmod | |
parent | d9cb08dc62e6a816f81d640b4829bb9266a5c38c (diff) | |
download | packages_apps_trebuchet-31ea6333b6f9cd92d89d4bf19bdc3430ca5c6959.zip packages_apps_trebuchet-31ea6333b6f9cd92d89d4bf19bdc3430ca5c6959.tar.gz packages_apps_trebuchet-31ea6333b6f9cd92d89d4bf19bdc3430ca5c6959.tar.bz2 |
Hotseat: Cleanup
Conflicts:
res/layout-land/hotseat.xml
res/layout-port/hotseat.xml
src/com/cyanogenmod/trebuchet/Hotseat.java
Change-Id: Id21610950b427a320e7f7ec0d7ba8a7d869d2aa7
Diffstat (limited to 'src/com/cyanogenmod')
-rw-r--r-- | src/com/cyanogenmod/trebuchet/Hotseat.java | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/com/cyanogenmod/trebuchet/Hotseat.java b/src/com/cyanogenmod/trebuchet/Hotseat.java index 2ae3a23..c7c0978 100644 --- a/src/com/cyanogenmod/trebuchet/Hotseat.java +++ b/src/com/cyanogenmod/trebuchet/Hotseat.java @@ -31,15 +31,12 @@ public class Hotseat extends PagedView { private Launcher mLauncher; private CellLayout mContent; - private int mCellCountX; - private int mCellCountY; - private int mAllAppsButtonRank; + private int mCellCount; private boolean mTransposeLayoutWithOrientation; private boolean mIsLandscape; - private static final int DEFAULT_CELL_COUNT_X = 5; - private static final int DEFAULT_CELL_COUNT_Y = 1; + private static final int DEFAULT_CELL_COUNT = 5; public Hotseat(Context context) { this(context, null); @@ -67,15 +64,10 @@ public class Hotseat extends PagedView { context.getResources().getBoolean(R.bool.hotseat_transpose_layout_with_orientation); mIsLandscape = context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE; - mCellCountX = a.getInt(R.styleable.Hotseat_cellCountX, !mIsLandscape ? DEFAULT_CELL_COUNT_X : DEFAULT_CELL_COUNT_Y); - mCellCountY = a.getInt(R.styleable.Hotseat_cellCountY, !mIsLandscape ? DEFAULT_CELL_COUNT_Y : DEFAULT_CELL_COUNT_X); + mCellCount = a.getInt(R.styleable.Hotseat_cellCount, DEFAULT_CELL_COUNT); int cellCount = PreferencesProvider.Interface.Dock.getNumberIcons(0); if (cellCount > 0) { - if (!mIsLandscape) { - mCellCountX = cellCount; - } else { - mCellCountY = cellCount; - } + mCellCount = cellCount; } mVertical = mIsLandscape; @@ -84,8 +76,8 @@ public class Hotseat extends PagedView { (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); for (int i = 0; i < hotseatPages; i++) { CellLayout cl = (CellLayout) inflater.inflate(R.layout.hotseat_page, null); - cl.setGridSize(mCellCountX, mCellCountY); cl.setIsHotseat(true); + cl.setGridSize((!mIsLandscape ? mCellCount : 1), (mIsLandscape ? mCellCount : 1)); addView(cl); } |