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

@@ -16,7 +16,6 @@
package com.android.launcher3.allapps;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
@@ -39,11 +38,8 @@ public class PersonalWorkSlidingTabStrip extends LinearLayout implements PageInd
private static final int POSITION_PERSONAL = 0;
private static final int POSITION_WORK = 1;
public static final String KEY_SHOWED_PEEK_WORK_TAB = "showed_peek_work_tab";
private final Paint mSelectedIndicatorPaint;
private final Paint mDividerPaint;
private final SharedPreferences mSharedPreferences;
private int mSelectedIndicatorHeight;
private int mIndicatorLeft = -1;
@@ -72,7 +68,6 @@ public class PersonalWorkSlidingTabStrip extends LinearLayout implements PageInd
mDividerPaint.setStrokeWidth(
getResources().getDimensionPixelSize(R.dimen.all_apps_divider_height));
mSharedPreferences = Utilities.getPrefs(context);
mIsRtl = Utilities.isRtl(getResources());
}
@@ -128,25 +123,6 @@ public class PersonalWorkSlidingTabStrip extends LinearLayout implements PageInd
mIndicatorRight, getHeight(), mSelectedIndicatorPaint);
}
public void highlightWorkTabIfNecessary() {
if (mSharedPreferences.getBoolean(KEY_SHOWED_PEEK_WORK_TAB, false)) {
return;
}
if (mLastActivePage != POSITION_PERSONAL) {
return;
}
highlightWorkTab();
mSharedPreferences.edit().putBoolean(KEY_SHOWED_PEEK_WORK_TAB, true).apply();
}
private void highlightWorkTab() {
View v = getChildAt(POSITION_WORK);
v.post(() -> {
v.setPressed(true);
v.setPressed(false);
});
}
@Override
public void setScroll(int currentScroll, int totalScroll) {
float scrollOffset = ((float) currentScroll) / totalScroll;