Browse Source

Added normal/compact message view

main
M66B 6 years ago
parent
commit
52292e6304
7 changed files with 608 additions and 22 deletions
  1. +2
    -1
      app/src/main/java/eu/faircode/email/ActivityBase.java
  2. +7
    -2
      app/src/main/java/eu/faircode/email/AdapterMessage.java
  3. +10
    -0
      app/src/main/java/eu/faircode/email/FragmentOptions.java
  4. +11
    -1
      app/src/main/res/layout/fragment_options.xml
  5. +532
    -0
      app/src/main/res/layout/item_message_compact.xml
  6. +45
    -18
      app/src/main/res/layout/item_message_normal.xml
  7. +1
    -0
      app/src/main/res/values/strings.xml

+ 2
- 1
app/src/main/java/eu/faircode/email/ActivityBase.java View File

@ -69,7 +69,8 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
@Override @Override
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) { public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
Log.i(Helper.TAG, "Preference " + key + "=" + prefs.getAll().get(key)); Log.i(Helper.TAG, "Preference " + key + "=" + prefs.getAll().get(key));
if ("theme".equals(key) || "debug".equals(key)) {
if ("theme".equals(key) ||
(!this.getClass().equals(ActivitySetup.class) && ("compact".equals(key) || "debug".equals(key)))) {
finish(); finish();
startActivity(getIntent()); startActivity(getIntent());
} }


+ 7
- 2
app/src/main/java/eu/faircode/email/AdapterMessage.java View File

@ -106,6 +106,7 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
private boolean contacts; private boolean contacts;
private boolean avatars; private boolean avatars;
private boolean compact;
private boolean debug; private boolean debug;
private DateFormat df = SimpleDateFormat.getDateTimeInstance(SimpleDateFormat.LONG, SimpleDateFormat.LONG); private DateFormat df = SimpleDateFormat.getDateTimeInstance(SimpleDateFormat.LONG, SimpleDateFormat.LONG);
@ -279,7 +280,7 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
else else
ivFlagged.setVisibility(message.count - message.unflagged > 0 ? View.VISIBLE : View.GONE); ivFlagged.setVisibility(message.count - message.unflagged > 0 ? View.VISIBLE : View.GONE);
tvFrom.setText(MessageHelper.getFormattedAddresses(message.from, false));
tvFrom.setText(MessageHelper.getFormattedAddresses(message.from, !compact));
if (EntityFolder.DRAFTS.equals(message.folderType) || if (EntityFolder.DRAFTS.equals(message.folderType) ||
EntityFolder.OUTBOX.equals(message.folderType) || EntityFolder.OUTBOX.equals(message.folderType) ||
@ -1349,6 +1350,7 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
this.contacts = (ContextCompat.checkSelfPermission(context, Manifest.permission.READ_CONTACTS) this.contacts = (ContextCompat.checkSelfPermission(context, Manifest.permission.READ_CONTACTS)
== PackageManager.PERMISSION_GRANTED); == PackageManager.PERMISSION_GRANTED);
this.avatars = (prefs.getBoolean("avatars", true) && this.contacts); this.avatars = (prefs.getBoolean("avatars", true) && this.contacts);
this.compact = prefs.getBoolean("compact", false);
this.debug = prefs.getBoolean("debug", false); this.debug = prefs.getBoolean("debug", false);
} }
@ -1370,7 +1372,10 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
@Override @Override
@NonNull @NonNull
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new ViewHolder(LayoutInflater.from(context).inflate(R.layout.item_message, parent, false));
return new ViewHolder(LayoutInflater.from(context).inflate(
compact ? R.layout.item_message_compact : R.layout.item_message_normal,
parent,
false));
} }
@Override @Override


+ 10
- 0
app/src/main/java/eu/faircode/email/FragmentOptions.java View File

@ -37,6 +37,7 @@ public class FragmentOptions extends FragmentEx {
private CheckBox cbLight; private CheckBox cbLight;
private CheckBox cbBrowse; private CheckBox cbBrowse;
private CheckBox cbSwipe; private CheckBox cbSwipe;
private CheckBox cbCompact;
private CheckBox cbDebug; private CheckBox cbDebug;
@Override @Override
@ -52,6 +53,7 @@ public class FragmentOptions extends FragmentEx {
cbLight = view.findViewById(R.id.cbLight); cbLight = view.findViewById(R.id.cbLight);
cbBrowse = view.findViewById(R.id.cbBrowse); cbBrowse = view.findViewById(R.id.cbBrowse);
cbSwipe = view.findViewById(R.id.cbSwipe); cbSwipe = view.findViewById(R.id.cbSwipe);
cbCompact = view.findViewById(R.id.cbCompact);
cbDebug = view.findViewById(R.id.cbDebug); cbDebug = view.findViewById(R.id.cbDebug);
// Wire controls // Wire controls
@ -102,6 +104,14 @@ public class FragmentOptions extends FragmentEx {
} }
}); });
cbCompact.setChecked(prefs.getBoolean("compact", false));
cbCompact.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("compact", checked).apply();
}
});
cbDebug.setChecked(prefs.getBoolean("debug", false)); cbDebug.setChecked(prefs.getBoolean("debug", false));
cbDebug.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { cbDebug.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override


+ 11
- 1
app/src/main/res/layout/fragment_options.xml View File

@ -61,6 +61,16 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbBrowse" /> app:layout_constraintTop_toBottomOf="@id/cbBrowse" />
<CheckBox
android:id="@+id/cbCompact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_compact"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbSwipe" />
<CheckBox <CheckBox
android:id="@+id/cbDebug" android:id="@+id/cbDebug"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -69,6 +79,6 @@
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:text="@string/title_advanced_debug" android:text="@string/title_advanced_debug"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbSwipe" />
app:layout_constraintTop_toBottomOf="@id/cbCompact" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView> </ScrollView>

+ 532
- 0
app/src/main/res/layout/item_message_compact.xml View File

@ -0,0 +1,532 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/drawableItemBackground">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clItem"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<View
android:id="@+id/vwColor"
android:layout_width="6dp"
android:layout_height="0dp"
android:background="@color/colorAccent"
app:layout_constraintBottom_toTopOf="@id/vSeparator"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/paddingTop"
android:layout_width="match_parent"
android:layout_height="12dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/ivExpander"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_gravity="center_vertical|center_horizontal"
android:src="@drawable/baseline_expand_less_24"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="@+id/paddingBottom"
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toTopOf="@id/paddingTop" />
<View
android:id="@+id/paddingStart"
android:layout_width="6dp"
android:layout_height="0dp"
android:visibility="gone"
app:layout_constraintStart_toEndOf="@+id/ivExpander"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/ivFlagged"
android:layout_width="21dp"
android:layout_height="21dp"
android:layout_marginStart="6dp"
android:src="@drawable/baseline_star_24"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="@id/tvFrom"
app:layout_constraintStart_toEndOf="@id/paddingStart"
app:layout_constraintTop_toTopOf="@+id/tvFrom" />
<ImageView
android:id="@+id/ivAvatar"
android:layout_width="0dp"
android:layout_height="24dp"
android:layout_marginStart="6dp"
android:src="@drawable/baseline_person_24"
app:layout_constraintBottom_toBottomOf="@+id/tvFrom"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintStart_toEndOf="@id/ivFlagged"
app:layout_constraintTop_toTopOf="@+id/tvFrom" />
<TextView
android:id="@+id/tvFrom"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:ellipsize="end"
android:maxLines="1"
android:text="From"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintEnd_toStartOf="@+id/tvSize"
app:layout_constraintStart_toEndOf="@id/ivAvatar"
app:layout_constraintTop_toBottomOf="@id/paddingTop" />
<TextView
android:id="@+id/tvSize"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:maxLines="1"
android:text="123 KB"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintBottom_toBottomOf="@id/tvFrom"
app:layout_constraintEnd_toStartOf="@id/tvTime"
app:layout_constraintTop_toTopOf="@id/tvFrom" />
<TextView
android:id="@+id/tvTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:maxLines="1"
android:text="Time"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintBottom_toBottomOf="@id/tvFrom"
app:layout_constraintEnd_toStartOf="@+id/paddingEnd"
app:layout_constraintTop_toTopOf="@id/tvFrom" />
<ImageView
android:id="@+id/ivAttachments"
android:layout_width="21dp"
android:layout_height="21dp"
android:layout_marginStart="6dp"
android:src="@drawable/baseline_attachment_24"
app:layout_constraintBottom_toBottomOf="@id/tvSubject"
app:layout_constraintStart_toEndOf="@id/paddingStart"
app:layout_constraintTop_toTopOf="@+id/tvSubject" />
<TextView
android:id="@+id/tvSubject"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:ellipsize="end"
android:maxLines="1"
android:text="Subject"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toStartOf="@+id/tvFolder"
app:layout_constraintStart_toEndOf="@id/ivAttachments"
app:layout_constraintTop_toBottomOf="@id/tvFrom" />
<TextView
android:id="@+id/tvFolder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:maxLines="1"
android:text="folder"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintBottom_toBottomOf="@id/tvSubject"
app:layout_constraintEnd_toStartOf="@+id/tvCount"
app:layout_constraintTop_toTopOf="@id/tvSubject" />
<TextView
android:id="@+id/tvCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="3dp"
android:maxLines="1"
android:text="3"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintBottom_toBottomOf="@id/tvSubject"
app:layout_constraintEnd_toStartOf="@+id/ivThread"
app:layout_constraintTop_toTopOf="@id/tvSubject" />
<ImageView
android:id="@+id/ivThread"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_marginEnd="6dp"
android:src="@drawable/baseline_message_24"
app:layout_constraintBottom_toBottomOf="@id/tvSubject"
app:layout_constraintEnd_toStartOf="@+id/paddingEnd"
app:layout_constraintTop_toTopOf="@id/tvSubject" />
<TextView
android:id="@+id/tvError"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:text="error"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?attr/colorWarning"
android:textIsSelectable="true"
app:layout_constraintEnd_toStartOf="@+id/paddingEnd"
app:layout_constraintStart_toEndOf="@id/paddingStart"
app:layout_constraintTop_toBottomOf="@id/tvSubject" />
<View
android:id="@+id/paddingEnd"
android:layout_width="6dp"
android:layout_height="0dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/paddingBottom"
android:layout_width="match_parent"
android:layout_height="12dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvError" />
<ProgressBar
android:id="@+id/pbLoading"
style="@style/Base.Widget.AppCompat.ProgressBar"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="12dp"
android:indeterminate="true"
app:layout_constraintBottom_toBottomOf="@id/paddingBottom"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/vSeparatorAddress"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="3dp"
android:background="?attr/colorSeparator"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@id/paddingBottom" />
<TextView
android:id="@+id/tvFromExTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:text="@string/title_from"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@id/vSeparatorAddress" />
<TextView
android:id="@+id/tvFromEx"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:maxHeight="60dp"
android:scrollbars="vertical"
android:text="From"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textIsSelectable="true"
app:layout_constraintEnd_toStartOf="@+id/ivAddContact"
app:layout_constraintStart_toEndOf="@id/tvFromExTitle"
app:layout_constraintTop_toBottomOf="@id/vSeparatorAddress" />
<ImageView
android:id="@+id/ivAddContact"
android:layout_width="21dp"
android:layout_height="21dp"
android:layout_marginEnd="6dp"
android:src="@drawable/baseline_import_contacts_24"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparatorAddress" />
<TextView
android:id="@+id/tvToTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:text="@string/title_to"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@id/tvFromEx" />
<TextView
android:id="@+id/tvTo"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:maxHeight="60dp"
android:scrollbars="vertical"
android:text="To"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textIsSelectable="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tvToTitle"
app:layout_constraintTop_toBottomOf="@id/tvFromEx" />
<TextView
android:id="@+id/tvReplyToTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:text="@string/title_reply_to"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@id/tvTo" />
<TextView
android:id="@+id/tvReplyTo"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:maxHeight="60dp"
android:scrollbars="vertical"
android:text="Reply to"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textIsSelectable="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tvReplyToTitle"
app:layout_constraintTop_toBottomOf="@id/tvTo" />
<TextView
android:id="@+id/tvCcTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:text="@string/title_cc"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@id/tvReplyTo" />
<TextView
android:id="@+id/tvCc"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:maxHeight="60dp"
android:scrollbars="vertical"
android:text="Cc"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textIsSelectable="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tvCcTitle"
app:layout_constraintTop_toBottomOf="@id/tvReplyTo" />
<TextView
android:id="@+id/tvBccTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:text="@string/title_bcc"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@id/tvCc" />
<TextView
android:id="@+id/tvBcc"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:maxHeight="60dp"
android:scrollbars="vertical"
android:text="Bcc"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textIsSelectable="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tvBccTitle"
app:layout_constraintTop_toBottomOf="@id/tvCc" />
<TextView
android:id="@+id/tvTimeEx"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:text="12:34:56"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textIsSelectable="true"
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@id/tvBcc" />
<TextView
android:id="@+id/tvSubjectEx"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:maxHeight="60dp"
android:scrollbars="vertical"
android:text="Subject"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textIsSelectable="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@id/tvTimeEx" />
<View
android:id="@+id/vSeparatorHeaders"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="3dp"
android:background="?attr/colorSeparator"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@id/tvSubjectEx" />
<TextView
android:id="@+id/tvHeaders"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="6dp"
android:fontFamily="monospace"
android:text="Headers"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textIsSelectable="true"
android:textSize="12sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@id/vSeparatorHeaders" />
<ProgressBar
android:id="@+id/pbHeaders"
style="@style/Base.Widget.AppCompat.ProgressBar"
android:layout_width="24dp"
android:layout_height="24dp"
android:indeterminate="true"
app:layout_constraintBottom_toTopOf="@+id/bnvActions"
app:layout_constraintEnd_toEndOf="@id/tvHeaders"
app:layout_constraintStart_toStartOf="@id/tvHeaders"
app:layout_constraintTop_toBottomOf="@id/vSeparatorHeaders" />
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bnvActions"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:background="?attr/colorSeparator"
app:itemIconTint="@color/bottomnav_background"
app:itemTextColor="@color/bottomnav_background"
app:labelVisibilityMode="labeled"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@id/tvHeaders"
app:menu="@menu/action_message" />
<View
android:id="@+id/vSeparatorBody"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="3dp"
android:background="?attr/colorSeparator"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@id/bnvActions" />
<Button
android:id="@+id/btnImages"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:layout_marginEnd="6dp"
android:minWidth="0dp"
android:minHeight="0dp"
android:text="@string/title_show_images"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparatorBody" />
<TextView
android:id="@+id/tvBody"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="6dp"
android:fontFamily="monospace"
android:minHeight="60dp"
android:text="Body"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textIsSelectable="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@id/btnImages" />
<ProgressBar
android:id="@+id/pbBody"
style="@style/Base.Widget.AppCompat.ProgressBar"
android:layout_width="24dp"
android:layout_height="24dp"
android:indeterminate="true"
app:layout_constraintBottom_toTopOf="@+id/vSeparatorAttachments"
app:layout_constraintEnd_toEndOf="@id/tvBody"
app:layout_constraintStart_toStartOf="@id/tvBody"
app:layout_constraintTop_toBottomOf="@id/bnvActions" />
<View
android:id="@+id/vSeparatorAttachments"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="3dp"
android:background="?attr/colorSeparator"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@id/tvBody" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvAttachment"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="6dp"
android:scrollbarStyle="outsideOverlay"
android:scrollbars="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@+id/vSeparatorAttachments" />
<View
android:id="@+id/vSeparator"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="3dp"
android:background="?attr/colorSeparator"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/rvAttachment" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpHeaders"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="vSeparatorHeaders,tvHeaders" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpAttachments"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="vSeparatorAttachments,rvAttachment" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpExpanded"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="vSeparatorAddress,tvFromExTitle,tvFromEx,tvToTitle,tvTo,tvReplyToTitle,tvReplyTo,tvCcTitle,tvCc,tvBccTitle,tvBcc,tvTimeEx,tvSubjectEx,tvBody" />
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

app/src/main/res/layout/item_message.xml → app/src/main/res/layout/item_message_normal.xml View File

@ -19,6 +19,14 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/paddingTop"
android:layout_width="match_parent"
android:layout_height="12dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView <ImageView
android:id="@+id/ivExpander" android:id="@+id/ivExpander"
android:layout_width="32dp" android:layout_width="32dp"
@ -26,8 +34,15 @@
android:layout_gravity="center_vertical|center_horizontal" android:layout_gravity="center_vertical|center_horizontal"
android:src="@drawable/baseline_expand_less_24" android:src="@drawable/baseline_expand_less_24"
android:visibility="visible" android:visibility="visible"
app:layout_constraintBottom_toBottomOf="@id/tvError"
app:layout_constraintBottom_toBottomOf="@+id/paddingBottom"
app:layout_constraintStart_toEndOf="@id/vwColor" app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toTopOf="@id/paddingTop" />
<View
android:id="@+id/paddingStart"
android:layout_width="6dp"
android:layout_height="0dp"
app:layout_constraintStart_toEndOf="@+id/ivExpander"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<ImageView <ImageView
@ -38,13 +53,13 @@
android:src="@drawable/baseline_star_24" android:src="@drawable/baseline_star_24"
android:visibility="visible" android:visibility="visible"
app:layout_constraintBottom_toBottomOf="@id/tvFrom" app:layout_constraintBottom_toBottomOf="@id/tvFrom"
app:layout_constraintStart_toEndOf="@id/ivExpander"
app:layout_constraintStart_toEndOf="@id/paddingStart"
app:layout_constraintTop_toTopOf="@+id/tvFrom" /> app:layout_constraintTop_toTopOf="@+id/tvFrom" />
<ImageView <ImageView
android:id="@+id/ivAvatar" android:id="@+id/ivAvatar"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp"
android:layout_height="24dp"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:src="@drawable/baseline_person_24" android:src="@drawable/baseline_person_24"
app:layout_constraintBottom_toBottomOf="@+id/tvFrom" app:layout_constraintBottom_toBottomOf="@+id/tvFrom"
@ -59,12 +74,11 @@
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1"
android:text="From" android:text="From"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintEnd_toStartOf="@+id/tvSize" app:layout_constraintEnd_toStartOf="@+id/tvSize"
app:layout_constraintStart_toEndOf="@id/ivAvatar" app:layout_constraintStart_toEndOf="@id/ivAvatar"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@id/paddingTop" />
<TextView <TextView
android:id="@+id/tvSize" android:id="@+id/tvSize"
@ -87,7 +101,7 @@
android:text="Time" android:text="Time"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintBottom_toBottomOf="@id/tvFrom" app:layout_constraintBottom_toBottomOf="@id/tvFrom"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintEnd_toStartOf="@+id/paddingEnd"
app:layout_constraintTop_toTopOf="@id/tvFrom" /> app:layout_constraintTop_toTopOf="@id/tvFrom" />
<ImageView <ImageView
@ -97,7 +111,7 @@
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:src="@drawable/baseline_attachment_24" android:src="@drawable/baseline_attachment_24"
app:layout_constraintBottom_toBottomOf="@id/tvSubject" app:layout_constraintBottom_toBottomOf="@id/tvSubject"
app:layout_constraintStart_toEndOf="@id/ivExpander"
app:layout_constraintStart_toEndOf="@id/paddingStart"
app:layout_constraintTop_toTopOf="@+id/tvSubject" /> app:layout_constraintTop_toTopOf="@+id/tvSubject" />
<TextView <TextView
@ -107,7 +121,6 @@
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1"
android:text="Subject" android:text="Subject"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toStartOf="@+id/tvFolder" app:layout_constraintEnd_toStartOf="@+id/tvFolder"
@ -123,7 +136,8 @@
android:text="folder" android:text="folder"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintBottom_toBottomOf="@id/tvSubject" app:layout_constraintBottom_toBottomOf="@id/tvSubject"
app:layout_constraintEnd_toStartOf="@+id/tvCount" />
app:layout_constraintEnd_toStartOf="@+id/tvCount"
app:layout_constraintTop_toTopOf="@id/tvSubject" />
<TextView <TextView
android:id="@+id/tvCount" android:id="@+id/tvCount"
@ -134,7 +148,8 @@
android:text="3" android:text="3"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintBottom_toBottomOf="@id/tvSubject" app:layout_constraintBottom_toBottomOf="@id/tvSubject"
app:layout_constraintEnd_toStartOf="@+id/ivThread" />
app:layout_constraintEnd_toStartOf="@+id/ivThread"
app:layout_constraintTop_toTopOf="@id/tvSubject" />
<ImageView <ImageView
android:id="@+id/ivThread" android:id="@+id/ivThread"
@ -143,7 +158,7 @@
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:src="@drawable/baseline_message_24" android:src="@drawable/baseline_message_24"
app:layout_constraintBottom_toBottomOf="@id/tvSubject" app:layout_constraintBottom_toBottomOf="@id/tvSubject"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintEnd_toStartOf="@+id/paddingEnd"
app:layout_constraintTop_toTopOf="@id/tvSubject" /> app:layout_constraintTop_toTopOf="@id/tvSubject" />
<TextView <TextView
@ -156,10 +171,25 @@
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?attr/colorWarning" android:textColor="?attr/colorWarning"
android:textIsSelectable="true" android:textIsSelectable="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/ivExpander"
app:layout_constraintEnd_toStartOf="@+id/paddingEnd"
app:layout_constraintStart_toEndOf="@id/paddingStart"
app:layout_constraintTop_toBottomOf="@id/tvSubject" /> app:layout_constraintTop_toBottomOf="@id/tvSubject" />
<View
android:id="@+id/paddingEnd"
android:layout_width="6dp"
android:layout_height="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/paddingBottom"
android:layout_width="match_parent"
android:layout_height="12dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvError" />
<ProgressBar <ProgressBar
android:id="@+id/pbLoading" android:id="@+id/pbLoading"
style="@style/Base.Widget.AppCompat.ProgressBar" style="@style/Base.Widget.AppCompat.ProgressBar"
@ -167,7 +197,7 @@
android:layout_height="24dp" android:layout_height="24dp"
android:layout_marginStart="12dp" android:layout_marginStart="12dp"
android:indeterminate="true" android:indeterminate="true"
app:layout_constraintBottom_toBottomOf="@id/tvError"
app:layout_constraintBottom_toBottomOf="@id/paddingBottom"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@ -180,7 +210,7 @@
android:background="?attr/colorSeparator" android:background="?attr/colorSeparator"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/vwColor" app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@id/tvError" />
app:layout_constraintTop_toBottomOf="@id/paddingBottom" />
<TextView <TextView
android:id="@+id/tvFromExTitle" android:id="@+id/tvFromExTitle"
@ -479,21 +509,18 @@
android:id="@+id/grpHeaders" android:id="@+id/grpHeaders"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:visibility="visible"
app:constraint_referenced_ids="vSeparatorHeaders,tvHeaders" /> app:constraint_referenced_ids="vSeparatorHeaders,tvHeaders" />
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
android:id="@+id/grpAttachments" android:id="@+id/grpAttachments"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:visibility="visible"
app:constraint_referenced_ids="vSeparatorAttachments,rvAttachment" /> app:constraint_referenced_ids="vSeparatorAttachments,rvAttachment" />
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
android:id="@+id/grpExpanded" android:id="@+id/grpExpanded"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:visibility="visible"
app:constraint_referenced_ids="vSeparatorAddress,tvFromExTitle,tvFromEx,tvToTitle,tvTo,tvReplyToTitle,tvReplyTo,tvCcTitle,tvCc,tvBccTitle,tvBcc,tvTimeEx,tvSubjectEx,tvBody" /> app:constraint_referenced_ids="vSeparatorAddress,tvFromExTitle,tvFromEx,tvToTitle,tvTo,tvReplyToTitle,tvReplyTo,tvCcTitle,tvCc,tvBccTitle,tvBcc,tvTimeEx,tvSubjectEx,tvBody" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout> </FrameLayout>

+ 1
- 0
app/src/main/res/values/strings.xml View File

@ -84,6 +84,7 @@
<string name="title_advanced_light">Use notification light</string> <string name="title_advanced_light">Use notification light</string>
<string name="title_advanced_browse">Browse messages on the server</string> <string name="title_advanced_browse">Browse messages on the server</string>
<string name="title_advanced_swipe">Swipe actions</string> <string name="title_advanced_swipe">Swipe actions</string>
<string name="title_advanced_compact">Compact message view</string>
<string name="title_advanced_debug">Debug mode</string> <string name="title_advanced_debug">Debug mode</string>
<string name="title_select">Select &#8230;</string> <string name="title_select">Select &#8230;</string>


Loading…
Cancel
Save