mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-17 09:38:19 +00:00
Groundwork for runtime-toggleable feature flags
This is the first step in adding a flag toggler UI to launcher. The change migrates a single flag (QSB_ON_FIRST_SCREEN) from a boolean constant to a boolean method. In future, that will allow us to return different values at runtime. Bug: 117223984 Change-Id: I1e62c91dd941b8145166021bc0aa157733e62ea0
This commit is contained in:
@@ -479,7 +479,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
|
||||
* @param qsb an existing qsb to recycle or null.
|
||||
*/
|
||||
public void bindAndInitFirstWorkspaceScreen(View qsb) {
|
||||
if (!FeatureFlags.QSB_ON_FIRST_SCREEN) {
|
||||
if (!FeatureFlags.getInstance(getContext()).isQsbOnFirstScreenEnabled()) {
|
||||
return;
|
||||
}
|
||||
// Add the first page
|
||||
@@ -778,7 +778,9 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
|
||||
long id = mWorkspaceScreens.keyAt(i);
|
||||
CellLayout cl = mWorkspaceScreens.valueAt(i);
|
||||
// FIRST_SCREEN_ID can never be removed.
|
||||
if ((!FeatureFlags.QSB_ON_FIRST_SCREEN || id > FIRST_SCREEN_ID)
|
||||
boolean qsbFirstScreenEnabled =
|
||||
FeatureFlags.getInstance(getContext()).isQsbOnFirstScreenEnabled();
|
||||
if ((!qsbFirstScreenEnabled || id > FIRST_SCREEN_ID)
|
||||
&& cl.getShortcutsAndWidgets().getChildCount() == 0) {
|
||||
removeScreens.add(id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user