From 60820d796f5789ac0d1d478f1d3c8e403fd0a56f Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Tue, 9 May 2017 12:40:11 -0700 Subject: 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 --- src/com/android/launcher3/Launcher.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/com/android/launcher3/Launcher.java') diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index c96c2a7b9..25995dd1a 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -212,6 +212,8 @@ public class Launcher extends BaseActivity private static int NEW_APPS_ANIMATION_INACTIVE_TIMEOUT_SECONDS = 5; @Thunk static int NEW_APPS_ANIMATION_DELAY = 500; + private final ExtractedColors mExtractedColors = new ExtractedColors(); + @Thunk Workspace mWorkspace; private View mLauncherView; @Thunk DragLayer mDragLayer; @@ -260,7 +262,6 @@ public class Launcher extends BaseActivity private LauncherModel mModel; private ModelWriter mModelWriter; private IconCache mIconCache; - private ExtractedColors mExtractedColors; private LauncherAccessibilityDelegate mAccessibilityDelegate; private Handler mHandler = new Handler(); private boolean mIsResumeFromActionScreenOff; @@ -392,11 +393,10 @@ public class Launcher extends BaseActivity // LauncherModel load. mPaused = false; - mLauncherView = getLayoutInflater().inflate(R.layout.launcher, null); + mLauncherView = LayoutInflater.from(this).inflate(R.layout.launcher, null); setupViews(); mDeviceProfile.layout(this, false /* notifyListeners */); - mExtractedColors = new ExtractedColors(); loadExtractedColorsAndColorItems(); mPopupDataProvider = new PopupDataProvider(this); @@ -465,12 +465,7 @@ public class Launcher extends BaseActivity @Override public void onExtractedColorsChanged() { loadExtractedColorsAndColorItems(); - if (mAllAppsController != null) { - mAllAppsController.onExtractedColorsChanged(); - } - if (mLauncherCallbacks != null) { - mLauncherCallbacks.onExtractedColorsChanged(); - } + mExtractedColors.notifyChange(); } public ExtractedColors getExtractedColors() { -- cgit v1.2.3