Show folder type icon in move dialog

This commit is contained in:
M66B 2020-08-15 18:38:05 +02:00
parent 825debc9ba
commit 4dfa0b2219
2 changed files with 20 additions and 0 deletions

View File

@ -7283,11 +7283,13 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
static class Folder implements Serializable {
long id;
String type;
String name;
String display;
Folder(Context context, EntityFolder folder) {
this.id = folder.id;
this.type = folder.type;
this.name = folder.name;
this.display = folder.getDisplayName(context);
}
@ -7552,6 +7554,20 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
tvSourceFolders.setText(getDisplay(result, false));
tvTargetFolders.setText(getDisplay(result, true));
Drawable source = null;
Drawable target = null;
if (result.size() == 1) {
source = getResources().getDrawable(EntityFolder.getIcon(result.get(0).sourceFolder.type), null);
target = getResources().getDrawable(EntityFolder.getIcon(result.get(0).targetFolder.type), null);
if (source != null)
source.setBounds(0, 0, source.getIntrinsicWidth(), source.getIntrinsicHeight());
if (target != null)
target.setBounds(0, 0, target.getIntrinsicWidth(), source.getIntrinsicHeight());
}
tvSourceFolders.setCompoundDrawablesRelative(source, null, null, null);
tvTargetFolders.setCompoundDrawablesRelative(target, null, null, null);
if (notagain != null)
cbNotAgain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override

View File

@ -26,6 +26,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:drawableStart="@drawable/baseline_inbox_24"
android:drawablePadding="6dp"
android:text="Source folders"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="?android:attr/textColorPrimary"
@ -49,6 +51,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:drawableStart="@drawable/baseline_archive_24"
android:drawablePadding="6dp"
android:text="Target folders"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="?android:attr/textColorPrimary"