diff options
author | Raj Yengisetty <rajesh@cyngn.com> | 2015-07-24 19:56:24 -0700 |
---|---|---|
committer | Raj Yengisetty <rajesh@cyngn.com> | 2015-07-24 19:56:24 -0700 |
commit | f6055034dcc1b31397c86382585bd8e491d95411 (patch) | |
tree | f5a04c03990d956b2a08ce194745ae45ae37a465 | |
parent | 9eb650596ed6341d01f4c41d2f96f8e8783fa283 (diff) | |
download | android_packages_apps_Trebuchet-f6055034dcc1b31397c86382585bd8e491d95411.tar.gz android_packages_apps_Trebuchet-f6055034dcc1b31397c86382585bd8e491d95411.tar.bz2 android_packages_apps_Trebuchet-f6055034dcc1b31397c86382585bd8e491d95411.zip |
Clean up some cmhome
Change-Id: If4830bf33042ac1ef9b083ecd0a9dca75e2789f5
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 34 | ||||
-rw-r--r-- | src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java | 23 | ||||
-rw-r--r-- | src/org/cyanogenmod/trebuchet/CustomHomeLauncher.java | 15 |
3 files changed, 31 insertions, 41 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 0094a2b85..d996db9c8 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -647,8 +647,6 @@ public class Launcher extends Activity restoreCustomContentMode(); - restoreGelSetting(); - // Determine the dynamic grid properties Point smallestSize = new Point(); Point largestSize = new Point(); @@ -672,7 +670,6 @@ public class Launcher extends Activity protected void onUserLeaveHint() { super.onUserLeaveHint(); - sPausedFromUserAction = true; } /** To be overridden by subclasses to hint to Launcher that we have custom content */ @@ -701,10 +698,6 @@ public class Launcher extends Activity return false; } - protected boolean hasCustomContentToLeft() { - return isGelIntegrationSupported() && isGelIntegrationEnabled(); - } - public boolean isGelIntegrationSupported() { final SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); @@ -721,20 +714,11 @@ public class Launcher extends Activity public void onCustomContentLaunch() { if(isGelIntegrationEnabled() && isGelIntegrationSupported()) { - GelIntegrationHelper.getInstance().registerSwipeBackGestureListenerAndStartGel(this); + GelIntegrationHelper.getInstance().registerSwipeBackGestureListenerAndStartGel(this, + mWorkspace.isLayoutRtl()); } } - public boolean isGelIntegrationSupported() { - final SearchManager searchManager = - (SearchManager) getSystemService(Context.SEARCH_SERVICE); - ComponentName globalSearchActivity = searchManager.getGlobalSearchActivity(); - - // Currently the only custom content available is the GEL launcher integration, - // only supported on CyanogenMod. - return globalSearchActivity != null && isCM(); - } - public CustomContentMode getCustomContentMode() { return mCustomContentMode; } @@ -743,20 +727,6 @@ public class Launcher extends Activity mCustomContentMode = customContentMode; } - public void onCustomContentLaunch() { - if(isCustomContentModeGel() && isGelIntegrationSupported()) { - GelIntegrationHelper.getInstance().registerSwipeBackGestureListenerAndStartGel(this, mWorkspace.isLayoutRtl()); - } - } - - /** - * Check if the device running this application is running CyanogenMod. - * @return true if this device is running CM. - */ - protected boolean isCM() { - return getPackageManager().hasSystemFeature("com.cyanogenmod.android"); - } - /** * Check if the device running this application is running CyanogenMod. * @return true if this device is running CM. diff --git a/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java b/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java index 2dbc2aeed..1dd8c20be 100644 --- a/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java +++ b/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java @@ -110,17 +110,20 @@ public class SettingsPinnedHeaderAdapter extends PinnedHeaderListAdapter { ((TextView) v.findViewById(R.id.item_state)).setText(state); break; case 1: + updateSearchPanelItem(v); + break; + case 2: state = mLauncher.getWorkspaceTransitionEffect(); state = mapEffectToValue(state); ((TextView) v.findViewById(R.id.item_state)).setText(state); break; - case 2: + case 3: current = mLauncher.shouldHideWorkspaceIconLables(); state = current ? res.getString(R.string.icon_labels_hide) : res.getString(R.string.icon_labels_show); ((TextView) v.findViewById(R.id.item_state)).setText(state); break; - case 3: + case 4: current = SettingsProvider.getBoolean(mContext, SettingsProvider.SETTINGS_UI_HOMESCREEN_SCROLLING_WALLPAPER_SCROLL, R.bool.preferences_interface_homescreen_scrolling_wallpaper_scroll_default); @@ -128,7 +131,7 @@ public class SettingsPinnedHeaderAdapter extends PinnedHeaderListAdapter { : res.getString(R.string.setting_state_off); ((TextView) v.findViewById(R.id.item_state)).setText(state); break; - case 4: + case 5: updateDynamicGridSizeSettingsItem(v); break; default: @@ -308,21 +311,29 @@ public class SettingsPinnedHeaderAdapter extends PinnedHeaderListAdapter { mLauncher.setUpdateDynamicGrid(false); break; case 1: - mLauncher.onClickTransitionEffectButton(v, false); + onClickSearchPanelButton(); + boolean customContentEnabled = mLauncher.getCustomContentMode() + != Launcher.CustomContentMode.DISABLED; + mLauncher.getWorkspace().updatePageScrollForCustomPage( + customContentEnabled); + mLauncher.setUpdateDynamicGrid(false); break; case 2: + mLauncher.onClickTransitionEffectButton(v, false); + break; + case 3: onIconLabelsBooleanChanged(v, SettingsProvider.SETTINGS_UI_HOMESCREEN_HIDE_ICON_LABELS, R.bool.preferences_interface_homescreen_hide_icon_labels_default); mLauncher.setUpdateDynamicGrid(false); break; - case 3: + case 4: onSettingsBooleanChanged(v, SettingsProvider.SETTINGS_UI_HOMESCREEN_SCROLLING_WALLPAPER_SCROLL, R.bool.preferences_interface_homescreen_scrolling_wallpaper_scroll_default); mLauncher.setUpdateDynamicGrid(false); break; - case 4: + case 5: mLauncher.onClickDynamicGridSizeButton(); break; diff --git a/src/org/cyanogenmod/trebuchet/CustomHomeLauncher.java b/src/org/cyanogenmod/trebuchet/CustomHomeLauncher.java index 47c9c3b2c..7b9cff651 100644 --- a/src/org/cyanogenmod/trebuchet/CustomHomeLauncher.java +++ b/src/org/cyanogenmod/trebuchet/CustomHomeLauncher.java @@ -118,13 +118,18 @@ public class CustomHomeLauncher extends Launcher { private CustomContentCallbacks mCustomContentCallbacks = new CustomContentCallbacks() { @Override - public void onShow() { + public void onShow(boolean fromResume) { if (mCurrentHomeApp != null) { mCurrentHomeApp.mInstance.onShow(); } } @Override + public boolean isScrollingAllowed() { + return true; + } + + @Override public void onScrollProgressChanged(float progress) { updateQsbBarColorState(progress); if (mCurrentHomeApp != null) { @@ -236,8 +241,10 @@ public class CustomHomeLauncher extends Launcher { } @Override - public void updateDynamicGrid() { - super.updateDynamicGrid(); + public boolean updateGridIfNeeded() { + if (!super.updateGridIfNeeded()) { + return false; + } if (isCustomContentModeGel() && mCurrentHomeApp != null) { mCurrentHomeApp.mInstance.setShowContent(false); @@ -245,6 +252,8 @@ public class CustomHomeLauncher extends Launcher { && mCurrentHomeApp != null) { mCurrentHomeApp.mInstance.setShowContent(true); } + + return true; } private synchronized void obtainCurrentHomeAppStubLocked(boolean invalidate) { |