diff options
-rw-r--r-- | res/color/all_apps_work_tab_text.xml | 19 | ||||
-rw-r--r-- | res/layout/all_apps_floating_header.xml | 2 | ||||
-rw-r--r-- | res/layout/work_tab_footer.xml | 3 | ||||
-rw-r--r-- | res/values/colors.xml | 2 | ||||
-rw-r--r-- | res/values/styles.xml | 4 | ||||
-rw-r--r-- | src/com/android/launcher3/allapps/PersonalWorkSlidingTabStrip.java | 28 |
6 files changed, 7 insertions, 51 deletions
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 7279bf87d..000000000 --- a/res/color/all_apps_work_tab_text.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2017 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:color="@color/work_profile_color" android:state_selected="true"/> - <item android:color="?android:attr/textColorTertiary"/> -</selector>
\ 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 166725da3..c4240f80d 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" /> </com.android.launcher3.allapps.PersonalWorkSlidingTabStrip> </com.android.launcher3.allapps.FloatingHeaderView> diff --git a/res/layout/work_tab_footer.xml b/res/layout/work_tab_footer.xml index dc0fdd4ee..21ff55ebd 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"/> <TextView android:id="@android:id/title" diff --git a/res/values/colors.xml b/res/values/colors.xml index 4abdfd607..eb207af1e 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -38,6 +38,4 @@ <color name="all_apps_bg_hand_fill">#E5E5E5</color> <color name="all_apps_bg_hand_fill_dark">#9AA0A6</color> - - <color name="work_profile_color">#FF6D00</color> </resources> diff --git a/res/values/styles.xml b/res/values/styles.xml index c71484182..8cc4743a3 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -168,8 +168,4 @@ <item name="android:colorControlHighlight">#DFE1E5</item> <item name="android:colorForeground">@color/all_apps_bg_hand_fill_dark</item> </style> - - <style name="WorkModeSwitchTheme" parent="@style/LauncherTheme"> - <item name="android:colorAccent">@color/work_profile_color</item> - </style> </resources> diff --git a/src/com/android/launcher3/allapps/PersonalWorkSlidingTabStrip.java b/src/com/android/launcher3/allapps/PersonalWorkSlidingTabStrip.java index 393884e7c..9fc4e2ef7 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() { |