diff options
author | nebkat <nebkat@teamhacksung.org> | 2012-03-28 18:08:22 +0100 |
---|---|---|
committer | nebkat <nebkat@teamhacksung.org> | 2012-12-24 10:12:26 +0000 |
commit | 3c512865bfc4243ccab4103320407dcd1e58d874 (patch) | |
tree | b1e03685752187600c90fcdc0899fd1e2fc9ac1a /src | |
parent | 1650f04a9d18c97589176962e1b89b658d65bca8 (diff) | |
download | packages_apps_trebuchet-3c512865bfc4243ccab4103320407dcd1e58d874.zip packages_apps_trebuchet-3c512865bfc4243ccab4103320407dcd1e58d874.tar.gz packages_apps_trebuchet-3c512865bfc4243ccab4103320407dcd1e58d874.tar.bz2 |
Hotseat: Number Icons
Conflicts:
res/values/strings.xml
res/xml/preferences.xml
src/com/beansoft/launcher/preference/PreferencesProvider.java
src/com/cyanogenmod/trebuchet/Hotseat.java
Change-Id: I839171c99f4050ad9dc03fbe82c8ed7be41cb4c0
Diffstat (limited to 'src')
-rw-r--r-- | src/com/cyanogenmod/trebuchet/Hotseat.java | 26 | ||||
-rw-r--r-- | src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java | 7 |
2 files changed, 17 insertions, 16 deletions
diff --git a/src/com/cyanogenmod/trebuchet/Hotseat.java b/src/com/cyanogenmod/trebuchet/Hotseat.java index 7812913..84a8796 100644 --- a/src/com/cyanogenmod/trebuchet/Hotseat.java +++ b/src/com/cyanogenmod/trebuchet/Hotseat.java @@ -58,25 +58,30 @@ public class Hotseat extends PagedView { int hotseatPages = PreferencesProvider.Interface.Dock.getNumberPages(); int defaultPage = PreferencesProvider.Interface.Dock.getDefaultPage(hotseatPages / 2); - LayoutInflater inflater = - (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - for (int i = 0; i < hotseatPages; i++) { - inflater.inflate(R.layout.hotseat_page, this); - } mCurrentPage = defaultPage; TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.Hotseat, defStyle, 0); Resources r = context.getResources(); - mCellCountX = a.getInt(R.styleable.Hotseat_cellCountX, -1); - mCellCountY = a.getInt(R.styleable.Hotseat_cellCountY, -1); + mCellCountX = a.getInt(R.styleable.Hotseat_cellCountX, DEFAULT_CELL_COUNT_X); + mCellCountY = a.getInt(R.styleable.Hotseat_cellCountY, DEFAULT_CELL_COUNT_Y); + mCellCountX = PreferencesProvider.Interface.Dock.getNumberIcons(mCellCountX); mAllAppsButtonRank = r.getInteger(R.integer.hotseat_all_apps_index); mTransposeLayoutWithOrientation = r.getBoolean(R.bool.hotseat_transpose_layout_with_orientation); mIsLandscape = context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE; + LayoutInflater inflater = + (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); + addView(cl); + } + // No data needed setDataIsReady(); } @@ -118,13 +123,6 @@ public class Hotseat extends PagedView { @Override protected void onFinishInflate() { super.onFinishInflate(); - if (mCellCountX < 0) mCellCountX = DEFAULT_CELL_COUNT_X; - if (mCellCountY < 0) mCellCountY = DEFAULT_CELL_COUNT_Y; - for (int i = 0; i < getChildCount(); i++) { - CellLayout cl = (CellLayout) getPageAt(i); - cl.setGridSize(mCellCountX, mCellCountY); - cl.setIsHotseat(true); - } resetLayout(); } diff --git a/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java b/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java index a6094ef..98cfd1a 100644 --- a/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java +++ b/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java @@ -179,11 +179,14 @@ public final class PreferencesProvider { } public static class Dock { + public static int getNumberPages() { + return getInt("ui_dock_pages", 1); + } public static int getDefaultPage(int def) { return getInt("ui_dock_default_page", def + 1) - 1; } - public static int getNumberPages() { - return getInt("ui_dock_pages", 1); + public static int getNumberIcons(int def) { + return getInt("ui_dock_icons", def); } public static boolean getShowDivider() { return getBoolean("ui_dock_divider", true); |