mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 15:56:49 +00:00
Add header protection for Taskbar All Apps search bar.
Works similar to ActivityAllAppsContainerView<->ScrimView implementation, except utilizes AbstractSlideInView's builtin scrim. Test: Manual Flag: ENABLE_ALL_APPS_SEARCH_IN_TASKBAR=false Bug: 216683257 Change-Id: Ide41ac47ecffc232fffac34c6bfdda67c1da549d
This commit is contained in:
@@ -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;
|
||||
@@ -109,12 +110,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
|
||||
@@ -129,6 +131,12 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarOverla
|
||||
mActivityContext.removeOnDeviceProfileChangeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatchDraw(Canvas canvas) {
|
||||
mAppsView.drawOnScrimWithScale(canvas, mSlideInViewScale.value);
|
||||
super.dispatchDraw(canvas);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onScaleProgressChanged() {
|
||||
super.onScaleProgressChanged();
|
||||
|
||||
Reference in New Issue
Block a user