summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaj Yengisetty <rajesh@cyngn.com>2014-11-10 18:35:00 (GMT)
committerAdnan <adnan@cyngn.com>2014-11-19 23:53:57 (GMT)
commitd784b52040dc1d688b5f98c186038ab188669040 (patch)
tree27d8940569edd2e0ff30d1f5f8b174551675943d
parent5dc390cde4aa6efc41e145610bb993e4754fd440 (diff)
downloadandroid_packages_apps_Trebuchet-d784b52040dc1d688b5f98c186038ab188669040.zip
android_packages_apps_Trebuchet-d784b52040dc1d688b5f98c186038ab188669040.tar.gz
android_packages_apps_Trebuchet-d784b52040dc1d688b5f98c186038ab188669040.tar.bz2
Customizeable Dynamic Grid:
- Presets - Comfortable (+0) - Cozy (+1) - Condensed (+2) - Custom option with min, max Reordering items in the settings pane for better organization Modifying Settings Layout for readability Conflicts: res/layout/settings_pane_list_item.xml res/values/cm_strings.xml src/com/android/launcher3/DeviceProfile.java src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java Change-Id: I5c926b6ca4b2ed73c263ef34eeb368caeb7af9b5
-rw-r--r--WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java14
-rw-r--r--res/drawable/grid.pngbin0 -> 1971 bytes
-rw-r--r--res/drawable/grid_comfortable.pngbin0 -> 1984 bytes
-rw-r--r--res/drawable/grid_condensed.pngbin0 -> 2033 bytes
-rw-r--r--res/drawable/grid_cozy.pngbin0 -> 2006 bytes
-rw-r--r--res/layout/custom_grid_size_dialog.xml33
-rw-r--r--res/layout/dynamic_grid_size_screen.xml52
-rw-r--r--res/layout/hidden_apps_list.xml7
-rw-r--r--res/layout/hidden_apps_list_item.xml33
-rw-r--r--res/layout/settings_pane_list_item.xml14
-rw-r--r--res/values/cm_strings.xml23
-rw-r--r--res/values/dimens.xml6
-rw-r--r--src/com/android/launcher3/AppsCustomizePagedView.java88
-rw-r--r--src/com/android/launcher3/CellLayout.java3
-rw-r--r--src/com/android/launcher3/DeviceProfile.java58
-rw-r--r--src/com/android/launcher3/DynamicGridSizeFragment.java331
-rw-r--r--src/com/android/launcher3/Folder.java1
-rw-r--r--src/com/android/launcher3/Launcher.java49
-rw-r--r--src/com/android/launcher3/LauncherModel.java2
-rw-r--r--src/com/android/launcher3/OverviewSettingsPanel.java32
-rw-r--r--src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java66
21 files changed, 664 insertions, 148 deletions
diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
index 619069d..0728537 100644
--- a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
+++ b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
@@ -702,20 +702,6 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
return thumb;
}
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- // Handle presses on the action bar items
- switch (item.getItemId()) {
- case MENU_WALLPAPER_SCROLL:
- SettingsProvider.get(this).edit()
- .putBoolean(SettingsProvider.SETTINGS_UI_HOMESCREEN_SCROLLING_WALLPAPER_SCROLL, !item.isChecked())
- .commit();
- return true;
- default:
- return super.onOptionsItemSelected(item);
- }
- }
-
protected void onStop() {
super.onStop();
mWallpaperStrip = findViewById(R.id.wallpaper_strip);
diff --git a/res/drawable/grid.png b/res/drawable/grid.png
new file mode 100644
index 0000000..79fe901
--- /dev/null
+++ b/res/drawable/grid.png
Binary files differ
diff --git a/res/drawable/grid_comfortable.png b/res/drawable/grid_comfortable.png
new file mode 100644
index 0000000..34e3ef2
--- /dev/null
+++ b/res/drawable/grid_comfortable.png
Binary files differ
diff --git a/res/drawable/grid_condensed.png b/res/drawable/grid_condensed.png
new file mode 100644
index 0000000..ebc9d4e
--- /dev/null
+++ b/res/drawable/grid_condensed.png
Binary files differ
diff --git a/res/drawable/grid_cozy.png b/res/drawable/grid_cozy.png
new file mode 100644
index 0000000..929bcb5
--- /dev/null
+++ b/res/drawable/grid_cozy.png
Binary files differ
diff --git a/res/layout/custom_grid_size_dialog.xml b/res/layout/custom_grid_size_dialog.xml
new file mode 100644
index 0000000..d7345ee
--- /dev/null
+++ b/res/layout/custom_grid_size_dialog.xml
@@ -0,0 +1,33 @@
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" >
+
+ <LinearLayout
+ android:id="@+id/grid_number_pickers"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerHorizontal="true"
+ android:orientation="horizontal">
+
+ <NumberPicker
+ android:id="@+id/custom_rows"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginRight="@dimen/dialog_padding"/>
+
+ <NumberPicker
+ android:id="@+id/custom_columns"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="@dimen/dialog_padding"/>
+
+ </LinearLayout>
+
+ <Button
+ android:id="@+id/dialog_confirm_button"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/dialog_confirm"
+ android:layout_below="@id/grid_number_pickers"
+ android:layout_marginTop="@dimen/dialog_padding"/>
+</RelativeLayout> \ No newline at end of file
diff --git a/res/layout/dynamic_grid_size_screen.xml b/res/layout/dynamic_grid_size_screen.xml
new file mode 100644
index 0000000..9aca726
--- /dev/null
+++ b/res/layout/dynamic_grid_size_screen.xml
@@ -0,0 +1,52 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_gravity="center_horizontal|bottom"
+ android:background="@color/settings_bg_color"
+ android:orientation="vertical"
+ android:paddingBottom="@dimen/overview_panel_bottom_padding"
+ android:paddingTop="@dimen/overview_panel_bottom_padding"
+ android:clickable="true" >
+
+ <LinearLayout
+ android:id="@+id/dynamic_grid_title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:background="@drawable/listitem_bg"
+ android:clickable="true" >
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:adjustViewBounds="true"
+ android:src="@drawable/handle_left" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/grid_size_text"
+ android:textAllCaps="true"
+ android:fontFamily="sans-serif-condensed"
+ android:textColor="@android:color/white"
+ android:layout_gravity="center_vertical"
+ android:textSize="16sp" />
+ </LinearLayout>
+
+ <ImageView
+ android:id="@+id/dynamic_grid_size_image"
+ android:layout_width="150dp"
+ android:layout_height="150dp"
+ android:layout_gravity="center_horizontal"
+ android:adjustViewBounds="true"
+ android:layout_marginBottom="@dimen/grid_padding"/>
+
+ <ListView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/dynamic_grid_list"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:listSelector="@android:color/transparent"
+ android:splitMotionEvents="false"/>
+</LinearLayout>
diff --git a/res/layout/hidden_apps_list.xml b/res/layout/hidden_apps_list.xml
new file mode 100644
index 0000000..fb0d4bf
--- /dev/null
+++ b/res/layout/hidden_apps_list.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ListView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@android:id/list"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="5dp"
+ android:choiceMode="multipleChoice" /> \ No newline at end of file
diff --git a/res/layout/hidden_apps_list_item.xml b/res/layout/hidden_apps_list_item.xml
new file mode 100644
index 0000000..a00b077
--- /dev/null
+++ b/res/layout/hidden_apps_list_item.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<com.android.launcher3.widget.CheckableLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="48dp"
+ android:gravity="center_vertical"
+ android:paddingRight="?android:attr/scrollbarSize"
+ android:background="?android:attr/selectableItemBackground"
+ android:descendantFocusability="blocksDescendants">
+
+ <ImageView android:id="@+id/icon"
+ android:layout_width="40dp"
+ android:layout_height="40dp"
+ android:layout_gravity="center" />
+
+ <TextView android:id="@+id/title"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="15dip"
+ android:layout_marginRight="6dip"
+ android:layout_marginTop="6dip"
+ android:layout_marginBottom="6dip"
+ android:layout_weight="1"
+ android:singleLine="true"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:ellipsize="marquee"
+ android:fadingEdge="horizontal" />
+
+ <com.android.launcher3.widget.InertCheckBox android:id="@+id/checkbox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+
+</com.android.launcher3.widget.CheckableLinearLayout> \ No newline at end of file
diff --git a/res/layout/settings_pane_list_item.xml b/res/layout/settings_pane_list_item.xml
index 2a9d31b..4bfb288 100644
--- a/res/layout/settings_pane_list_item.xml
+++ b/res/layout/settings_pane_list_item.xml
@@ -17,7 +17,11 @@
android:paddingBottom="@dimen/overview_panel_list_padding"
android:paddingTop="@dimen/overview_panel_list_padding"
android:textSize="20sp"
- android:textColor="@color/listitem_text"/>
+ android:textColor="@color/listitem_text"
+ android:layout_alignParentLeft="true"
+ android:scrollHorizontally="true"
+ android:ellipsize="end"
+ android:maxLines="1"/>
<TextView
android:id="@+id/item_state"
@@ -31,6 +35,10 @@
android:paddingTop="@dimen/overview_panel_list_padding"
android:textSize="20sp"
android:textAllCaps="true"
- android:textColor="@color/listitem_text" />
+ android:textColor="@color/listitem_text"
+ android:layout_toRightOf="@id/item_name"
+ android:scrollHorizontally="true"
+ android:ellipsize="end"
+ android:maxLines="1"/>
-</RelativeLayout> \ No newline at end of file
+</RelativeLayout>
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml
index ef1d3d0..be2d919 100644
--- a/res/values/cm_strings.xml
+++ b/res/values/cm_strings.xml
@@ -23,13 +23,7 @@
<string name="launcher_settings">LAUNCHER SETTINGS</string>
<string name="home_screen_settings">HOME SCREEN SETTINGS</string>
<string name="drawer_settings">DRAWER SETTINGS</string>
-
- <!-- Settings states -->
- <string name="setting_state_on">ON</string>
- <string name="setting_state_off">OFF</string>
-
- <!-- Themes button -->
- <string name="themes_button_text">Themes</string>
+ <string name="app_settings">APP SETTINGS</string>
<string name="scrolling_page_outlines">Page outlines</string>
<string name="scrolling_fade_adjacent">Fade side pages</string>
@@ -64,13 +58,20 @@
<!-- Dock -->
<string name="preferences_interface_dock_title">Dock</string>
- <!-- Wallpaper scroll effect -->
- <string name="scrolling_wallpaper">Scroll wallpaper</string>
<!-- General -->
<string name="dialog_pick_iconpack_title">Pick icon pack</string>
<string name="default_iconpack_title">Default icons</string>
<string name="no_iconpacks_summary">No icon packs installed</string>
+ <!-- Dynamic Grid -->
+ <string name="grid_size_text">Grid size</string>
+ <string name="grid_size_comfortable">Comfortable</string>
+ <string name="grid_size_cozy">Cozy</string>
+ <string name="grid_size_condensed">Condensed</string>
+ <string name="grid_size_custom">Custom</string>
+ <string name="preferences_interface_homescreen_custom">Select custom size</string>
+ <string name="preferences_interface_homescreen_rows_title">Number of rows</string>
+ <string name="preferences_interface_homescreen_columns_title">Number of columns</string>
<!-- Folder titles -->
<string name="google_title" translatable="false">Google</string>
@@ -121,4 +122,8 @@
<string name="scrolling_wallpaper">Scroll wallpaper</string>
<!-- Toast message when search screen on left is not supported -->
<string name="search_screen_left_unsupported_toast">You must have a supported search app and CyanogenMod to use this feature.</string>
+
+ <!-- Dialog -->
+ <string name="dialog_confirm">Confirm</string>
+
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 29a6c39..4980e09 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -107,4 +107,10 @@
<!-- Settings Pane dimen -->
<dimen name="settings_pane_handle">48dp</dimen>
+
+ <!-- Dynamic Grid settings -->
+ <dimen name="dialog_padding">10dp</dimen>
+
+ <dimen name="grid_padding">15dp</dimen>
+ <dimen name="grid_custom_text">50dp</dimen>
</resources>
diff --git a/src/com/android/launcher3/AppsCustomizePagedView.java b/src/com/android/launcher3/AppsCustomizePagedView.java
index abccbb0..61ae289 100644
--- a/src/com/android/launcher3/AppsCustomizePagedView.java
+++ b/src/com/android/launcher3/AppsCustomizePagedView.java
@@ -23,6 +23,7 @@ import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProviderInfo;
import android.content.ComponentName;
import android.content.Context;
+import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
@@ -191,6 +192,11 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
private SortMode mSortMode = SortMode.Title;
+ private int mFilterApps = FILTER_APPS_SYSTEM_FLAG | FILTER_APPS_DOWNLOADED_FLAG;
+
+ private static final int FILTER_APPS_SYSTEM_FLAG = 1;
+ private static final int FILTER_APPS_DOWNLOADED_FLAG = 2;
+
// Refs
private Launcher mLauncher;
private DragController mDragController;
@@ -1517,6 +1523,22 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
}
+ public void setShowSystemApps(boolean show) {
+ if (show) {
+ mFilterApps |= FILTER_APPS_SYSTEM_FLAG;
+ } else {
+ mFilterApps &= ~FILTER_APPS_DOWNLOADED_FLAG;
+ }
+ }
+
+ public boolean getShowSystemApps() {
+ return (mFilterApps & FILTER_APPS_SYSTEM_FLAG) != 0;
+ }
+
+ public boolean getShowDownloadedApps() {
+ return (mFilterApps & FILTER_APPS_DOWNLOADED_FLAG) != 0;
+ }
+
public void setApps(ArrayList<AppInfo> list) {
if (!LauncherAppState.isDisableAllApps()) {
mApps = list;
@@ -1597,72 +1619,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
}
- public void filterAppsWithoutInvalidate() {
- updateProtectedAppsList(mLauncher);
-
- mFilteredApps = new ArrayList<AppInfo>(mApps);
- Iterator<AppInfo> iterator = mFilteredApps.iterator();
- while (iterator.hasNext()) {
- AppInfo appInfo = iterator.next();
- boolean system = (appInfo.flags & AppInfo.DOWNLOADED_FLAG) == 0;
- if (mProtectedApps.contains(appInfo.componentName) ||
- (system && !getShowSystemApps()) ||
- (!system && !getShowDownloadedApps())) {
- iterator.remove();
- }
- }
- Collections.sort(mFilteredApps, getComparatorForSortMode());
- }
-
- public void filterApps() {
- filterAppsWithoutInvalidate();
- updatePageCountsAndInvalidateData();
- }
-
- public void filterWidgetsWithoutInvalidate() {
- updateProtectedAppsList(mLauncher);
-
- mFilteredWidgets = new ArrayList<Object>(mWidgets);
-
- Iterator<Object> iterator = mFilteredWidgets.iterator();
- while (iterator.hasNext()) {
- Object o = iterator.next();
-
- String packageName;
- if (o instanceof AppWidgetProviderInfo) {
- AppWidgetProviderInfo widgetInfo = (AppWidgetProviderInfo) o;
- if (widgetInfo.provider == null) {
- continue;
- }
- packageName = widgetInfo.provider.getPackageName();
- } else if (o instanceof ResolveInfo) {
- ResolveInfo shortcut = (ResolveInfo) o;
- packageName = shortcut.activityInfo.applicationInfo.packageName;
- } else {
- Log.w(TAG, "Unknown class in widgets list: " + o.getClass());
- continue;
- }
-
- int flags;
- try {
- flags = AppInfo.initFlags(mPackageManager.getPackageInfo(packageName, 0));
- } catch (NameNotFoundException e) {
- flags = 0;
- }
- boolean system = (flags & AppInfo.DOWNLOADED_FLAG) == 0;
- if (mProtectedPackages.contains(packageName) ||
- (system && !getShowSystemApps()) ||
- (!system && !getShowDownloadedApps())) {
- iterator.remove();
- }
- }
- }
-
- public void filterWidgets() {
- filterWidgetsWithoutInvalidate();
- updatePageCountsAndInvalidateData();
- }
-
public void reset() {
// If we have reset, then we should not continue to restore the previous state
mSaveInstanceStateItemIndex = -1;
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index 0ff1ef4..131d638 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -3049,7 +3049,8 @@ out: for (int i = x; i < x + spanX - 1 && x < xCount; i++) {
if (x < mCountX && y < mCountY) {
return mOccupied[x][y];
} else {
- throw new RuntimeException("Position exceeds the bound of this CellLayout");
+ Log.w(TAG, "Position exceeds the bound of this CellLayout");
+ return false;
}
}
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index c5f51d8..b6a8d82 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -41,6 +41,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
+import com.android.launcher3.settings.SettingsProvider;
class DeviceProfileQuery {
DeviceProfile profile;
@@ -63,11 +64,45 @@ public class DeviceProfile {
public void onAvailableSizeChanged(DeviceProfile grid);
}
+ public final static int GRID_SIZE_MAX = 3;
+ public final static int GRID_SIZE_MIN = 2;
+
+ public enum GridSize {
+ Comfortable(0),
+ Cozy(1),
+ Condensed(2),
+ Custom(3);
+
+ private final int mValue;
+ private GridSize(int value) {
+ mValue = value;
+ }
+
+ public int getValue() {
+ return mValue;
+ }
+
+ public static GridSize getModeForValue(int value) {
+ switch (value) {
+ case 1:
+ return Cozy;
+ case 2:
+ return Condensed;
+ case 3:
+ return Custom;
+ default :
+ return Comfortable;
+ }
+ }
+ }
+
String name;
float minWidthDps;
float minHeightDps;
float numRows;
float numColumns;
+ int numRowsBase;
+ int numColumnsBase;
float numHotseatIcons;
float iconSize;
private float iconTextSize;
@@ -212,6 +247,29 @@ public class DeviceProfile {
numHotseatIcons = closestProfile.numHotseatIcons;
hotseatAllAppsRank = (int) (numHotseatIcons / 2);
+ numRowsBase = (int) numRows;
+ int gridResize = SettingsProvider.getIntCustomDefault(context,
+ SettingsProvider.SETTINGS_UI_DYNAMIC_GRID_SIZE, 0);
+ if (GridSize.getModeForValue(gridResize) != GridSize.Custom) {
+ numRows += gridResize;
+ } else {
+ int iTempNumberOfRows = SettingsProvider.getIntCustomDefault(context,
+ SettingsProvider.SETTINGS_UI_HOMESCREEN_ROWS, (int)numRows);
+ if (iTempNumberOfRows > 0) {
+ numRows = iTempNumberOfRows;
+ }
+ }
+ numColumnsBase = (int) numColumns;
+ if (GridSize.getModeForValue(gridResize) != GridSize.Custom) {
+ numColumns += gridResize;
+ } else {
+ int iTempNumberOfColumns = SettingsProvider.getIntCustomDefault(context,
+ SettingsProvider.SETTINGS_UI_HOMESCREEN_COLUMNS, (int)numColumns);
+ if (iTempNumberOfColumns > 0) {
+ numColumns = iTempNumberOfColumns;
+ }
+ }
+
// Snap to the closest default layout id
defaultLayoutId = closestProfile.defaultLayoutId;
diff --git a/src/com/android/launcher3/DynamicGridSizeFragment.java b/src/com/android/launcher3/DynamicGridSizeFragment.java
new file mode 100644
index 0000000..2fda39f
--- /dev/null
+++ b/src/com/android/launcher3/DynamicGridSizeFragment.java
@@ -0,0 +1,331 @@
+package com.android.launcher3;
+
+import android.animation.Animator;
+import android.animation.ObjectAnimator;
+import android.app.Dialog;
+import android.app.Fragment;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.res.Resources;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.util.DisplayMetrics;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.ListView;
+import android.widget.NumberPicker;
+import android.widget.TextView;
+import com.android.launcher3.settings.SettingsProvider;
+
+public class DynamicGridSizeFragment extends Fragment implements NumberPicker.OnValueChangeListener, Dialog.OnDismissListener{
+ public static final String DYNAMIC_GRID_SIZE_FRAGMENT = "dynamicGridSizeFragment";
+ public static final int MIN_DYNAMIC_GRID_ROWS = 2;
+ public static final int MIN_DYNAMIC_GRID_COLUMNS = 3;
+ ImageView mDynamicGridImage;
+ ListView mListView;
+ View mCurrentSelection;
+ GridSizeArrayAdapter mAdapter;
+ DeviceProfile.GridSize mCurrentSize;
+
+ Dialog mDialog;
+
+ int mCustomGridRows = 0;
+ int mCustomGridColumns = 0;
+
+ View.OnClickListener mSettingsItemListener = new View.OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ mCurrentSize = DeviceProfile.GridSize
+ .getModeForValue((Integer) v.getTag());
+
+ setCleared(mCurrentSelection);
+ setSelected(v);
+ mCurrentSelection = v;
+
+ if (mCurrentSize == DeviceProfile.GridSize.Custom) {
+ showNumberPicker();
+ }
+
+ ((GridSizeArrayAdapter) mListView.getAdapter()).notifyDataSetChanged();
+
+ mAdapter.notifyDataSetInvalidated();
+ setCurrentImage();
+ }
+ };
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View v = inflater.inflate(R.layout.dynamic_grid_size_screen, container, false);
+ mDynamicGridImage = (ImageView) v.findViewById(R.id.dynamic_grid_size_image);
+ mDynamicGridImage.setBackground(getResources().getDrawable(R.drawable.grid));
+
+ LinearLayout titleLayout = (LinearLayout) v.findViewById(R.id.dynamic_grid_title);
+ titleLayout.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ setSize();
+ }
+ });
+
+ mCurrentSize = DeviceProfile.GridSize.getModeForValue(
+ SettingsProvider.getIntCustomDefault(getActivity(),
+ SettingsProvider.SETTINGS_UI_DYNAMIC_GRID_SIZE, 0));
+
+ setCurrentImage();
+
+ mListView = (ListView) v.findViewById(R.id.dynamic_grid_list);
+ Resources res = getResources();
+ String [] values = {
+ res.getString(R.string.grid_size_comfortable),
+ res.getString(R.string.grid_size_cozy),
+ res.getString(R.string.grid_size_condensed),
+ res.getString(R.string.grid_size_custom)};
+ mAdapter = new GridSizeArrayAdapter(getActivity(),
+ R.layout.settings_pane_list_item, values);
+ mListView.setAdapter(mAdapter);
+
+ return v;
+ }
+
+ private void setCurrentImage() {
+ Drawable d = null;
+ boolean custom = false;
+
+ switch (mCurrentSize) {
+ case Comfortable:
+ d = getResources().getDrawable(R.drawable.grid_comfortable);
+ break;
+ case Cozy:
+ d = getResources().getDrawable(R.drawable.grid_cozy);
+ break;
+ case Condensed:
+ d = getResources().getDrawable(R.drawable.grid_condensed);
+ break;
+ default:
+
+ custom = true;
+ break;
+ }
+
+ if (d != null && !custom) {
+ mDynamicGridImage.setImageBitmap(null);
+ mDynamicGridImage.setBackground(d);
+ } else if (custom) {
+ mDynamicGridImage.setBackground(null);
+ mDynamicGridImage.setImageBitmap(writeOnDrawable(R.drawable.grid));
+ }
+ }
+
+ public Bitmap writeOnDrawable(int drawableId){
+ LauncherAppState app = LauncherAppState.getInstance();
+ DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
+
+ int rows = mCustomGridRows == 0 ? (int) grid.numRows : mCustomGridRows;
+ int columns = mCustomGridColumns == 0 ? (int) grid.numColumns : mCustomGridColumns;
+
+ String text = rows + " x " + columns;
+
+ Bitmap bm = BitmapFactory.decodeResource(getResources(),
+ drawableId).copy(Bitmap.Config.ARGB_8888, true);
+
+ Paint paint = new Paint();
+ paint.setStyle(Paint.Style.FILL);
+ paint.setColor(Color.BLACK);
+ int px = getResources().getDimensionPixelOffset(R.dimen.grid_custom_text);
+ paint.setTextSize(px);
+
+ Canvas canvas = new Canvas(bm);
+
+ float canvasWidth = canvas.getWidth();
+ float sentenceWidth = paint.measureText(text);
+ float startPositionX = (canvasWidth - sentenceWidth) / 2;
+
+ canvas.drawText(text, startPositionX, bm.getHeight()/2, paint);
+
+ return bm;
+ }
+
+ @Override
+ public Animator onCreateAnimator(int transit, boolean enter, int nextAnim) {
+ if (enter) {
+ DisplayMetrics displaymetrics = new DisplayMetrics();
+ getActivity().getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
+ int width = displaymetrics.widthPixels;
+ final ObjectAnimator anim = ObjectAnimator.ofFloat(this, "translationX", width, 0);
+
+ final View darkPanel = ((Launcher) getActivity()).getDarkPanel();
+ darkPanel.setVisibility(View.VISIBLE);
+ ObjectAnimator anim2 = ObjectAnimator.ofFloat(
+ darkPanel , "alpha", 0.0f, 0.3f);
+ anim2.start();
+
+ anim.addListener(new Animator.AnimatorListener() {
+ @Override
+ public void onAnimationStart(Animator arg0) {}
+ @Override
+ public void onAnimationRepeat(Animator arg0) {}
+ @Override
+ public void onAnimationEnd(Animator arg0) {
+ darkPanel.setVisibility(View.GONE);
+ }
+ @Override
+ public void onAnimationCancel(Animator arg0) {}
+ });
+
+ return anim;
+ } else {
+ return super.onCreateAnimator(transit, enter, nextAnim);
+ }
+ }
+
+ public void setSize() {
+ ((Launcher) getActivity()).setDynamicGridSize(mCurrentSize);
+ }
+
+ private void setSelected(View v) {
+ v.setBackgroundColor(Color.WHITE);
+ TextView t = (TextView) v.findViewById(R.id.item_name);
+ t.setTextColor(getResources().getColor(R.color.settings_bg_color));
+ }
+
+ private void setCleared(View v) {
+ v.setBackgroundColor(getResources().getColor(R.color.settings_bg_color));
+ TextView t = (TextView) v.findViewById(R.id.item_name);
+ t.setTextColor(Color.WHITE);
+ }
+
+ private void showNumberPicker() {
+ mDialog = new Dialog(getActivity());
+ mDialog.setTitle(getResources().getString(R.string.preferences_interface_homescreen_custom));
+ mDialog.setContentView(R.layout.custom_grid_size_dialog);
+
+ NumberPicker nPRows= (NumberPicker) mDialog.findViewById(R.id.custom_rows);
+ NumberPicker nPColumns = (NumberPicker) mDialog.findViewById(R.id.custom_columns);
+
+ LauncherAppState app = LauncherAppState.getInstance();
+ DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
+
+ int rows = grid.numRowsBase;
+ int columns = grid.numColumnsBase;
+ if (mCustomGridColumns == 0) {
+ mCustomGridColumns = (int) grid.numColumns;
+ }
+ if (mCustomGridRows == 0) {
+ mCustomGridRows = (int) grid.numRows;
+ }
+
+ nPRows.setMinValue(Math.max(MIN_DYNAMIC_GRID_ROWS, rows - DeviceProfile.GRID_SIZE_MIN));
+ nPRows.setMaxValue(rows + DeviceProfile.GRID_SIZE_MAX);
+ nPRows.setValue(mCustomGridRows);
+ nPRows.setWrapSelectorWheel(false);
+ nPRows.setOnValueChangedListener(this);
+ nPRows.setDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS);
+
+ nPColumns.setMinValue(Math.max(MIN_DYNAMIC_GRID_COLUMNS, columns - DeviceProfile.GRID_SIZE_MIN));
+ nPColumns.setMaxValue(columns + DeviceProfile.GRID_SIZE_MAX);
+ nPColumns.setValue(mCustomGridColumns);
+ nPColumns.setWrapSelectorWheel(false);
+ nPColumns.setOnValueChangedListener(this);
+ nPColumns.setDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS);
+
+ Button b = (Button) mDialog.findViewById(R.id.dialog_confirm_button);
+ b.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (mDialog != null) {
+ mDialog.dismiss();
+ }
+ }
+ });
+ mDialog.setOnDismissListener(this);
+ mDialog.show();
+ }
+
+ @Override
+ public void onPause() {
+ super.onPause();
+ if (mDialog != null) {
+ mDialog.dismiss();
+ }
+ }
+
+ @Override
+ public void onValueChange(NumberPicker picker, int oldVal, int newVal) {
+ if (picker.getId() == R.id.custom_rows) {
+ mCustomGridRows = newVal;
+ } else if (picker.getId() == R.id.custom_columns) {
+ mCustomGridColumns = newVal;
+ }
+ }
+
+ @Override
+ public void onDismiss(DialogInterface dialog) {
+ SettingsProvider.putInt(getActivity(),
+ SettingsProvider.SETTINGS_UI_HOMESCREEN_ROWS, mCustomGridRows);
+ SettingsProvider.putInt(getActivity(),
+ SettingsProvider.SETTINGS_UI_HOMESCREEN_COLUMNS, mCustomGridColumns);
+
+ mAdapter.notifyDataSetInvalidated();
+
+ setCurrentImage();
+ }
+
+ private class GridSizeArrayAdapter extends ArrayAdapter<String> {
+ Context mContext;
+ String[] mTitles;
+
+ public GridSizeArrayAdapter(Context context, int textViewResourceId,
+ String[] objects) {
+ super(context, textViewResourceId, objects);
+
+ mContext = context;
+ mTitles = objects;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ LayoutInflater inflater = (LayoutInflater) mContext
+ .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ convertView = inflater.inflate(R.layout.settings_pane_list_item,
+ parent, false);
+ TextView textView = (TextView) convertView
+ .findViewById(R.id.item_name);
+ textView.setText(mTitles[position]);
+ // Set Selected State
+ if (position == mCurrentSize.getValue()) {
+ mCurrentSelection = convertView;
+ setSelected(mCurrentSelection);
+ }
+
+ if (position == DeviceProfile.GridSize.Custom.getValue()) {
+ LauncherAppState app = LauncherAppState.getInstance();
+ DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
+
+ String state = mTitles[position];
+ int rows = SettingsProvider.getIntCustomDefault(getActivity(),
+ SettingsProvider.SETTINGS_UI_HOMESCREEN_ROWS, grid.numRowsBase);
+ int columns = SettingsProvider.getIntCustomDefault(getActivity(),
+ SettingsProvider.SETTINGS_UI_HOMESCREEN_COLUMNS, grid.numColumnsBase);
+ state += "(" + rows + "x" + columns + ")";
+
+ textView.setText(state);
+ }
+
+ convertView.setOnClickListener(mSettingsItemListener);
+ convertView.setTag(position);
+ return convertView;
+ }
+ }
+} \ No newline at end of file
diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java
index fa34e63..6e6bb5d 100644
--- a/src/com/android/launcher3/Folder.java
+++ b/src/com/android/launcher3/Folder.java
@@ -54,6 +54,7 @@ import android.widget.ScrollView;
import android.widget.TextView;
import com.android.launcher3.FolderInfo.FolderListener;
+import com.android.launcher3.settings.SettingsProvider;
import java.util.ArrayList;
import java.util.Collections;
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index c4311bc..3cf032e 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -274,6 +274,7 @@ public class Launcher extends Activity
private DragController mDragController;
private View mWeightWatcher;
private TransitionEffectsFragment mTransitionEffectsFragment;
+ private DynamicGridSizeFragment mDynamicGridSizeFragment;
private LauncherClings mLauncherClings;
protected HiddenFolderFragment mHiddenFolderFragment;
@@ -1144,6 +1145,12 @@ public class Launcher extends Activity
if (f != null) {
mTransitionEffectsFragment.setEffect();
}
+ f = getFragmentManager().findFragmentByTag(
+ DynamicGridSizeFragment.DYNAMIC_GRID_SIZE_FRAGMENT);
+ if (f != null) {
+ mDynamicGridSizeFragment.setSize();
+ mWorkspace.hideOutlines();
+ }
Fragment f1 = getFragmentManager().findFragmentByTag(
HiddenFolderFragment.HIDDEN_FOLDER_FRAGMENT);
if (f1 != null && !mHiddenFolderAuth) {
@@ -1250,6 +1257,38 @@ public class Launcher extends Activity
popupMenu.show();
}
+ public void onClickDynamicGridSizeButton() {
+ FragmentManager fragmentManager = getFragmentManager();
+ FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
+
+ mDynamicGridSizeFragment = new DynamicGridSizeFragment();
+ fragmentTransaction.replace(R.id.launcher, mDynamicGridSizeFragment,
+ DynamicGridSizeFragment.DYNAMIC_GRID_SIZE_FRAGMENT);
+ fragmentTransaction.commit();
+ }
+
+ public void setDynamicGridSize(DeviceProfile.GridSize size) {
+ SettingsProvider.putInt(this,
+ SettingsProvider.SETTINGS_UI_DYNAMIC_GRID_SIZE, size.getValue());
+
+ updateDynamicGrid();
+
+ mOverviewSettingsPanel.notifyDataSetInvalidated();
+
+ FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
+ fragmentTransaction
+ .setCustomAnimations(0, R.anim.exit_out_right);
+ fragmentTransaction
+ .remove(mDynamicGridSizeFragment).commit();
+
+ mDarkPanel.setVisibility(View.VISIBLE);
+ ObjectAnimator anim = ObjectAnimator.ofFloat(
+ mDarkPanel, "alpha", 0.3f, 0.0f);
+ anim.start();
+ anim.addListener(mAnimatorListener);
+
+ }
+
public void onClickTransitionEffectButton(View v, final boolean pageOrDrawer) {
Bundle bundle = new Bundle();
bundle.putBoolean(TransitionEffectsFragment.PAGE_OR_DRAWER_SCROLL_SELECT,
@@ -1257,7 +1296,6 @@ public class Launcher extends Activity
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
-
mTransitionEffectsFragment = new TransitionEffectsFragment();
mTransitionEffectsFragment.setArguments(bundle);
fragmentTransaction.setCustomAnimations(0, 0);
@@ -1279,11 +1317,6 @@ public class Launcher extends Activity
newTransitionEffect).commit();
TransitionEffect.setFromString(pagedView, newTransitionEffect);
- // Reset Settings Changed
- SharedPreferences.Editor editor = mSharedPrefs.edit();
- editor.putBoolean(SettingsProvider.SETTINGS_CHANGED, false);
- editor.commit();
-
mOverviewSettingsPanel.notifyDataSetInvalidated();
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
@@ -2623,8 +2656,12 @@ public class Launcher extends Activity
} else if (mWorkspace.isInOverviewMode()) {
Fragment f = getFragmentManager().findFragmentByTag(
TransitionEffectsFragment.TRANSITION_EFFECTS_FRAGMENT);
+ Fragment f2 = getFragmentManager().findFragmentByTag(
+ DynamicGridSizeFragment.DYNAMIC_GRID_SIZE_FRAGMENT);
if (f != null) {
mTransitionEffectsFragment.setEffect();
+ } else if (f2 != null) {
+ mDynamicGridSizeFragment.setSize();
} else {
mWorkspace.exitOverviewMode(true);
}
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index 80a488b..79e7cbf 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -60,6 +60,8 @@ import com.android.launcher3.compat.PackageInstallerCompat.PackageInstallInfo;
import com.android.launcher3.compat.UserHandleCompat;
import com.android.launcher3.compat.UserManagerCompat;
+import com.android.launcher3.settings.SettingsProvider;
+
import java.lang.ref.WeakReference;
import java.net.URISyntaxException;
import java.security.InvalidParameterException;
diff --git a/src/com/android/launcher3/OverviewSettingsPanel.java b/src/com/android/launcher3/OverviewSettingsPanel.java
index 9fe1d7e..f943083 100644
--- a/src/com/android/launcher3/OverviewSettingsPanel.java
+++ b/src/com/android/launcher3/OverviewSettingsPanel.java
@@ -39,42 +39,36 @@ public class OverviewSettingsPanel {
Resources res = mLauncher.getResources();
String[] headers = new String[] {
res.getString(R.string.home_screen_settings),
- res.getString(R.string.drawer_settings)};
+ res.getString(R.string.drawer_settings),
+ res.getString(R.string.app_settings)};
- String[] values;
- if(mLauncher.isGelIntegrationSupported()) {
- values = new String[]{
+ String[] values = new String[]{
res.getString(R.string.home_screen_search_text),
- res.getString(R.string.search_screen_left_text),
res.getString(R.string.scroll_effect_text),
- res.getString(R.string.larger_icons_text),
- res.getString(R.string.icon_labels),
- res.getString(R.string.scrolling_wallpaper)};
- } else {
- values = new String[]{
- res.getString(R.string.home_screen_search_text),
- res.getString(R.string.scroll_effect_text),
- res.getString(R.string.larger_icons_text),
res.getString(R.string.icon_labels),
- res.getString(R.string.scrolling_wallpaper)};
- }
-
- mValues = values;
+ res.getString(R.string.scrolling_wallpaper),
+ res.getString(R.string.grid_size_text)};
String[] valuesDrawer = new String[] {
res.getString(R.string.scroll_effect_text),
res.getString(R.string.drawer_sorting_text),
- res.getString(R.string.icon_labels),
+ res.getString(R.string.icon_labels)};
+
+ String[] valuesApp = new String[] {
+ res.getString(R.string.larger_icons_text),
res.getString(R.string.protected_app_settings)};
+
mSettingsAdapter = new SettingsPinnedHeaderAdapter(mLauncher);
mSettingsAdapter.setHeaders(headers);
mSettingsAdapter.addPartition(false, true);
mSettingsAdapter.addPartition(false, true);
+ mSettingsAdapter.addPartition(false, true);
mSettingsAdapter.mPinnedHeaderCount = headers.length;
mSettingsAdapter.changeCursor(0, createCursor(headers[0], values));
mSettingsAdapter.changeCursor(1, createCursor(headers[1], valuesDrawer));
+ mSettingsAdapter.changeCursor(2, createCursor(headers[2], valuesApp));
mListView.setAdapter(mSettingsAdapter);
}
@@ -173,7 +167,7 @@ public class OverviewSettingsPanel {
res.getString(R.string.home_screen_search_text),
res.getString(R.string.scroll_effect_text),
res.getString(R.string.larger_icons_text),
- res.getString(R.string.hide_icon_labels)};
+ res.getString(R.string.icon_labels)};
mSettingsAdapter.changeCursor(0, createCursor(res
.getString(R.string.home_screen_settings), values));
}
diff --git a/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java b/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java
index fe0567b..202df17 100644
--- a/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java
+++ b/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java
@@ -10,6 +10,8 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
+import android.widget.Toast;
+import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.OverviewSettingsPanel;
import com.android.launcher3.AppsCustomizePagedView;
@@ -120,17 +122,6 @@ public class SettingsPinnedHeaderAdapter extends PinnedHeaderListAdapter {
R.string.icon_labels_hide) : res.getString(
R.string.icon_labels_show);
((TextView) v.findViewById(R.id.item_state)).setText(state);
- } else if (title.equals(res
- .getString(R.string.search_screen_left_text))) {
- boolean current = SettingsProvider
- .getBoolean(
- mContext,
- SettingsProvider.SETTINGS_UI_HOMESCREEN_SEARCH_SCREEN_LEFT,
- R.bool.preferences_interface_homescreen_search_screen_left_default);
- String state = current ? res.getString(
- R.string.setting_state_on) : res.getString(
- R.string.setting_state_off);
- ((TextView) v.findViewById(R.id.item_state)).setText(state);
} else if (title.equals(res.getString(R.string.scrolling_wallpaper))) {
boolean current = SettingsProvider
.getBoolean(
@@ -141,6 +132,8 @@ public class SettingsPinnedHeaderAdapter extends PinnedHeaderListAdapter {
R.string.setting_state_on) : res.getString(
R.string.setting_state_off);
((TextView) v.findViewById(R.id.item_state)).setText(state);
+ } else if (title.equals(res.getString(R.string.grid_size_text))) {
+ updateDynamicGridSizeSettingsItem(v);
} else {
((TextView) v.findViewById(R.id.item_state)).setText("");
}
@@ -182,6 +175,34 @@ public class SettingsPinnedHeaderAdapter extends PinnedHeaderListAdapter {
((TextView) v.findViewById(R.id.item_state)).setText(state);
}
+ public void updateDynamicGridSizeSettingsItem(View v) {
+ DeviceProfile.GridSize gridSize = DeviceProfile.GridSize.getModeForValue(
+ SettingsProvider.getIntCustomDefault(mLauncher,
+ SettingsProvider.SETTINGS_UI_DYNAMIC_GRID_SIZE, 0));
+ String state = "";
+
+ switch (gridSize) {
+ case Comfortable:
+ state = mLauncher.getResources().getString(R.string.grid_size_comfortable);
+ break;
+ case Cozy:
+ state = mLauncher.getResources().getString(R.string.grid_size_cozy);
+ break;
+ case Condensed:
+ state = mLauncher.getResources().getString(R.string.grid_size_condensed);
+ break;
+ case Custom:
+ state = mLauncher.getResources().getString(R.string.grid_size_custom);
+ int rows = SettingsProvider.getIntCustomDefault(mLauncher,
+ SettingsProvider.SETTINGS_UI_HOMESCREEN_ROWS, 0);
+ int columns = SettingsProvider.getIntCustomDefault(mLauncher,
+ SettingsProvider.SETTINGS_UI_HOMESCREEN_COLUMNS, 0);
+ state += "(" + rows + "x" + columns + ")";
+ break;
+ }
+ ((TextView) v.findViewById(R.id.item_state)).setText(state);
+ }
+
private String mapEffectToValue(String effect) {
final String[] titles = mLauncher.getResources().getStringArray(
R.array.transition_effect_entries);
@@ -252,6 +273,8 @@ public class SettingsPinnedHeaderAdapter extends PinnedHeaderListAdapter {
intent.setClassName(OverviewSettingsPanel.ANDROID_SETTINGS,
OverviewSettingsPanel.ANDROID_PROTECTED_APPS);
mLauncher.startActivity(intent);
+ } else if (value.equals(res.getString(R.string.protected_app_settings))) {
+
} else if (value.equals(res
.getString(R.string.scrolling_wallpaper))) {
onSettingsBooleanChanged(
@@ -260,25 +283,8 @@ public class SettingsPinnedHeaderAdapter extends PinnedHeaderListAdapter {
R.bool.preferences_interface_homescreen_scrolling_wallpaper_scroll_default);
mLauncher.updateDynamicGrid();
} else if (value.equals(res
- .getString(R.string.search_screen_left_text)) &&
- ((Integer)v.getTag() == OverviewSettingsPanel.HOME_SETTINGS_POSITION)) {
-
- boolean current = SettingsProvider.getBoolean(mContext,
- SettingsProvider.SETTINGS_UI_HOMESCREEN_SEARCH_SCREEN_LEFT,
- R.bool.preferences_interface_homescreen_search_screen_left_default);
-
- // If GEL integration is not supported, do not allow the user to turn it on.
- if(!current && !mLauncher.isGelIntegrationSupported()) {
- Toast.makeText(mLauncher.getApplicationContext(),
- res.getString(R.string.search_screen_left_unsupported_toast),
- Toast.LENGTH_SHORT).show();
- } else {
- onSettingsBooleanChanged(
- v,
- SettingsProvider.SETTINGS_UI_HOMESCREEN_SEARCH_SCREEN_LEFT,
- R.bool.preferences_interface_homescreen_search_screen_left_default);
- mLauncher.updateDynamicGrid();
- }
+ .getString(R.string.grid_size_text))) {
+ mLauncher.onClickDynamicGridSizeButton();
}
View defaultHome = mLauncher.findViewById(R.id.default_home_screen_panel);