summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorArtem Shvadskiy <ashvadskiy@cyngn.com>2016-01-29 13:21:29 -0800
committerArtem Shvadskiy <ashvadskiy@cyngn.com>2016-01-29 15:07:46 -0800
commitb68836f388cb6ac06ba813f762899a2c900e2c3c (patch)
tree24687ac9796b31c034fa67ae69acfc8f6c45cbc6 /src
parent7df0227f6a835641a3d41327a65845806ef070fb (diff)
downloadandroid_packages_apps_Trebuchet-b68836f388cb6ac06ba813f762899a2c900e2c3c.zip
android_packages_apps_Trebuchet-b68836f388cb6ac06ba813f762899a2c900e2c3c.tar.gz
android_packages_apps_Trebuchet-b68836f388cb6ac06ba813f762899a2c900e2c3c.tar.bz2
Add additional setting to launcher options for remote apps in drawer.
issue-id: CYNGNOS-1717 Change-Id: Idaf217a78011a08188f438294a27277183bd1ada
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/Launcher.java6
-rw-r--r--src/com/android/launcher3/OverviewSettingsPanel.java11
-rw-r--r--src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java16
-rw-r--r--src/com/android/launcher3/settings/SettingsProvider.java1
-rw-r--r--src/com/android/launcher3/stats/internal/model/TrackingEvent.java1
5 files changed, 21 insertions, 14 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 3b31b3a..39a7041 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -266,7 +266,6 @@ public class Launcher extends Activity
private DynamicGridSizeFragment mDynamicGridSizeFragment;
private static RemoteFolderManager sRemoteFolderManager;
- private boolean mRemoteDrawerEnabled;
private AppWidgetManagerCompat mAppWidgetManager;
private LauncherAppWidgetHost mAppWidgetHost;
@@ -526,8 +525,6 @@ public class Launcher extends Activity
} else {
sRemoteFolderManager.onRecreateLauncher(this);
}
- mRemoteDrawerEnabled = SettingsProvider.getBoolean(this, null,
- R.bool.preferences_interface_homescreen_remote_folder_default);
// If we are getting an onCreate, we can actually preempt onResume and unset mPaused here,
// this also ensures that any synchronous binding below doesn't re-trigger another
@@ -3925,6 +3922,9 @@ public class Launcher extends Activity
* resumed.
*/
private void tryAndUpdatePredictedApps() {
+ boolean mRemoteDrawerEnabled = SettingsProvider.getBoolean(this,
+ SettingsProvider.SETTINGS_UI_DRAWER_REMOTE_APPS,
+ R.bool.preferences_interface_drawer_remote_apps_default);
if (!mRemoteDrawerEnabled) {
if (mLauncherCallbacks != null) {
List<ComponentKey> apps = mLauncherCallbacks.getPredictedApps();
diff --git a/src/com/android/launcher3/OverviewSettingsPanel.java b/src/com/android/launcher3/OverviewSettingsPanel.java
index 1b75602..133dc51 100644
--- a/src/com/android/launcher3/OverviewSettingsPanel.java
+++ b/src/com/android/launcher3/OverviewSettingsPanel.java
@@ -84,15 +84,8 @@ public class OverviewSettingsPanel {
res.getString(R.string.scrolling_wallpaper),
res.getString(R.string.grid_size_text)}));
- // Optionally add additional value based on setting
- boolean remoteAppsEnabled = SettingsProvider.getBoolean(mLauncher, null,
- R.bool.preferences_interface_homescreen_remote_folder_default);
- if (remoteAppsEnabled) {
- String remoteAppsName = RemoteFolderManager.getFeatureTitle(res);
- if (remoteAppsName != null) {
- values.add(remoteAppsName);
- }
- }
+ // Add additional external settings.
+ RemoteFolderManager.onInitializeSettingsAdapter(values, res);
String[] valuesArr = new String[values.size()];
values.toArray(valuesArr);
diff --git a/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java b/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java
index 765243d..b0c1bd1 100644
--- a/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java
+++ b/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java
@@ -129,6 +129,12 @@ public class SettingsPinnedHeaderAdapter extends PinnedHeaderListAdapter {
R.bool.preferences_interface_homescreen_remote_folder_default);
setSettingSwitch(stateView, settingSwitch, current);
break;
+ case 5:
+ current = SettingsProvider.getBoolean(mContext,
+ SettingsProvider.SETTINGS_UI_DRAWER_REMOTE_APPS,
+ R.bool.preferences_interface_drawer_remote_apps_default);
+ setSettingSwitch(stateView, settingSwitch, current);
+ break;
default:
hideStates(stateView, settingSwitch);
}
@@ -277,10 +283,16 @@ public class SettingsPinnedHeaderAdapter extends PinnedHeaderListAdapter {
mLauncher.onClickDynamicGridSizeButton();
break;
case 4:
- boolean newValue = onSettingsBooleanChanged(v,
+ onSettingsBooleanChanged(v,
SettingsProvider.SETTINGS_UI_HOMESCREEN_REMOTE_FOLDER,
R.bool.preferences_interface_homescreen_remote_folder_default);
- mLauncher.getRemoteFolderManager().onSettingChanged(newValue);
+ mLauncher.getRemoteFolderManager().onSettingChanged();
+ break;
+ case 5:
+ onSettingsBooleanChanged(v,
+ SettingsProvider.SETTINGS_UI_DRAWER_REMOTE_APPS,
+ R.bool.preferences_interface_drawer_remote_apps_default);
+ mLauncher.getRemoteFolderManager().onSettingChanged();
break;
}
break;
diff --git a/src/com/android/launcher3/settings/SettingsProvider.java b/src/com/android/launcher3/settings/SettingsProvider.java
index c96b8f5..d9cb593 100644
--- a/src/com/android/launcher3/settings/SettingsProvider.java
+++ b/src/com/android/launcher3/settings/SettingsProvider.java
@@ -28,6 +28,7 @@ public final class SettingsProvider {
public static final String SETTINGS_UI_HOMESCREEN_HIDE_ICON_LABELS = "ui_homescreen_general_hide_icon_labels";
public static final String SETTINGS_UI_HOMESCREEN_SCROLLING_WALLPAPER_SCROLL = "ui_homescreen_scrolling_wallpaper_scroll";
public static final String SETTINGS_UI_HOMESCREEN_REMOTE_FOLDER = "ui_homescreen_remote_folder";
+ public static final String SETTINGS_UI_DRAWER_REMOTE_APPS = "ui_drawer_remote_apps";
public static final String SETTINGS_UI_DYNAMIC_GRID_SIZE = "ui_dynamic_grid_size";
public static final String SETTINGS_UI_HOMESCREEN_ROWS = "ui_homescreen_rows";
public static final String SETTINGS_UI_HOMESCREEN_COLUMNS = "ui_homescreen_columns";
diff --git a/src/com/android/launcher3/stats/internal/model/TrackingEvent.java b/src/com/android/launcher3/stats/internal/model/TrackingEvent.java
index a44d3f1..3f148b4 100644
--- a/src/com/android/launcher3/stats/internal/model/TrackingEvent.java
+++ b/src/com/android/launcher3/stats/internal/model/TrackingEvent.java
@@ -54,6 +54,7 @@ public class TrackingEvent {
// Remote folder specific
REMOTE_FOLDER_DISABLED,
+ REMOTE_DRAWER_DISABLED,
REMOTE_FOLDER_OPENED,
REMOTE_FOLDER_INFO_OPENED,
REMOTE_APP_OPENED,