Loading quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContainerView.java +21 −0 Original line number Diff line number Diff line Loading @@ -19,15 +19,21 @@ import android.content.Context; import android.util.AttributeSet; import android.view.View; import androidx.annotation.Nullable; import com.android.launcher3.R; import com.android.launcher3.allapps.ActivityAllAppsContainerView; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.taskbar.overlay.TaskbarOverlayContext; import java.util.Optional; /** All apps container accessible from taskbar. */ public class TaskbarAllAppsContainerView extends ActivityAllAppsContainerView<TaskbarOverlayContext> { private @Nullable OnInvalidateHeaderListener mOnInvalidateHeaderListener; public TaskbarAllAppsContainerView(Context context, AttributeSet attrs) { this(context, attrs, 0); } Loading @@ -36,6 +42,10 @@ public class TaskbarAllAppsContainerView extends super(context, attrs, defStyleAttr); } void setOnInvalidateHeaderListener(OnInvalidateHeaderListener onInvalidateHeaderListener) { mOnInvalidateHeaderListener = onInvalidateHeaderListener; } @Override protected View inflateSearchBox() { if (isSearchSupported()) { Loading @@ -53,6 +63,13 @@ public class TaskbarAllAppsContainerView extends return searchView; } @Override public void invalidateHeader() { super.invalidateHeader(); Optional.ofNullable(mOnInvalidateHeaderListener).ifPresent( OnInvalidateHeaderListener::onInvalidateHeader); } @Override protected boolean isSearchSupported() { return FeatureFlags.ENABLE_ALL_APPS_SEARCH_IN_TASKBAR.get(); Loading @@ -63,4 +80,8 @@ public class TaskbarAllAppsContainerView extends // All apps is always open return true; } interface OnInvalidateHeaderListener { void onInvalidateHeader(); } } quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java +12 −4 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ import static com.android.launcher3.anim.Interpolators.EMPHASIZED; import android.animation.PropertyValuesHolder; import android.content.Context; import android.graphics.Canvas; import android.graphics.Rect; import android.util.AttributeSet; import android.view.MotionEvent; Loading Loading @@ -99,12 +100,13 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarOverla mAppsView = findViewById(R.id.apps_view); mContent = mAppsView; // Setup header protection for search bar, if enabled. if (FeatureFlags.ENABLE_ALL_APPS_SEARCH_IN_TASKBAR.get()) { mAppsView.setOnInvalidateHeaderListener(this::invalidate); } DeviceProfile dp = mActivityContext.getDeviceProfile(); setShiftRange(dp.allAppsShiftRange); setContentBackgroundWithParent( getContext().getDrawable(R.drawable.bg_rounded_corner_bottom_sheet), mAppsView.getBottomSheetBackground()); } @Override Loading Loading @@ -136,6 +138,12 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarOverla } } @Override protected void dispatchDraw(Canvas canvas) { mAppsView.drawOnScrimWithScale(canvas, mSlideInViewScale.value); super.dispatchDraw(canvas); } @Override protected void onScaleProgressChanged() { super.onScaleProgressChanged(); Loading src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java +2 −2 Original line number Diff line number Diff line Loading @@ -871,8 +871,8 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext> boolean visible = deviceProfile.isTablet || mForceBottomSheetVisible; mBottomSheetBackground.setVisibility(visible ? View.VISIBLE : View.GONE); // Note: For tablets, the opaque background and header protection are added in drawOnScrim. // For the taskbar entrypoint, the scrim is drawn differently, so a static background is // added in TaskbarAllAppsContainerView and header protection is not yet supported. // For the taskbar entrypoint, the scrim is drawn by its abstract slide in view container, // so its header protection is derived from this scrim instead. } private void setBottomSheetAlpha(float alpha) { Loading src/com/android/launcher3/views/AbstractSlideInView.java +1 −1 Original line number Diff line number Diff line Loading @@ -99,7 +99,7 @@ public abstract class AbstractSlideInView<T extends Context & ActivityContext> protected @Nullable OnCloseListener mOnCloseBeginListener; protected List<OnCloseListener> mOnCloseListeners = new ArrayList<>(); private final AnimatedFloat mSlideInViewScale = protected final AnimatedFloat mSlideInViewScale = new AnimatedFloat(this::onScaleProgressChanged, VIEW_NO_SCALE); protected boolean mIsBackProgressing; @Nullable private Drawable mContentBackground; Loading Loading
quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContainerView.java +21 −0 Original line number Diff line number Diff line Loading @@ -19,15 +19,21 @@ import android.content.Context; import android.util.AttributeSet; import android.view.View; import androidx.annotation.Nullable; import com.android.launcher3.R; import com.android.launcher3.allapps.ActivityAllAppsContainerView; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.taskbar.overlay.TaskbarOverlayContext; import java.util.Optional; /** All apps container accessible from taskbar. */ public class TaskbarAllAppsContainerView extends ActivityAllAppsContainerView<TaskbarOverlayContext> { private @Nullable OnInvalidateHeaderListener mOnInvalidateHeaderListener; public TaskbarAllAppsContainerView(Context context, AttributeSet attrs) { this(context, attrs, 0); } Loading @@ -36,6 +42,10 @@ public class TaskbarAllAppsContainerView extends super(context, attrs, defStyleAttr); } void setOnInvalidateHeaderListener(OnInvalidateHeaderListener onInvalidateHeaderListener) { mOnInvalidateHeaderListener = onInvalidateHeaderListener; } @Override protected View inflateSearchBox() { if (isSearchSupported()) { Loading @@ -53,6 +63,13 @@ public class TaskbarAllAppsContainerView extends return searchView; } @Override public void invalidateHeader() { super.invalidateHeader(); Optional.ofNullable(mOnInvalidateHeaderListener).ifPresent( OnInvalidateHeaderListener::onInvalidateHeader); } @Override protected boolean isSearchSupported() { return FeatureFlags.ENABLE_ALL_APPS_SEARCH_IN_TASKBAR.get(); Loading @@ -63,4 +80,8 @@ public class TaskbarAllAppsContainerView extends // All apps is always open return true; } interface OnInvalidateHeaderListener { void onInvalidateHeader(); } }
quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java +12 −4 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ import static com.android.launcher3.anim.Interpolators.EMPHASIZED; import android.animation.PropertyValuesHolder; import android.content.Context; import android.graphics.Canvas; import android.graphics.Rect; import android.util.AttributeSet; import android.view.MotionEvent; Loading Loading @@ -99,12 +100,13 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarOverla mAppsView = findViewById(R.id.apps_view); mContent = mAppsView; // Setup header protection for search bar, if enabled. if (FeatureFlags.ENABLE_ALL_APPS_SEARCH_IN_TASKBAR.get()) { mAppsView.setOnInvalidateHeaderListener(this::invalidate); } DeviceProfile dp = mActivityContext.getDeviceProfile(); setShiftRange(dp.allAppsShiftRange); setContentBackgroundWithParent( getContext().getDrawable(R.drawable.bg_rounded_corner_bottom_sheet), mAppsView.getBottomSheetBackground()); } @Override Loading Loading @@ -136,6 +138,12 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarOverla } } @Override protected void dispatchDraw(Canvas canvas) { mAppsView.drawOnScrimWithScale(canvas, mSlideInViewScale.value); super.dispatchDraw(canvas); } @Override protected void onScaleProgressChanged() { super.onScaleProgressChanged(); Loading
src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java +2 −2 Original line number Diff line number Diff line Loading @@ -871,8 +871,8 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext> boolean visible = deviceProfile.isTablet || mForceBottomSheetVisible; mBottomSheetBackground.setVisibility(visible ? View.VISIBLE : View.GONE); // Note: For tablets, the opaque background and header protection are added in drawOnScrim. // For the taskbar entrypoint, the scrim is drawn differently, so a static background is // added in TaskbarAllAppsContainerView and header protection is not yet supported. // For the taskbar entrypoint, the scrim is drawn by its abstract slide in view container, // so its header protection is derived from this scrim instead. } private void setBottomSheetAlpha(float alpha) { Loading
src/com/android/launcher3/views/AbstractSlideInView.java +1 −1 Original line number Diff line number Diff line Loading @@ -99,7 +99,7 @@ public abstract class AbstractSlideInView<T extends Context & ActivityContext> protected @Nullable OnCloseListener mOnCloseBeginListener; protected List<OnCloseListener> mOnCloseListeners = new ArrayList<>(); private final AnimatedFloat mSlideInViewScale = protected final AnimatedFloat mSlideInViewScale = new AnimatedFloat(this::onScaleProgressChanged, VIEW_NO_SCALE); protected boolean mIsBackProgressing; @Nullable private Drawable mContentBackground; Loading