Merge "Replace conversations widget app icon" into sc-dev

This commit is contained in:
TreeHugger Robot 2021-04-29 22:15:21 +00:00 committed by Android (Google) Code Review
commit 14e2070709
2 changed files with 54 additions and 2 deletions

View File

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2021 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:pathData="M24,24m-24,0a24,24 0,1 1,48 0a24,24 0,1 1,-48 0"
android:fillColor="#81C995"/>
<path
android:pathData="M27,34C23.134,34 20,30.866 20,27C20,23.134 23.134,20 27,20C30.866,20 34,23.134 34,27C34,28.4872 33.5362,29.8662 32.7453,31"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#3C4043"/>
<path
android:pathData="M35,33l-8,0l-0,2l8,0z"
android:fillColor="#3C4043"/>
<path
android:pathData="M21,21m-6,0a6,6 0,1 1,12 0a6,6 0,1 1,-12 0"
android:fillColor="#81C995"/>
<path
android:pathData="M16,25h5v2h-5z"
android:fillColor="#81C995"/>
<path
android:pathData="M21,28C24.866,28 28,24.866 28,21C28,17.134 24.866,14 21,14C17.134,14 14,17.134 14,21C14,22.4872 14.4638,23.8662 15.2547,25"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#ffffff"/>
<path
android:pathData="M13,27h8v2h-8z"
android:fillColor="#ffffff"/>
</vector>

View File

@ -35,7 +35,6 @@ import androidx.recyclerview.widget.RecyclerView;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.R;
import com.android.launcher3.icons.FastBitmapDrawable;
import com.android.launcher3.icons.IconCache.ItemInfoUpdateReceiver;
import com.android.launcher3.icons.PlaceHolderIconDrawable;
import com.android.launcher3.icons.cache.HandlerRunnable;
@ -174,7 +173,14 @@ public final class WidgetsListHeader extends LinearLayout implements ItemInfoUpd
}
private void setIcon(PackageItemInfo info) {
FastBitmapDrawable icon = info.newIcon(getContext());
Drawable icon;
switch (info.category) {
case PackageItemInfo.CONVERSATIONS:
icon = getContext().getDrawable(R.drawable.ic_conversations_widget_category);
break;
default:
icon = info.newIcon(getContext());
}
applyDrawables(icon);
mIconDrawable = icon;
if (mIconDrawable != null) {