mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 19:38:21 +00:00
Clean up work profile
This includes - Dismiss work edu on launcher state change - Remove work tab flash on first setup - Make edu bottom sheet adopt theme color - Fix Work toggle bottom inset Bug: 149200572 Bug: 149197172 Bug: 149199058 Bug: 149215103 Bug: 149198955 Bug: 145595763 Bug:149481723 Test: Manual Change-Id: I39a30782b80fd3a66bede55754fa30a940d2caee
This commit is contained in:
@@ -15,8 +15,6 @@
|
||||
*/
|
||||
package com.android.launcher3.widget;
|
||||
|
||||
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
|
||||
import static com.android.launcher3.icons.GraphicsUtils.setColorAlphaBound;
|
||||
import static com.android.launcher3.logging.LoggerUtils.newContainerTarget;
|
||||
|
||||
@@ -42,7 +40,6 @@ import com.android.launcher3.userevent.nano.LauncherLogProto.Target;
|
||||
import com.android.launcher3.util.SystemUiController;
|
||||
import com.android.launcher3.util.Themes;
|
||||
import com.android.launcher3.views.AbstractSlideInView;
|
||||
import com.android.launcher3.views.BaseDragLayer;
|
||||
|
||||
/**
|
||||
* Base class for various widgets popup
|
||||
@@ -55,11 +52,14 @@ abstract class BaseWidgetSheet extends AbstractSlideInView
|
||||
/* Touch handling related member variables. */
|
||||
private Toast mWidgetInstructionToast;
|
||||
|
||||
protected final View mColorScrim;
|
||||
|
||||
public BaseWidgetSheet(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
mColorScrim = createColorScrim(context);
|
||||
}
|
||||
|
||||
protected int getScrimColor(Context context) {
|
||||
WallpaperColorInfo colors = WallpaperColorInfo.INSTANCE.get(context);
|
||||
int alpha = context.getResources().getInteger(R.integer.extracted_color_gradient_alpha);
|
||||
return setColorAlphaBound(colors.getSecondaryColor(), alpha);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -98,16 +98,6 @@ abstract class BaseWidgetSheet extends AbstractSlideInView
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void attachToContainer() {
|
||||
getPopupContainer().addView(mColorScrim);
|
||||
getPopupContainer().addView(this);
|
||||
}
|
||||
|
||||
protected void setTranslationShift(float translationShift) {
|
||||
super.setTranslationShift(translationShift);
|
||||
mColorScrim.setAlpha(1 - mTranslationShift);
|
||||
}
|
||||
|
||||
private boolean beginDraggingWidget(WidgetCell v) {
|
||||
// Get the widget preview as the drag representation
|
||||
WidgetImageView image = v.getWidgetView();
|
||||
@@ -138,7 +128,6 @@ abstract class BaseWidgetSheet extends AbstractSlideInView
|
||||
|
||||
protected void onCloseComplete() {
|
||||
super.onCloseComplete();
|
||||
getPopupContainer().removeView(mColorScrim);
|
||||
clearNavBarColor();
|
||||
}
|
||||
|
||||
@@ -177,19 +166,4 @@ abstract class BaseWidgetSheet extends AbstractSlideInView
|
||||
protected SystemUiController getSystemUiController() {
|
||||
return mLauncher.getSystemUiController();
|
||||
}
|
||||
|
||||
private static View createColorScrim(Context context) {
|
||||
View view = new View(context);
|
||||
view.forceHasOverlappingRendering(false);
|
||||
|
||||
WallpaperColorInfo colors = WallpaperColorInfo.INSTANCE.get(context);
|
||||
int alpha = context.getResources().getInteger(R.integer.extracted_color_gradient_alpha);
|
||||
view.setBackgroundColor(setColorAlphaBound(colors.getSecondaryColor(), alpha));
|
||||
|
||||
BaseDragLayer.LayoutParams lp = new BaseDragLayer.LayoutParams(MATCH_PARENT, MATCH_PARENT);
|
||||
lp.ignoreInsets = true;
|
||||
view.setLayoutParams(lp);
|
||||
|
||||
return view;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user