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/com/cyanogenmod/trebuchet/Hotseat.java | |
parent | 1650f04a9d18c97589176962e1b89b658d65bca8 (diff) | |
download | android_packages_apps_Trebuchet-3c512865bfc4243ccab4103320407dcd1e58d874.tar.gz android_packages_apps_Trebuchet-3c512865bfc4243ccab4103320407dcd1e58d874.tar.bz2 android_packages_apps_Trebuchet-3c512865bfc4243ccab4103320407dcd1e58d874.zip |
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/com/cyanogenmod/trebuchet/Hotseat.java')
-rw-r--r-- | src/com/cyanogenmod/trebuchet/Hotseat.java | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/com/cyanogenmod/trebuchet/Hotseat.java b/src/com/cyanogenmod/trebuchet/Hotseat.java index 781291366..84a8796b9 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(); } |