From 52292e630466e531adf9a3a0f09ab50bdf454ec8 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 21 Oct 2018 16:53:56 +0000 Subject: [PATCH] Added normal/compact message view --- .../java/eu/faircode/email/ActivityBase.java | 3 +- .../eu/faircode/email/AdapterMessage.java | 9 +- .../eu/faircode/email/FragmentOptions.java | 10 + app/src/main/res/layout/fragment_options.xml | 12 +- .../main/res/layout/item_message_compact.xml | 532 ++++++++++++++++++ ...em_message.xml => item_message_normal.xml} | 63 ++- app/src/main/res/values/strings.xml | 1 + 7 files changed, 608 insertions(+), 22 deletions(-) create mode 100644 app/src/main/res/layout/item_message_compact.xml rename app/src/main/res/layout/{item_message.xml => item_message_normal.xml} (92%) diff --git a/app/src/main/java/eu/faircode/email/ActivityBase.java b/app/src/main/java/eu/faircode/email/ActivityBase.java index 275fd086..d50bba02 100644 --- a/app/src/main/java/eu/faircode/email/ActivityBase.java +++ b/app/src/main/java/eu/faircode/email/ActivityBase.java @@ -69,7 +69,8 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc @Override public void onSharedPreferenceChanged(SharedPreferences prefs, String 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(); startActivity(getIntent()); } diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 59a70237..03cb586f 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -106,6 +106,7 @@ public class AdapterMessage extends PagedListAdapter 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) || EntityFolder.OUTBOX.equals(message.folderType) || @@ -1349,6 +1350,7 @@ public class AdapterMessage extends PagedListAdapter + + + app:layout_constraintTop_toBottomOf="@id/cbCompact" /> \ No newline at end of file diff --git a/app/src/main/res/layout/item_message_compact.xml b/app/src/main/res/layout/item_message_compact.xml new file mode 100644 index 00000000..4143259d --- /dev/null +++ b/app/src/main/res/layout/item_message_compact.xml @@ -0,0 +1,532 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +