Properly color taskbar nav buttons when slide-in view is shown.

Supports overriding the current nav bar color with one that would be
visible over a slide-in view.

Demo:
https://drive.google.com/file/d/1MB26QM5qeeyVB6Bj14IGoPCWVT_P7K-3/view?usp=sharing&resourcekey=0-wnMgciNrUXC_l7gI3JFm8A

Test: Manually with light and dark themes, as well as All Apps and EDU
views.
Fix: 248359789

Change-Id: I134ae719b10f3de78ea18220a835de56a82ecb02
This commit is contained in:
Brian Isganitis
2022-09-23 17:13:32 -07:00
parent ae81433665
commit 731ef0c301
7 changed files with 55 additions and 18 deletions

View File

@@ -30,13 +30,10 @@ import com.android.launcher3.Insettable;
import com.android.launcher3.R;
import com.android.launcher3.views.AbstractSlideInView;
import java.util.Optional;
/** Wrapper for taskbar all apps with slide-in behavior. */
public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarAllAppsContext>
implements Insettable, DeviceProfile.OnDeviceProfileChangeListener {
private TaskbarAllAppsContainerView mAppsView;
private OnCloseListener mOnCloseBeginListener;
private float mShiftRange;
public TaskbarAllAppsSlideInView(Context context, AttributeSet attrs) {
@@ -72,14 +69,8 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarAllApp
return mAppsView;
}
/** Callback invoked when the view is beginning to close (e.g. close animation is started). */
void setOnCloseBeginListener(OnCloseListener onCloseBeginListener) {
mOnCloseBeginListener = onCloseBeginListener;
}
@Override
protected void handleClose(boolean animate) {
Optional.ofNullable(mOnCloseBeginListener).ifPresent(OnCloseListener::onSlideInViewClosed);
handleClose(animate,
ALL_APPS.getTransitionDuration(mActivityContext, false /* isToState */));
}