Show folder type

This commit is contained in:
M66B 2019-05-22 16:29:18 +02:00
parent eeee0e61b9
commit faaa1b432d
5 changed files with 72 additions and 32 deletions

View File

@ -100,6 +100,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
private TextView tvName;
private TextView tvMessages;
private ImageView ivMessages;
private ImageView ivType;
private ImageView ivUnified;
private TextView tvType;
private TextView tvAfter;
@ -129,6 +130,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
tvName = itemView.findViewById(R.id.tvName);
tvMessages = itemView.findViewById(R.id.tvMessages);
ivMessages = itemView.findViewById(R.id.ivMessages);
ivType = itemView.findViewById(R.id.ivType);
ivUnified = itemView.findViewById(R.id.ivUnified);
tvType = itemView.findViewById(R.id.tvType);
tvAfter = itemView.findViewById(R.id.tvAfter);
@ -264,6 +266,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
ivMessages.setImageResource(folder.download || EntityFolder.OUTBOX.equals(folder.type)
? R.drawable.baseline_mail_24 : R.drawable.baseline_mail_outline_24);
ivType.setImageResource(EntityFolder.getIcon(folder.type));
ivUnified.setVisibility(account > 0 && folder.unified ? View.VISIBLE : View.GONE);
if (account < 0)

View File

@ -205,6 +205,8 @@ public class EntityFolder extends EntityOrder implements Serializable {
return R.drawable.baseline_inbox_24;
if (EntityFolder.DRAFTS.equals(type))
return R.drawable.baseline_drafts_24;
if (EntityFolder.SENT.equals(type))
return R.drawable.baseline_send_24;
if (EntityFolder.ARCHIVE.equals(type))
return R.drawable.baseline_archive_24;
if (EntityFolder.TRASH.equals(type))

View File

@ -18,7 +18,7 @@
android:layout_height="wrap_content">
<ImageView
android:id="@+id/ivUnified"
android:id="@+id/ivType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/title_legend_unified"
@ -34,10 +34,10 @@
android:gravity="center_vertical"
android:text="@string/title_legend_unified"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintBottom_toBottomOf="@id/ivUnified"
app:layout_constraintBottom_toBottomOf="@id/ivType"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/ivUnified"
app:layout_constraintTop_toTopOf="@id/ivUnified" />
app:layout_constraintStart_toEndOf="@id/ivType"
app:layout_constraintTop_toTopOf="@id/ivType" />
<ImageView
android:id="@+id/ivInbox"
@ -47,7 +47,7 @@
android:padding="12dp"
android:src="@drawable/baseline_inbox_24"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ivUnified" />
app:layout_constraintTop_toBottomOf="@id/ivType" />
<TextView
android:id="@+id/tvInbox"
@ -61,28 +61,6 @@
app:layout_constraintStart_toEndOf="@id/ivInbox"
app:layout_constraintTop_toTopOf="@id/ivInbox" />
<ImageView
android:id="@+id/ivArchive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/title_legend_archive"
android:padding="12dp"
android:src="@drawable/baseline_archive_24"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ivInbox" />
<TextView
android:id="@+id/tvArchive"
android:layout_width="0dp"
android:layout_height="0dp"
android:gravity="center_vertical"
android:text="@string/title_legend_archive"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintBottom_toBottomOf="@id/ivArchive"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/ivArchive"
app:layout_constraintTop_toTopOf="@id/ivArchive" />
<ImageView
android:id="@+id/ivDrafts"
android:layout_width="wrap_content"
@ -91,7 +69,7 @@
android:padding="12dp"
android:src="@drawable/baseline_drafts_24"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ivArchive" />
app:layout_constraintTop_toBottomOf="@id/ivInbox" />
<TextView
android:id="@+id/tvDrafts"
@ -105,6 +83,50 @@
app:layout_constraintStart_toEndOf="@id/ivDrafts"
app:layout_constraintTop_toTopOf="@id/ivDrafts" />
<ImageView
android:id="@+id/ivSent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/title_legend_sent"
android:padding="12dp"
android:src="@drawable/baseline_send_24"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ivDrafts" />
<TextView
android:id="@+id/tvSent"
android:layout_width="0dp"
android:layout_height="0dp"
android:gravity="center_vertical"
android:text="@string/title_legend_sent"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintBottom_toBottomOf="@id/ivSent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/ivSent"
app:layout_constraintTop_toTopOf="@id/ivSent" />
<ImageView
android:id="@+id/ivArchive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/title_legend_archive"
android:padding="12dp"
android:src="@drawable/baseline_archive_24"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ivSent" />
<TextView
android:id="@+id/tvArchive"
android:layout_width="0dp"
android:layout_height="0dp"
android:gravity="center_vertical"
android:text="@string/title_legend_archive"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintBottom_toBottomOf="@id/ivArchive"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/ivArchive"
app:layout_constraintTop_toTopOf="@id/ivArchive" />
<ImageView
android:id="@+id/ivTrash"
android:layout_width="wrap_content"
@ -113,7 +135,7 @@
android:padding="12dp"
android:src="@drawable/baseline_delete_24"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ivDrafts" />
app:layout_constraintTop_toBottomOf="@id/ivArchive" />
<TextView
android:id="@+id/tvTrash"

View File

@ -61,15 +61,26 @@
app:layout_constraintStart_toEndOf="@+id/vwLevel"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/ivType"
android:layout_width="30dp"
android:layout_height="24dp"
android:contentDescription="@string/title_legend_folder_tye"
android:paddingEnd="6dp"
android:src="@drawable/baseline_inbox_24"
app:layout_constraintBottom_toBottomOf="@+id/tvType"
app:layout_constraintStart_toEndOf="@id/ivExpander"
app:layout_constraintTop_toTopOf="@+id/tvType" />
<ImageView
android:id="@+id/ivUnified"
android:layout_width="30dp"
android:layout_height="24dp"
android:contentDescription="@string/title_legend_unified"
android:contentDescription="@string/title_unified_folder"
android:paddingEnd="6dp"
android:src="@drawable/baseline_folder_special_24"
app:layout_constraintBottom_toBottomOf="@+id/tvType"
app:layout_constraintStart_toEndOf="@id/ivExpander"
app:layout_constraintStart_toEndOf="@id/ivType"
app:layout_constraintTop_toTopOf="@+id/tvType" />
<ImageView

View File

@ -595,8 +595,9 @@
<string name="title_legend_unified">Unified inbox / primary account</string>
<string name="title_legend_inbox">Inbox</string>
<string name="title_legend_archive">Archive</string>
<string name="title_legend_drafts">Drafts</string>
<string name="title_legend_sent">Sent</string>
<string name="title_legend_archive">Archive</string>
<string name="title_legend_trash">Trash</string>
<string name="title_legend_junk">Spam</string>
<string name="title_legend_primary">Primary</string>
@ -656,6 +657,7 @@
<string name="title_legend_save">Save</string>
<string name="title_legend_delete">Delete</string>
<string name="title_legend_count">Count</string>
<string name="title_legend_folder_tye">Folders type</string>
<string name="title_hint_folder_actions">Long press for options</string>
<string name="title_hint_folder_sync">To limit battery and network usage not all folders and not all messages will be synchronized by default</string>