Loading go/src_flags/com/android/launcher3/config/FeatureFlags.java +2 −6 Original line number Diff line number Diff line Loading @@ -22,14 +22,10 @@ import android.content.Context; * Defines a set of flags used to control various launcher behaviors */ public final class FeatureFlags extends BaseFlags { private static FeatureFlags instance = new FeatureFlags(); public static FeatureFlags getInstance(Context context) { return instance; private FeatureFlags() { // Prevent instantiation } private FeatureFlags() {} // Features to control Launcher3Go behavior public static final boolean GO_DISABLE_WIDGETS = true; public static final boolean LAUNCHER3_SPRING_ICONS = false; Loading res/xml/flag_preferences.xml 0 → 100644 +24 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ --> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:key="feature_flags" android:persistent="false"> </PreferenceScreen> No newline at end of file res/xml/launcher_preferences.xml +6 −0 Original line number Diff line number Diff line Loading @@ -52,4 +52,10 @@ android:defaultValue="" android:persistent="false" /> <PreferenceScreen android:fragment="com.android.launcher3.config.FlagTogglerPreferenceFragment" android:key="flag_toggler" android:persistent="false" android:title="Feature flags"/> </PreferenceScreen> src/com/android/launcher3/Launcher.java +3 −4 Original line number Diff line number Diff line Loading @@ -1753,12 +1753,12 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, @Override public void bindScreens(IntArray orderedScreenIds) { // Make sure the first screen is always at the start. if (FeatureFlags.getInstance(this).isQsbOnFirstScreenEnabled() && if (FeatureFlags.QSB_ON_FIRST_SCREEN.get() && orderedScreenIds.indexOf(Workspace.FIRST_SCREEN_ID) != 0) { orderedScreenIds.removeValue(Workspace.FIRST_SCREEN_ID); orderedScreenIds.add(0, Workspace.FIRST_SCREEN_ID); LauncherModel.updateWorkspaceScreenOrder(this, orderedScreenIds); } else if (!FeatureFlags.getInstance(this).isQsbOnFirstScreenEnabled() } else if (!FeatureFlags.QSB_ON_FIRST_SCREEN.get() && orderedScreenIds.isEmpty()) { // If there are no screens, we need to have an empty screen mWorkspace.addExtraEmptyScreen(); Loading @@ -1775,8 +1775,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, int count = orderedScreenIds.size(); for (int i = 0; i < count; i++) { int screenId = orderedScreenIds.get(i); if (!FeatureFlags.getInstance(this).isQsbOnFirstScreenEnabled() || screenId != Workspace.FIRST_SCREEN_ID) { if (!FeatureFlags.QSB_ON_FIRST_SCREEN.get() || screenId != Workspace.FIRST_SCREEN_ID) { // No need to bind the first screen, as its always bound. mWorkspace.insertNewWorkspaceScreenBeforeEmptyScreen(screenId); } Loading src/com/android/launcher3/LauncherProvider.java +1 −4 Original line number Diff line number Diff line Loading @@ -70,9 +70,6 @@ import java.io.PrintWriter; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.LinkedHashSet; public class LauncherProvider extends ContentProvider { private static final String TAG = "LauncherProvider"; Loading Loading @@ -793,7 +790,7 @@ public class LauncherProvider extends ContentProvider { convertShortcutsToLauncherActivities(db); case 26: // QSB was moved to the grid. Clear the first row on screen 0. if (FeatureFlags.getInstance(mContext).isQsbOnFirstScreenEnabled() && if (FeatureFlags.QSB_ON_FIRST_SCREEN.get() && !LauncherDbUtils.prepareScreenZeroToHostQsb(mContext, db)) { break; } Loading Loading
go/src_flags/com/android/launcher3/config/FeatureFlags.java +2 −6 Original line number Diff line number Diff line Loading @@ -22,14 +22,10 @@ import android.content.Context; * Defines a set of flags used to control various launcher behaviors */ public final class FeatureFlags extends BaseFlags { private static FeatureFlags instance = new FeatureFlags(); public static FeatureFlags getInstance(Context context) { return instance; private FeatureFlags() { // Prevent instantiation } private FeatureFlags() {} // Features to control Launcher3Go behavior public static final boolean GO_DISABLE_WIDGETS = true; public static final boolean LAUNCHER3_SPRING_ICONS = false; Loading
res/xml/flag_preferences.xml 0 → 100644 +24 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ --> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:key="feature_flags" android:persistent="false"> </PreferenceScreen> No newline at end of file
res/xml/launcher_preferences.xml +6 −0 Original line number Diff line number Diff line Loading @@ -52,4 +52,10 @@ android:defaultValue="" android:persistent="false" /> <PreferenceScreen android:fragment="com.android.launcher3.config.FlagTogglerPreferenceFragment" android:key="flag_toggler" android:persistent="false" android:title="Feature flags"/> </PreferenceScreen>
src/com/android/launcher3/Launcher.java +3 −4 Original line number Diff line number Diff line Loading @@ -1753,12 +1753,12 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, @Override public void bindScreens(IntArray orderedScreenIds) { // Make sure the first screen is always at the start. if (FeatureFlags.getInstance(this).isQsbOnFirstScreenEnabled() && if (FeatureFlags.QSB_ON_FIRST_SCREEN.get() && orderedScreenIds.indexOf(Workspace.FIRST_SCREEN_ID) != 0) { orderedScreenIds.removeValue(Workspace.FIRST_SCREEN_ID); orderedScreenIds.add(0, Workspace.FIRST_SCREEN_ID); LauncherModel.updateWorkspaceScreenOrder(this, orderedScreenIds); } else if (!FeatureFlags.getInstance(this).isQsbOnFirstScreenEnabled() } else if (!FeatureFlags.QSB_ON_FIRST_SCREEN.get() && orderedScreenIds.isEmpty()) { // If there are no screens, we need to have an empty screen mWorkspace.addExtraEmptyScreen(); Loading @@ -1775,8 +1775,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, int count = orderedScreenIds.size(); for (int i = 0; i < count; i++) { int screenId = orderedScreenIds.get(i); if (!FeatureFlags.getInstance(this).isQsbOnFirstScreenEnabled() || screenId != Workspace.FIRST_SCREEN_ID) { if (!FeatureFlags.QSB_ON_FIRST_SCREEN.get() || screenId != Workspace.FIRST_SCREEN_ID) { // No need to bind the first screen, as its always bound. mWorkspace.insertNewWorkspaceScreenBeforeEmptyScreen(screenId); } Loading
src/com/android/launcher3/LauncherProvider.java +1 −4 Original line number Diff line number Diff line Loading @@ -70,9 +70,6 @@ import java.io.PrintWriter; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.LinkedHashSet; public class LauncherProvider extends ContentProvider { private static final String TAG = "LauncherProvider"; Loading Loading @@ -793,7 +790,7 @@ public class LauncherProvider extends ContentProvider { convertShortcutsToLauncherActivities(db); case 26: // QSB was moved to the grid. Clear the first row on screen 0. if (FeatureFlags.getInstance(mContext).isQsbOnFirstScreenEnabled() && if (FeatureFlags.QSB_ON_FIRST_SCREEN.get() && !LauncherDbUtils.prepareScreenZeroToHostQsb(mContext, db)) { break; } Loading