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:
Samuel Fufa
2020-02-10 09:26:20 -08:00
parent c7f39fc66d
commit ccebfbe273
18 changed files with 92 additions and 110 deletions

View File

@@ -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;
}
}