From d6947d27293bc3dd0449d448e7a200bf95f2107a Mon Sep 17 00:00:00 2001 From: Tony Mak Date: Tue, 30 Jan 2018 14:29:25 +0000 Subject: [PATCH] Ditch work profile orange and use the accent color instead FIXES: 72804074 Change-Id: If9dfd6eceb6b3d3365c32859d5cc13d6d49be1a0 --- res/color/all_apps_work_tab_text.xml | 19 ------------- res/layout/all_apps_floating_header.xml | 2 +- res/layout/work_tab_footer.xml | 3 +- res/values/colors.xml | 2 -- res/values/styles.xml | 4 --- .../allapps/PersonalWorkSlidingTabStrip.java | 28 ++++--------------- 6 files changed, 7 insertions(+), 51 deletions(-) delete mode 100644 res/color/all_apps_work_tab_text.xml diff --git a/res/color/all_apps_work_tab_text.xml b/res/color/all_apps_work_tab_text.xml deleted file mode 100644 index 7279bf87df..0000000000 --- a/res/color/all_apps_work_tab_text.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/layout/all_apps_floating_header.xml b/res/layout/all_apps_floating_header.xml index 166725da37..c4240f80db 100644 --- a/res/layout/all_apps_floating_header.xml +++ b/res/layout/all_apps_floating_header.xml @@ -52,7 +52,7 @@ android:fontFamily="sans-serif-medium" android:text="@string/all_apps_work_tab" android:textAllCaps="true" - android:textColor="@color/all_apps_work_tab_text" + android:textColor="@color/all_apps_tab_text" android:textSize="14sp" /> diff --git a/res/layout/work_tab_footer.xml b/res/layout/work_tab_footer.xml index dc0fdd4eef..21ff55ebd4 100644 --- a/res/layout/work_tab_footer.xml +++ b/res/layout/work_tab_footer.xml @@ -38,8 +38,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentEnd="true" - android:layout_below="@id/work_footer_divider" - android:theme="@style/WorkModeSwitchTheme"/> + android:layout_below="@id/work_footer_divider"/> #E5E5E5 #9AA0A6 - - #FF6D00 diff --git a/res/values/styles.xml b/res/values/styles.xml index c714841828..8cc4743a32 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -168,8 +168,4 @@ #DFE1E5 @color/all_apps_bg_hand_fill_dark - - diff --git a/src/com/android/launcher3/allapps/PersonalWorkSlidingTabStrip.java b/src/com/android/launcher3/allapps/PersonalWorkSlidingTabStrip.java index 393884e7c5..9fc4e2ef72 100644 --- a/src/com/android/launcher3/allapps/PersonalWorkSlidingTabStrip.java +++ b/src/com/android/launcher3/allapps/PersonalWorkSlidingTabStrip.java @@ -44,8 +44,7 @@ public class PersonalWorkSlidingTabStrip extends LinearLayout { private static final String KEY_SHOWED_PEEK_WORK_TAB = "showed_peek_work_tab"; - private final Paint mPersonalTabIndicatorPaint; - private final Paint mWorkTabIndicatorPaint; + private final Paint mSelectedIndicatorPaint; private final Paint mDividerPaint; private final SharedPreferences mSharedPreferences; @@ -55,7 +54,6 @@ public class PersonalWorkSlidingTabStrip extends LinearLayout { private int mIndicatorPosition = 0; private float mIndicatorOffset; private int mSelectedPosition = 0; - private boolean mIsRtl; public PersonalWorkSlidingTabStrip(@NonNull Context context, @Nullable AttributeSet attrs) { super(context, attrs); @@ -65,15 +63,10 @@ public class PersonalWorkSlidingTabStrip extends LinearLayout { mSelectedIndicatorHeight = getResources().getDimensionPixelSize(R.dimen.all_apps_tabs_indicator_height); - mPersonalTabIndicatorPaint = new Paint(); - mPersonalTabIndicatorPaint.setColor( + mSelectedIndicatorPaint = new Paint(); + mSelectedIndicatorPaint.setColor( Themes.getAttrColor(context, android.R.attr.colorAccent)); - mWorkTabIndicatorPaint = new Paint(); - mWorkTabIndicatorPaint.setColor(getResources().getColor(R.color.work_profile_color)); - - mIsRtl = Utilities.isRtl(getResources()); - mDividerPaint = new Paint(); mDividerPaint.setColor(Themes.getAttrColor(context, android.R.attr.colorControlHighlight)); mDividerPaint.setStrokeWidth( @@ -142,19 +135,8 @@ public class PersonalWorkSlidingTabStrip extends LinearLayout { canvas.drawLine(getPaddingLeft(), y, getWidth() - getPaddingRight(), y, mDividerPaint); final float middleX = getWidth() / 2.0f; - if (mIndicatorLeft <= middleX) { - canvas.drawRect(mIndicatorLeft, getHeight() - mSelectedIndicatorHeight, - middleX, getHeight(), getPaint(true /* firstHalf */)); - } - if (mIndicatorRight > middleX) { - canvas.drawRect(middleX, getHeight() - mSelectedIndicatorHeight, - mIndicatorRight, getHeight(), getPaint(false /* firstHalf */)); - } - } - - private Paint getPaint(boolean firstHalf) { - boolean isPersonal = mIsRtl ^ firstHalf; - return isPersonal ? mPersonalTabIndicatorPaint : mWorkTabIndicatorPaint; + canvas.drawRect(mIndicatorLeft, getHeight() - mSelectedIndicatorHeight, + mIndicatorRight, getHeight(), mSelectedIndicatorPaint); } public void peekWorkTabIfNecessary() {