Loading AndroidManifest.xml +5 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,11 @@ </intent-filter> </receiver> <service android:name=".dynamicui.ColorExtractionService" android:exported="false" android:process=":wallpaper_chooser"> </service> <!-- The settings provider contains Home's data, like the workspace favorites --> <provider android:name="com.android.launcher3.LauncherProvider" Loading build.gradle +2 −0 Original line number Diff line number Diff line Loading @@ -52,12 +52,14 @@ repositories { dependencies { compile 'com.android.support:support-v4:23.1.1' compile 'com.android.support:recyclerview-v7:23.1.1' compile 'com.android.support:palette-v7:23.2.0' compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-2' compile project(":WallpaperPicker-Lib") testCompile 'junit:junit:4.12' androidTestCompile 'com.android.support.test:runner:0.5' androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2' androidTestCompile 'com.android.support:support-annotations:23.2.0' } protobuf { Loading src/com/android/launcher3/Launcher.java +17 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,7 @@ import com.android.launcher3.config.ProviderConfig; import com.android.launcher3.dragndrop.DragController; import com.android.launcher3.dragndrop.DragLayer; import com.android.launcher3.dragndrop.DragView; import com.android.launcher3.dynamicui.ExtractedColors; import com.android.launcher3.folder.Folder; import com.android.launcher3.folder.FolderIcon; import com.android.launcher3.logging.LoggerUtils; Loading Loading @@ -279,6 +280,7 @@ public class Launcher extends Activity private LauncherModel mModel; private IconCache mIconCache; private ExtractedColors mExtractedColors; @Thunk boolean mUserPresent = true; private boolean mVisible = false; private boolean mHasFocus = false; Loading Loading @@ -447,6 +449,8 @@ public class Launcher extends Activity app.getInvariantDeviceProfile().portraitProfile.setSearchBarHeight(getSearchBarHeight()); setupViews(); mDeviceProfile.layout(this); mExtractedColors = new ExtractedColors(); loadExtractedColorsAndColorItems(); lockAllApps(); Loading Loading @@ -509,6 +513,19 @@ public class Launcher extends Activity } } @Override public void onExtractedColorsChanged() { loadExtractedColorsAndColorItems(); } private void loadExtractedColorsAndColorItems() { if (mExtractedColors != null) { mExtractedColors.load(this); // TODO: pass mExtractedColors to interested items such as hotseat. mHotseat.setBackgroundColor(mExtractedColors.getColor(ExtractedColors.VIBRANT_INDEX)); } } private LauncherCallbacks mLauncherCallbacks; public void onPostCreate(Bundle savedInstanceState) { Loading src/com/android/launcher3/LauncherAppState.java +8 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import com.android.launcher3.compat.LauncherAppsCompat; import com.android.launcher3.compat.PackageInstallerCompat; import com.android.launcher3.compat.UserManagerCompat; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.dynamicui.ExtractionUtils; import com.android.launcher3.util.ConfigMonitor; import com.android.launcher3.util.TestingUtils; import com.android.launcher3.util.Thunk; Loading Loading @@ -108,6 +109,11 @@ public class LauncherAppState { filter.addAction(LauncherAppsCompat.ACTION_MANAGED_PROFILE_ADDED); filter.addAction(LauncherAppsCompat.ACTION_MANAGED_PROFILE_REMOVED); filter.addAction(LauncherAppsCompat.ACTION_MANAGED_PROFILE_AVAILABILITY_CHANGED); // For extracting colors from the wallpaper if (Utilities.isNycOrAbove()) { // TODO: add a broadcast entry to the manifest for pre-N. filter.addAction(Intent.ACTION_WALLPAPER_CHANGED); } sContext.registerReceiver(mModel, filter); UserManagerCompat.getInstance(sContext).enableAndResetCache(); Loading @@ -121,6 +127,8 @@ public class LauncherAppState { }, new IntentFilter(Intent.ACTION_WALLPAPER_CHANGED)); } new ConfigMonitor(sContext).register(); ExtractionUtils.startColorExtractionServiceIfNecessary(sContext); } /** Loading src/com/android/launcher3/LauncherModel.java +3 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ import com.android.launcher3.compat.PackageInstallerCompat.PackageInstallInfo; import com.android.launcher3.compat.UserHandleCompat; import com.android.launcher3.compat.UserManagerCompat; import com.android.launcher3.config.ProviderConfig; import com.android.launcher3.dynamicui.ExtractionUtils; import com.android.launcher3.folder.Folder; import com.android.launcher3.folder.FolderIcon; import com.android.launcher3.model.GridSizeMigrationTask; Loading Loading @@ -1237,6 +1238,8 @@ public class LauncherModel extends BroadcastReceiver PackageUpdatedTask.OP_USER_AVAILABILITY_CHANGE, new String[0], user)); } } else if (Intent.ACTION_WALLPAPER_CHANGED.equals(action)) { ExtractionUtils.startColorExtractionServiceIfNecessary(context); } } Loading Loading
AndroidManifest.xml +5 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,11 @@ </intent-filter> </receiver> <service android:name=".dynamicui.ColorExtractionService" android:exported="false" android:process=":wallpaper_chooser"> </service> <!-- The settings provider contains Home's data, like the workspace favorites --> <provider android:name="com.android.launcher3.LauncherProvider" Loading
build.gradle +2 −0 Original line number Diff line number Diff line Loading @@ -52,12 +52,14 @@ repositories { dependencies { compile 'com.android.support:support-v4:23.1.1' compile 'com.android.support:recyclerview-v7:23.1.1' compile 'com.android.support:palette-v7:23.2.0' compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-2' compile project(":WallpaperPicker-Lib") testCompile 'junit:junit:4.12' androidTestCompile 'com.android.support.test:runner:0.5' androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2' androidTestCompile 'com.android.support:support-annotations:23.2.0' } protobuf { Loading
src/com/android/launcher3/Launcher.java +17 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,7 @@ import com.android.launcher3.config.ProviderConfig; import com.android.launcher3.dragndrop.DragController; import com.android.launcher3.dragndrop.DragLayer; import com.android.launcher3.dragndrop.DragView; import com.android.launcher3.dynamicui.ExtractedColors; import com.android.launcher3.folder.Folder; import com.android.launcher3.folder.FolderIcon; import com.android.launcher3.logging.LoggerUtils; Loading Loading @@ -279,6 +280,7 @@ public class Launcher extends Activity private LauncherModel mModel; private IconCache mIconCache; private ExtractedColors mExtractedColors; @Thunk boolean mUserPresent = true; private boolean mVisible = false; private boolean mHasFocus = false; Loading Loading @@ -447,6 +449,8 @@ public class Launcher extends Activity app.getInvariantDeviceProfile().portraitProfile.setSearchBarHeight(getSearchBarHeight()); setupViews(); mDeviceProfile.layout(this); mExtractedColors = new ExtractedColors(); loadExtractedColorsAndColorItems(); lockAllApps(); Loading Loading @@ -509,6 +513,19 @@ public class Launcher extends Activity } } @Override public void onExtractedColorsChanged() { loadExtractedColorsAndColorItems(); } private void loadExtractedColorsAndColorItems() { if (mExtractedColors != null) { mExtractedColors.load(this); // TODO: pass mExtractedColors to interested items such as hotseat. mHotseat.setBackgroundColor(mExtractedColors.getColor(ExtractedColors.VIBRANT_INDEX)); } } private LauncherCallbacks mLauncherCallbacks; public void onPostCreate(Bundle savedInstanceState) { Loading
src/com/android/launcher3/LauncherAppState.java +8 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import com.android.launcher3.compat.LauncherAppsCompat; import com.android.launcher3.compat.PackageInstallerCompat; import com.android.launcher3.compat.UserManagerCompat; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.dynamicui.ExtractionUtils; import com.android.launcher3.util.ConfigMonitor; import com.android.launcher3.util.TestingUtils; import com.android.launcher3.util.Thunk; Loading Loading @@ -108,6 +109,11 @@ public class LauncherAppState { filter.addAction(LauncherAppsCompat.ACTION_MANAGED_PROFILE_ADDED); filter.addAction(LauncherAppsCompat.ACTION_MANAGED_PROFILE_REMOVED); filter.addAction(LauncherAppsCompat.ACTION_MANAGED_PROFILE_AVAILABILITY_CHANGED); // For extracting colors from the wallpaper if (Utilities.isNycOrAbove()) { // TODO: add a broadcast entry to the manifest for pre-N. filter.addAction(Intent.ACTION_WALLPAPER_CHANGED); } sContext.registerReceiver(mModel, filter); UserManagerCompat.getInstance(sContext).enableAndResetCache(); Loading @@ -121,6 +127,8 @@ public class LauncherAppState { }, new IntentFilter(Intent.ACTION_WALLPAPER_CHANGED)); } new ConfigMonitor(sContext).register(); ExtractionUtils.startColorExtractionServiceIfNecessary(sContext); } /** Loading
src/com/android/launcher3/LauncherModel.java +3 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ import com.android.launcher3.compat.PackageInstallerCompat.PackageInstallInfo; import com.android.launcher3.compat.UserHandleCompat; import com.android.launcher3.compat.UserManagerCompat; import com.android.launcher3.config.ProviderConfig; import com.android.launcher3.dynamicui.ExtractionUtils; import com.android.launcher3.folder.Folder; import com.android.launcher3.folder.FolderIcon; import com.android.launcher3.model.GridSizeMigrationTask; Loading Loading @@ -1237,6 +1238,8 @@ public class LauncherModel extends BroadcastReceiver PackageUpdatedTask.OP_USER_AVAILABILITY_CHANGE, new String[0], user)); } } else if (Intent.ACTION_WALLPAPER_CHANGED.equals(action)) { ExtractionUtils.startColorExtractionServiceIfNecessary(context); } } Loading