Merge "Use color tokens for all apps entry buttons." into tm-dev am: 582ab494dc
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/16991026 Change-Id: Ic8efa2a0b6caae7c591294a1b9bdb198975c2bd0
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2022 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="@android:color/system_accent2_50"
|
||||
android:lStar="98" />
|
||||
</selector>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2022 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="@android:color/system_neutral1_50"
|
||||
android:lStar="98" />
|
||||
</selector>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2022 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="@android:color/system_accent1_50"
|
||||
android:lStar="40" />
|
||||
</selector>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2022 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="@android:color/system_accent2_50"
|
||||
android:lStar="48" />
|
||||
</selector>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2022 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="@android:color/system_accent1_50"
|
||||
android:lStar="35" />
|
||||
</selector>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2022 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="@android:color/system_accent3_50"
|
||||
android:lStar="48" />
|
||||
</selector>
|
||||
@@ -18,26 +18,27 @@
|
||||
android:width="80dp"
|
||||
android:height="80dp"
|
||||
android:viewportWidth="80"
|
||||
android:viewportHeight="80">
|
||||
android:viewportHeight="80"
|
||||
android:theme="@style/AllAppsTheme">
|
||||
<path
|
||||
android:pathData="M40,0.5L40,0.5c21.8,0 39.5,17.7 39.5,39.5l0,0c0,21.8 -17.7,39.5 -39.5,39.5l0,0C18.2,79.5 0.5,61.8 0.5,40l0,0C0.5,18.2 18.2,0.5 40,0.5z"
|
||||
android:fillColor="#F7F9FA"/>
|
||||
android:fillColor="?attr/allAppsButtonBgColor"/>
|
||||
<path
|
||||
android:pathData="M26.8,32.1m-5.3,0a5.3,5.3 0,1 1,10.6 0a5.3,5.3 0,1 1,-10.6 0"
|
||||
android:fillColor="#00677E"/>
|
||||
android:fillColor="?attr/allAppsButtonColor1"/>
|
||||
<path
|
||||
android:pathData="M26.8,47.9m-5.3,0a5.3,5.3 0,1 1,10.6 0a5.3,5.3 0,1 1,-10.6 0"
|
||||
android:fillColor="#5F757E"/>
|
||||
android:fillColor="?attr/allAppsButtonColor2"/>
|
||||
<path
|
||||
android:pathData="M40,32.1m-5.3,0a5.3,5.3 0,1 1,10.6 0a5.3,5.3 0,1 1,-10.6 0"
|
||||
android:fillColor="#5F757E"/>
|
||||
android:fillColor="?attr/allAppsButtonColor3"/>
|
||||
<path
|
||||
android:pathData="M40,47.9m-5.3,0a5.3,5.3 0,1 1,10.6 0a5.3,5.3 0,1 1,-10.6 0"
|
||||
android:fillColor="#6C6F93"/>
|
||||
android:fillColor="?attr/allAppsButtonColor2"/>
|
||||
<path
|
||||
android:pathData="M53.2,32.1m-5.3,0a5.3,5.3 0,1 1,10.6 0a5.3,5.3 0,1 1,-10.6 0"
|
||||
android:fillColor="#005A6E"/>
|
||||
android:fillColor="?attr/allAppsButtonColor4"/>
|
||||
<path
|
||||
android:pathData="M53.2,47.9m-5.3,0a5.3,5.3 0,1 1,10.6 0a5.3,5.3 0,1 1,-10.6 0"
|
||||
android:fillColor="#5F757E"/>
|
||||
android:fillColor="?attr/allAppsButtonColor2"/>
|
||||
</vector>
|
||||
|
||||
@@ -24,4 +24,9 @@
|
||||
<color name="home_settings_thumb_off_color">@android:color/system_neutral2_300</color>
|
||||
<color name="home_settings_track_on_color">@android:color/system_accent2_700</color>
|
||||
<color name="home_settings_track_off_color">@android:color/system_neutral1_700</color>
|
||||
|
||||
<color name="all_apps_button_bg_color">@android:color/system_neutral1_800</color>
|
||||
<color name="all_apps_button_color_1">@android:color/system_accent1_300</color>
|
||||
<color name="all_apps_button_color_3">@android:color/system_accent1_100</color>
|
||||
<color name="all_apps_button_color_4">@android:color/system_accent2_100</color>
|
||||
</resources>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<color name="all_apps_button_bg_color">#2E3132</color>
|
||||
<color name="all_apps_button_color_1">#33B9DB</color>
|
||||
<color name="all_apps_button_color_2">#EFFBFF</color>
|
||||
<color name="all_apps_button_color_3">#B1EBFF</color>
|
||||
<color name="all_apps_button_color_4">#DEE0FF</color>
|
||||
</resources>
|
||||
@@ -54,6 +54,12 @@
|
||||
<attr name="workspaceAccentColor" format="color" />
|
||||
<attr name="dropTargetHoverTextColor" format="color" />
|
||||
|
||||
<attr name="allAppsButtonBgColor" format="color" />
|
||||
<attr name="allAppsButtonColor1" format="color" />
|
||||
<attr name="allAppsButtonColor2" format="color" />
|
||||
<attr name="allAppsButtonColor3" format="color" />
|
||||
<attr name="allAppsButtonColor4" format="color" />
|
||||
|
||||
<!-- BubbleTextView specific attributes. -->
|
||||
<declare-styleable name="BubbleTextView">
|
||||
<attr name="layoutHorizontal" format="boolean" />
|
||||
|
||||
@@ -79,4 +79,10 @@
|
||||
|
||||
<color name="workspace_accent_color_light">#ff8df5e3</color>
|
||||
<color name="workspace_accent_color_dark">#ff3d665f</color>
|
||||
|
||||
<color name="all_apps_button_bg_color">#F7F9FA</color>
|
||||
<color name="all_apps_button_color_1">#00677E</color>
|
||||
<color name="all_apps_button_color_2">#00677E</color>
|
||||
<color name="all_apps_button_color_3">#5F757E</color>
|
||||
<color name="all_apps_button_color_4">#005A6E</color>
|
||||
</resources>
|
||||
|
||||
@@ -203,6 +203,14 @@
|
||||
<item name="android:importantForAccessibility">no</item>
|
||||
</style>
|
||||
|
||||
<style name="AllAppsButtonTheme">
|
||||
<item name="allAppsButtonBgColor">@color/all_apps_button_bg_color</item>
|
||||
<item name="allAppsButtonColor1">@color/all_apps_button_color_1</item>
|
||||
<item name="allAppsButtonColor2">@color/all_apps_button_color_2</item>
|
||||
<item name="allAppsButtonColor3">@color/all_apps_button_color_3</item>
|
||||
<item name="allAppsButtonColor4">@color/all_apps_button_color_4</item>
|
||||
</style>
|
||||
|
||||
<style name="AllAppsTheme">
|
||||
<item name="disabledIconAlpha">.54</item>
|
||||
</style>
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.android.launcher3.views;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.ContextThemeWrapper;
|
||||
|
||||
import com.android.launcher3.BubbleTextView;
|
||||
import com.android.launcher3.LauncherAppState;
|
||||
@@ -40,8 +41,9 @@ public class AllAppsButton extends BubbleTextView {
|
||||
public AllAppsButton(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
|
||||
Context theme = new ContextThemeWrapper(context, R.style.AllAppsButtonTheme);
|
||||
Bitmap bitmap = LauncherAppState.getInstance(context).getIconCache().getIconFactory()
|
||||
.createScaledBitmapWithShadow(context.getDrawable(R.drawable.ic_all_apps_button));
|
||||
.createScaledBitmapWithShadow(theme.getDrawable(R.drawable.ic_all_apps_button));
|
||||
setIcon(new FastBitmapDrawable(bitmap));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user