Fixing all-apps appearing as blank

Since all-apps and homescreen do not share any QSB, we can
change the alpha for hotseat QSB directly

Bug: 184122599
Test: Manual
Change-Id: Ifa610fe75ad22cfe8a7d816ed2b48e2b9411c4c1
This commit is contained in:
Sunny Goyal
2021-03-31 14:56:47 -07:00
parent 21dfadab76
commit 0b5b8d4969
4 changed files with 1 additions and 59 deletions
-13
View File
@@ -29,7 +29,6 @@ import android.widget.FrameLayout;
import androidx.annotation.Nullable;
import java.util.Arrays;
import java.util.function.Consumer;
/**
@@ -97,7 +96,6 @@ public class Hotseat extends CellLayout implements Insettable {
} else {
setGridSize(idp.numHotseatIcons, 1);
}
showInlineQsb();
}
@Override
@@ -182,10 +180,6 @@ public class Hotseat extends CellLayout implements Insettable {
mOnVisibilityAggregatedCallback = callback;
}
protected void showInlineQsb() {
//Does nothing
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
@@ -223,13 +217,6 @@ public class Hotseat extends CellLayout implements Insettable {
mTaskbarView.layout(left, top, right, bottom);
}
/**
* Returns the first View for which the given itemOperator returns true, or null.
*/
public View getFirstItemMatch(Workspace.ItemOperator itemOperator) {
return mWorkspace.getFirstMatch(Arrays.asList(this), itemOperator);
}
/**
* Sets the alpha value of just our ShortcutAndWidgetContainer.
*/
+1 -34
View File
@@ -34,7 +34,6 @@ import static com.android.launcher3.LauncherState.FLAG_NON_INTERACTIVE;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.NO_OFFSET;
import static com.android.launcher3.LauncherState.NO_SCALE;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.LauncherState.SPRING_LOADED;
import static com.android.launcher3.Utilities.postAsyncCallback;
import static com.android.launcher3.accessibility.LauncherAccessibilityDelegate.getSupportedActions;
@@ -149,7 +148,6 @@ import com.android.launcher3.popup.SystemShortcut;
import com.android.launcher3.qsb.QsbContainerView;
import com.android.launcher3.statemanager.StateManager;
import com.android.launcher3.statemanager.StateManager.StateHandler;
import com.android.launcher3.statemanager.StateManager.StateListener;
import com.android.launcher3.statemanager.StatefulActivity;
import com.android.launcher3.states.RotationHelper;
import com.android.launcher3.testing.TestLogging;
@@ -269,9 +267,6 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
private static final int NEW_APPS_ANIMATION_INACTIVE_TIMEOUT_SECONDS = 5;
@Thunk @VisibleForTesting public static final int NEW_APPS_ANIMATION_DELAY = 500;
private static final int APPS_VIEW_ALPHA_CHANNEL_INDEX = 1;
private static final int SCRIM_VIEW_ALPHA_CHANNEL_INDEX = 0;
private static final int THEME_CROSS_FADE_ANIMATION_DURATION = 375;
private Configuration mOldConfig;
@@ -342,8 +337,6 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
private RotationHelper mRotationHelper;
private float mCurrentAssistantVisibility = 0f;
protected LauncherOverlayManager mOverlayManager;
// If true, overlay callbacks are deferred
private boolean mDeferOverlayCallbacks;
@@ -457,24 +450,6 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
OverlayPlugin.class, false /* allowedMultiple */);
mRotationHelper.initialize();
mStateManager.addStateListener(new StateListener<LauncherState>() {
@Override
public void onStateTransitionComplete(LauncherState finalState) {
float alpha = 1f - mCurrentAssistantVisibility;
if (finalState == NORMAL) {
mAppsView.getAlphaProperty(APPS_VIEW_ALPHA_CHANNEL_INDEX).setValue(alpha);
} else if (finalState == OVERVIEW) {
mAppsView.getAlphaProperty(APPS_VIEW_ALPHA_CHANNEL_INDEX).setValue(alpha);
mScrimView.setAlpha(alpha);
} else {
mAppsView.getAlphaProperty(APPS_VIEW_ALPHA_CHANNEL_INDEX).setValue(1f);
mScrimView.setAlpha(1f);
}
}
});
TraceHelper.INSTANCE.endSection(traceToken);
mUserChangedCallbackCloseable = UserCache.INSTANCE.get(this).addUserChangeListener(
@@ -563,15 +538,7 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
}
public void onAssistantVisibilityChanged(float visibility) {
mCurrentAssistantVisibility = visibility;
float alpha = 1f - visibility;
LauncherState state = mStateManager.getState();
if (state == NORMAL) {
mAppsView.getAlphaProperty(APPS_VIEW_ALPHA_CHANNEL_INDEX).setValue(alpha);
} else if (state == OVERVIEW) {
mAppsView.getAlphaProperty(APPS_VIEW_ALPHA_CHANNEL_INDEX).setValue(alpha);
mScrimView.setAlpha(alpha);
}
mHotseat.getQsb().setAlpha(1f - visibility);
}
private void initDeviceProfile(InvariantDeviceProfile idp) {
@@ -64,8 +64,6 @@ import com.android.launcher3.keyboard.FocusedItemDecorator;
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.util.MultiValueAlpha;
import com.android.launcher3.util.MultiValueAlpha.AlphaProperty;
import com.android.launcher3.util.Themes;
import com.android.launcher3.views.RecyclerViewFastScroller;
import com.android.launcher3.views.SpringRelativeLayout;
@@ -80,7 +78,6 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
private static final float FLING_VELOCITY_MULTIPLIER = 1000 * .8f;
// Starts the springs after at least 55% of the animation has passed.
private static final float FLING_ANIMATION_THRESHOLD = 0.55f;
private static final int ALPHA_CHANNEL_COUNT = 2;
protected final BaseDraggingActivity mLauncher;
protected final AdapterHolder[] mAH;
@@ -107,8 +104,6 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
protected RecyclerViewFastScroller mTouchHandler;
protected final Point mFastScrollerOffset = new Point();
private final MultiValueAlpha mMultiValueAlpha;
private Rect mInsets = new Rect();
SearchAdapterProvider mSearchAdapterProvider;
@@ -139,8 +134,6 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
mNavBarScrimPaint.setColor(Themes.getAttrColor(context, R.attr.allAppsNavBarScrimColor));
mAllAppsStore.addUpdateListener(this::onAppsUpdated);
mMultiValueAlpha = new MultiValueAlpha(this, ALPHA_CHANNEL_COUNT);
}
/**
@@ -156,10 +149,6 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
return mAllAppsStore;
}
public AlphaProperty getAlphaProperty(int index) {
return mMultiValueAlpha.getProperty(index);
}
public WorkModeSwitch getWorkModeSwitch() {
return mWorkModeSwitch;
}
@@ -110,7 +110,6 @@ public class AllAppsTransitionController
setScrollRangeDelta(mScrollRangeDelta);
if (mIsVerticalLayout) {
mAppsView.getAlphaProperty(APPS_VIEW_ALPHA_CHANNEL_INDEX).setValue(1);
mLauncher.getHotseat().setTranslationY(0);
mLauncher.getWorkspace().getPageIndicator().setTranslationY(0);
}