Ditch work profile orange and use the accent color instead
FIXES: 72804074 Change-Id: If9dfd6eceb6b3d3365c32859d5cc13d6d49be1a0
This commit is contained in:
parent
1a341002fc
commit
d6947d2729
|
@ -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>
|
|
@ -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>
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue