Loading core/java/com/android/internal/app/ChooserListAdapter.java +9 −3 Original line number Original line Diff line number Diff line Loading @@ -238,8 +238,9 @@ public class ChooserListAdapter extends ResolverListAdapter { } } @Override @Override protected void onBindView(View view, TargetInfo info) { protected void onBindView(View view, TargetInfo info, int position) { super.onBindView(view, info); super.onBindView(view, info, position); if (info == null) return; // If target is loading, show a special placeholder shape in the label, make unclickable // If target is loading, show a special placeholder shape in the label, make unclickable final ViewHolder holder = (ViewHolder) view.getTag(); final ViewHolder holder = (ViewHolder) view.getTag(); Loading @@ -257,11 +258,16 @@ public class ChooserListAdapter extends ResolverListAdapter { holder.itemView.setBackground(holder.defaultItemViewBackground); holder.itemView.setBackground(holder.defaultItemViewBackground); } } // If the target is grouped show an indicator if (info instanceof MultiDisplayResolveInfo) { if (info instanceof MultiDisplayResolveInfo) { // If the target is grouped show an indicator Drawable bkg = mContext.getDrawable(R.drawable.chooser_group_background); Drawable bkg = mContext.getDrawable(R.drawable.chooser_group_background); holder.text.setPaddingRelative(0, 0, bkg.getIntrinsicWidth() /* end */, 0); holder.text.setPaddingRelative(0, 0, bkg.getIntrinsicWidth() /* end */, 0); holder.text.setBackground(bkg); holder.text.setBackground(bkg); } else if (info.isPinned() && getPositionTargetType(position) == TARGET_STANDARD) { // If the target is pinned and in the suggested row show a pinned indicator Drawable bkg = mContext.getDrawable(R.drawable.chooser_pinned_background); holder.text.setPaddingRelative(bkg.getIntrinsicWidth() /* start */, 0, 0, 0); holder.text.setBackground(bkg); } else { } else { holder.text.setBackground(null); holder.text.setBackground(null); holder.text.setPaddingRelative(0, 0, 0, 0); holder.text.setPaddingRelative(0, 0, 0, 0); Loading core/java/com/android/internal/app/ResolverListAdapter.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -524,7 +524,7 @@ public class ResolverListAdapter extends BaseAdapter { if (view == null) { if (view == null) { view = createView(parent); view = createView(parent); } } onBindView(view, getItem(position)); onBindView(view, getItem(position), position); return view; return view; } } Loading @@ -541,10 +541,10 @@ public class ResolverListAdapter extends BaseAdapter { } } public final void bindView(int position, View view) { public final void bindView(int position, View view) { onBindView(view, getItem(position)); onBindView(view, getItem(position), position); } } protected void onBindView(View view, TargetInfo info) { protected void onBindView(View view, TargetInfo info, int position) { final ViewHolder holder = (ViewHolder) view.getTag(); final ViewHolder holder = (ViewHolder) view.getTag(); if (info == null) { if (info == null) { holder.icon.setImageDrawable( holder.icon.setImageDrawable( Loading core/res/res/drawable/chooser_group_background.xml +1 −1 Original line number Original line Diff line number Diff line Loading @@ -21,5 +21,5 @@ android:width="12dp" android:width="12dp" android:height="12dp" android:height="12dp" android:start="4dp" android:start="4dp" android:end="4dp" /> android:end="0dp" /> </layer-list> </layer-list> core/res/res/drawable/chooser_pinned_background.xml 0 → 100644 +25 −0 Original line number Original line Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2020 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"> <item android:drawable="@drawable/ic_chooser_pin" android:gravity="start|center_vertical" android:width="12dp" android:height="12dp" android:start="0dp" android:end="4dp" /> </layer-list> No newline at end of file core/res/res/drawable/ic_chooser_pin.xml 0 → 100644 +26 −0 Original line number Original line Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2020 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="12dp" android:height="12dp" android:viewportWidth="12" android:viewportHeight="12" android:tint="?attr/textColorSecondary"> <path android:pathData="M8.5,2C8.5,1.45 8.055,1 7.5,1L4.5,1C3.95,1 3.5,1.45 3.5,2L3.5,5.5L2.5,7L2.5,8L5.5,8L5.5,10.5L6,11L6.5,10.5L6.5,8L9.5,8L9.5,7L8.5,5.5L8.5,2Z" android:fillColor="#FF000000" /> </vector> Loading
core/java/com/android/internal/app/ChooserListAdapter.java +9 −3 Original line number Original line Diff line number Diff line Loading @@ -238,8 +238,9 @@ public class ChooserListAdapter extends ResolverListAdapter { } } @Override @Override protected void onBindView(View view, TargetInfo info) { protected void onBindView(View view, TargetInfo info, int position) { super.onBindView(view, info); super.onBindView(view, info, position); if (info == null) return; // If target is loading, show a special placeholder shape in the label, make unclickable // If target is loading, show a special placeholder shape in the label, make unclickable final ViewHolder holder = (ViewHolder) view.getTag(); final ViewHolder holder = (ViewHolder) view.getTag(); Loading @@ -257,11 +258,16 @@ public class ChooserListAdapter extends ResolverListAdapter { holder.itemView.setBackground(holder.defaultItemViewBackground); holder.itemView.setBackground(holder.defaultItemViewBackground); } } // If the target is grouped show an indicator if (info instanceof MultiDisplayResolveInfo) { if (info instanceof MultiDisplayResolveInfo) { // If the target is grouped show an indicator Drawable bkg = mContext.getDrawable(R.drawable.chooser_group_background); Drawable bkg = mContext.getDrawable(R.drawable.chooser_group_background); holder.text.setPaddingRelative(0, 0, bkg.getIntrinsicWidth() /* end */, 0); holder.text.setPaddingRelative(0, 0, bkg.getIntrinsicWidth() /* end */, 0); holder.text.setBackground(bkg); holder.text.setBackground(bkg); } else if (info.isPinned() && getPositionTargetType(position) == TARGET_STANDARD) { // If the target is pinned and in the suggested row show a pinned indicator Drawable bkg = mContext.getDrawable(R.drawable.chooser_pinned_background); holder.text.setPaddingRelative(bkg.getIntrinsicWidth() /* start */, 0, 0, 0); holder.text.setBackground(bkg); } else { } else { holder.text.setBackground(null); holder.text.setBackground(null); holder.text.setPaddingRelative(0, 0, 0, 0); holder.text.setPaddingRelative(0, 0, 0, 0); Loading
core/java/com/android/internal/app/ResolverListAdapter.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -524,7 +524,7 @@ public class ResolverListAdapter extends BaseAdapter { if (view == null) { if (view == null) { view = createView(parent); view = createView(parent); } } onBindView(view, getItem(position)); onBindView(view, getItem(position), position); return view; return view; } } Loading @@ -541,10 +541,10 @@ public class ResolverListAdapter extends BaseAdapter { } } public final void bindView(int position, View view) { public final void bindView(int position, View view) { onBindView(view, getItem(position)); onBindView(view, getItem(position), position); } } protected void onBindView(View view, TargetInfo info) { protected void onBindView(View view, TargetInfo info, int position) { final ViewHolder holder = (ViewHolder) view.getTag(); final ViewHolder holder = (ViewHolder) view.getTag(); if (info == null) { if (info == null) { holder.icon.setImageDrawable( holder.icon.setImageDrawable( Loading
core/res/res/drawable/chooser_group_background.xml +1 −1 Original line number Original line Diff line number Diff line Loading @@ -21,5 +21,5 @@ android:width="12dp" android:width="12dp" android:height="12dp" android:height="12dp" android:start="4dp" android:start="4dp" android:end="4dp" /> android:end="0dp" /> </layer-list> </layer-list>
core/res/res/drawable/chooser_pinned_background.xml 0 → 100644 +25 −0 Original line number Original line Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2020 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"> <item android:drawable="@drawable/ic_chooser_pin" android:gravity="start|center_vertical" android:width="12dp" android:height="12dp" android:start="0dp" android:end="4dp" /> </layer-list> No newline at end of file
core/res/res/drawable/ic_chooser_pin.xml 0 → 100644 +26 −0 Original line number Original line Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2020 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="12dp" android:height="12dp" android:viewportWidth="12" android:viewportHeight="12" android:tint="?attr/textColorSecondary"> <path android:pathData="M8.5,2C8.5,1.45 8.055,1 7.5,1L4.5,1C3.95,1 3.5,1.45 3.5,2L3.5,5.5L2.5,7L2.5,8L5.5,8L5.5,10.5L6,11L6.5,10.5L6.5,8L9.5,8L9.5,7L8.5,5.5L8.5,2Z" android:fillColor="#FF000000" /> </vector>