diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2017-05-09 12:40:11 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2017-05-09 12:41:50 -0700 |
commit | 60820d796f5789ac0d1d478f1d3c8e403fd0a56f (patch) | |
tree | c814235577092af480a383e82c09d43035642ff1 /src/com/android/launcher3/allapps | |
parent | 161f96bc77805ed87f831b68e51fad61a23153bc (diff) | |
download | android_packages_apps_Trebuchet-60820d796f5789ac0d1d478f1d3c8e403fd0a56f.tar.gz android_packages_apps_Trebuchet-60820d796f5789ac0d1d478f1d3c8e403fd0a56f.tar.bz2 android_packages_apps_Trebuchet-60820d796f5789ac0d1d478f1d3c8e403fd0a56f.zip |
Adding listener support for color extraction changes
Changing the apps-search layout to use theme attribute instead of hard
coded layout id
Bug: 37616877
Change-Id: Iae601758303f83a2774635f0d88f74d99fc643c3
Diffstat (limited to 'src/com/android/launcher3/allapps')
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsTransitionController.java | 4 | ||||
-rw-r--r-- | src/com/android/launcher3/allapps/AlphabeticalAppsList.java | 12 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java index 121ce4ce1..9c1854a36 100644 --- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java +++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java @@ -42,7 +42,7 @@ import com.android.launcher3.util.TouchController; * closer to top or closer to the page indicator. */ public class AllAppsTransitionController implements TouchController, VerticalPullDetector.Listener, - View.OnLayoutChangeListener { + View.OnLayoutChangeListener, ExtractedColors.OnChangeListener { private static final String TAG = "AllAppsTrans"; private static final boolean DBG = false; @@ -107,6 +107,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul mEvaluator = new ArgbEvaluator(); mAllAppsBackgroundColor = Themes.getAttrColor(l, android.R.attr.colorPrimary); + mLauncher.getExtractedColors().addOnChangeListener(this); } @Override @@ -288,6 +289,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul mScrimView.setProgress(progress); } + @Override public void onExtractedColorsChanged() { if (FeatureFlags.LAUNCHER3_GRADIENT_ALL_APPS) { if (mGradientView != null) { diff --git a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java index f291a80ee..047441985 100644 --- a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java +++ b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java @@ -195,6 +195,8 @@ public class AlphabeticalAppsList { private int mNumPredictedAppsPerRow; private int mNumAppRowsInAdapter; + private boolean mHasSearchDivider = true; + public AlphabeticalAppsList(Context context) { mLauncher = Launcher.getLauncher(context); mIndexer = new AlphabeticIndexCompat(context); @@ -343,6 +345,10 @@ public class AlphabeticalAppsList { onAppsUpdated(); } + public void disableSearchDivider() { + mHasSearchDivider = false; + } + /** * Updates internals when the set of apps are updated. */ @@ -429,8 +435,10 @@ public class AlphabeticalAppsList { } } - // Add the search divider - mAdapterItems.add(AdapterItem.asSearchDivider(position++)); + if (mHasSearchDivider) { + // Add the search divider + mAdapterItems.add(AdapterItem.asSearchDivider(position++)); + } // Process the predicted app components mPredictedApps.clear(); |