diff options
| author | 2023-10-24 20:21:20 +0000 | |
|---|---|---|
| committer | 2023-10-24 20:21:20 +0000 | |
| commit | 6e1337987eb2c062ba2cc7959333a3e6355afaee (patch) | |
| tree | a34d032796d1dcbd1c552ed9f0bca5f41de6defa /java | |
| parent | 6b982645670c8e7b83b7db10b72f2f0eb191af17 (diff) | |
| parent | 5fc200698096eb4666247c8ab1bda9573cb075a6 (diff) | |
Merge "Fix shortcuts loading state" into main
Diffstat (limited to 'java')
4 files changed, 2 insertions, 48 deletions
diff --git a/java/res/drawable/chooser_direct_share_label_placeholder.xml b/java/res/drawable/chooser_direct_share_label_placeholder.xml deleted file mode 100644 index b21444bf..00000000 --- a/java/res/drawable/chooser_direct_share_label_placeholder.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2019 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 - --> -<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> - - <!-- This drawable is intended to be used as the background of a two line TextView. We only - want the height to be ~1 line. Do this cheaply by applying padding to the bottom. --> - <item android:bottom="18dp"> - <shape android:shape="rectangle" > - - <!-- Size used for scaling should the container be different dimensions --> - <size android:width="@dimen/chooser_direct_share_label_placeholder_max_width" - android:height="18dp"/> - - <!-- Absurd corner radius to ensure pill shape --> - <corners android:bottomLeftRadius="100dp" - android:bottomRightRadius="100dp" - android:topLeftRadius="100dp" - android:topRightRadius="100dp" /> - - <solid android:color="@color/chooser_gradient_background "/> - </shape> - </item> -</layer-list>
\ No newline at end of file diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml index ae80815b..8843c81a 100644 --- a/java/res/values/dimens.xml +++ b/java/res/values/dimens.xml @@ -33,7 +33,6 @@ <dimen name="chooser_preview_image_max_dimen">200dp</dimen> <dimen name="chooser_header_scroll_elevation">4dp</dimen> <dimen name="chooser_max_collapsed_height">288dp</dimen> - <dimen name="chooser_direct_share_label_placeholder_max_width">72dp</dimen> <dimen name="chooser_icon_size">56dp</dimen> <dimen name="chooser_badge_size">22dp</dimen> <dimen name="resolver_icon_size">32dp</dimen> diff --git a/java/src/com/android/intentresolver/ChooserListAdapter.java b/java/src/com/android/intentresolver/ChooserListAdapter.java index 35258317..9a15c919 100644 --- a/java/src/com/android/intentresolver/ChooserListAdapter.java +++ b/java/src/com/android/intentresolver/ChooserListAdapter.java @@ -375,13 +375,8 @@ public class ChooserListAdapter extends ResolverListAdapter { } } - // If target is loading, show a special placeholder shape in the label, make unclickable if (info.isPlaceHolderTargetInfo()) { - int maxTextWidth = mContext.getResources().getDimensionPixelSize( - R.dimen.chooser_direct_share_label_placeholder_max_width); - Drawable placeholderDrawable = mContext.getResources().getDrawable( - R.drawable.chooser_direct_share_label_placeholder, mContext.getTheme()); - holder.bindPlaceholderDrawable(maxTextWidth, placeholderDrawable); + holder.bindPlaceholder(); } if (info.isMultiDisplayResolveInfo()) { diff --git a/java/src/com/android/intentresolver/ResolverListAdapter.java b/java/src/com/android/intentresolver/ResolverListAdapter.java index ab669f92..6c17df1d 100644 --- a/java/src/com/android/intentresolver/ResolverListAdapter.java +++ b/java/src/com/android/intentresolver/ResolverListAdapter.java @@ -994,10 +994,7 @@ public class ResolverListAdapter extends BaseAdapter { } } - public void bindPlaceholderDrawable(int maxTextWidth, Drawable drawable) { - text.setMaxWidth(maxTextWidth); - text.setBackground(drawable); - // Prevent rippling by removing background containing ripple + public void bindPlaceholder() { itemView.setBackground(null); } |