Skip to content

Commit

Permalink
Add cell_max_count for grid size
Browse files Browse the repository at this point in the history
While in 360dp and 320 dpi, having a grid size bigger than 6x6 made the icon text overlap

Change-Id: I76e2c8cdf734c0c936126df8e08f935fe6ce88b3
  • Loading branch information
yghazikantelinen committed May 7, 2013
1 parent d2906e9 commit b1153e8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions res/values-sw600dp/config.xml
@@ -1,6 +1,8 @@
<resources>
<integer name="cell_count_x">6</integer>
<integer name="cell_count_y">6</integer>
<integer name="cell_max_count_x">7</integer>
<integer name="cell_max_count_y">7</integer>
<integer name="hotseat_cell_count">7</integer>
<integer name="hotseat_all_apps_index">3</integer>
<bool name="allow_rotation">true</bool>
Expand Down
2 changes: 2 additions & 0 deletions res/values-sw720dp/config.xml
@@ -1,6 +1,8 @@
<resources>
<integer name="cell_count_x">8</integer>
<integer name="cell_count_y">5</integer>
<integer name="cell_max_count_x">9</integer>
<integer name="cell_max_count_y">9</integer>
<integer name="hotseat_cell_count">7</integer>
<integer name="hotseat_all_apps_index">3</integer>
<bool name="config_largeHeap">true</bool>
Expand Down
2 changes: 2 additions & 0 deletions res/values/config.xml
Expand Up @@ -77,6 +77,8 @@

<integer name="cell_count_x">4</integer>
<integer name="cell_count_y">4</integer>
<integer name="cell_max_count_x">6</integer>
<integer name="cell_max_count_y">6</integer>

<!-- Whether or not to use custom clings if a custom workspace layout is passed in -->
<bool name="config_useCustomClings">false</bool>
Expand Down
4 changes: 2 additions & 2 deletions res/xml/preferences_homescreen.xml
Expand Up @@ -25,9 +25,9 @@
android:summary="@string/preferences_interface_homescreen_general_grid_summary"
launcher:pickerTitle1="@string/preferences_interface_homescreen_general_grid_rows_title"
launcher:pickerTitle2="@string/preferences_interface_homescreen_general_grid_columns_title"
launcher:max1="7"
launcher:max1="@integer/cell_max_count_x"
launcher:min1="3"
launcher:max2="7"
launcher:max2="@integer/cell_max_count_y"
launcher:min2="3" />
<com.android.launcher2.preference.NumberPickerPreference android:key="ui_homescreen_screens"
android:title="@string/preferences_interface_homescreen_general_screens_title"
Expand Down
5 changes: 4 additions & 1 deletion src/com/android/launcher2/Workspace.java
Expand Up @@ -355,7 +355,10 @@ public Workspace(Context context, AttributeSet attrs, int defStyle) {
cellCountX = PreferencesProvider.getCellCountX(cellCountX);
cellCountY = PreferencesProvider.getCellCountY(cellCountY);
//}


cellCountX = Math.min(cellCountX, res.getInteger(R.integer.cell_max_count_x));
cellCountY = Math.min(cellCountY, res.getInteger(R.integer.cell_max_count_y));

a.recycle();

setOnHierarchyChangeListener(this);
Expand Down

0 comments on commit b1153e8

Please sign in to comment.