mirror of https://github.com/M66B/FairEmail.git
Simplification
This commit is contained in:
parent
d0e17641b1
commit
27af5265f0
|
@ -225,8 +225,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
||||||
lp.width = (account < 0 || !collapsable ? 1 : level) * dp12;
|
lp.width = (account < 0 || !collapsable ? 1 : level) * dp12;
|
||||||
vwLevel.setLayoutParams(lp);
|
vwLevel.setLayoutParams(lp);
|
||||||
|
|
||||||
ivExpander.setImageResource(folder.collapsed
|
ivExpander.setImageLevel(folder.collapsed ? 1 /* more */ : 0 /* less */);
|
||||||
? R.drawable.baseline_expand_more_24 : R.drawable.baseline_expand_less_24);
|
|
||||||
ivExpander.setVisibility(account < 0 || !collapsable ? View.GONE : (folder.childs > 0 ? View.VISIBLE : View.INVISIBLE));
|
ivExpander.setVisibility(account < 0 || !collapsable ? View.GONE : (folder.childs > 0 ? View.VISIBLE : View.INVISIBLE));
|
||||||
|
|
||||||
ivNotify.setVisibility(folder.notify ? View.VISIBLE : View.GONE);
|
ivNotify.setVisibility(folder.notify ? View.VISIBLE : View.GONE);
|
||||||
|
|
|
@ -526,7 +526,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
|
|
||||||
// Expander
|
// Expander
|
||||||
boolean expanded = (viewType == ViewType.THREAD && properties.getValue("expanded", message.id));
|
boolean expanded = (viewType == ViewType.THREAD && properties.getValue("expanded", message.id));
|
||||||
ivExpander.setImageResource(expanded ? R.drawable.baseline_expand_less_24 : R.drawable.baseline_expand_more_24);
|
ivExpander.setImageLevel(expanded ? 0 /* less */ : 1 /* more */);
|
||||||
if (viewType == ViewType.THREAD && threading)
|
if (viewType == ViewType.THREAD && threading)
|
||||||
ivExpander.setVisibility(EntityFolder.DRAFTS.equals(message.folderType) ? View.INVISIBLE : View.VISIBLE);
|
ivExpander.setVisibility(EntityFolder.DRAFTS.equals(message.folderType) ? View.INVISIBLE : View.VISIBLE);
|
||||||
else
|
else
|
||||||
|
@ -774,7 +774,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
vwBody.setVisibility(show_html ? View.INVISIBLE : View.GONE);
|
vwBody.setVisibility(show_html ? View.INVISIBLE : View.GONE);
|
||||||
|
|
||||||
// Addresses
|
// Addresses
|
||||||
ivExpanderAddress.setImageResource(show_addresses ? R.drawable.baseline_expand_less_24 : R.drawable.baseline_expand_more_24);
|
ivExpanderAddress.setImageLevel(show_addresses ? 0 /* less */ : 1 /* more */);
|
||||||
|
|
||||||
String from = MessageHelper.formatAddresses(message.from);
|
String from = MessageHelper.formatAddresses(message.from);
|
||||||
String to = MessageHelper.formatAddresses(message.to);
|
String to = MessageHelper.formatAddresses(message.to);
|
||||||
|
@ -1287,7 +1287,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
boolean expanded = !properties.getValue("expanded", message.id);
|
boolean expanded = !properties.getValue("expanded", message.id);
|
||||||
properties.setValue("expanded", message.id, expanded);
|
properties.setValue("expanded", message.id, expanded);
|
||||||
|
|
||||||
ivExpander.setImageResource(expanded ? R.drawable.baseline_expand_less_24 : R.drawable.baseline_expand_more_24);
|
ivExpander.setImageLevel(expanded ? 0 /* less*/ : 1 /* more */);
|
||||||
|
|
||||||
if (expanded) {
|
if (expanded) {
|
||||||
bindExpanded(message);
|
bindExpanded(message);
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<level-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item
|
||||||
|
android:drawable="@drawable/baseline_expand_less_24"
|
||||||
|
android:maxLevel="0" />
|
||||||
|
<item
|
||||||
|
android:drawable="@drawable/baseline_expand_more_24"
|
||||||
|
android:maxLevel="1" />
|
||||||
|
</level-list>
|
|
@ -47,7 +47,7 @@
|
||||||
android:contentDescription="@string/title_legend_expander"
|
android:contentDescription="@string/title_legend_expander"
|
||||||
android:paddingStart="12dp"
|
android:paddingStart="12dp"
|
||||||
android:paddingEnd="12dp"
|
android:paddingEnd="12dp"
|
||||||
android:src="@drawable/baseline_expand_less_24"
|
android:src="@drawable/expander"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/paddingBottom"
|
app:layout_constraintBottom_toBottomOf="@+id/paddingBottom"
|
||||||
app:layout_constraintStart_toEndOf="@+id/vwLevel"
|
app:layout_constraintStart_toEndOf="@+id/vwLevel"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
android:layout_marginStart="6dp"
|
android:layout_marginStart="6dp"
|
||||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
android:contentDescription="@string/title_legend_expander"
|
android:contentDescription="@string/title_legend_expander"
|
||||||
android:src="@drawable/baseline_expand_less_24"
|
android:src="@drawable/expander"
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/paddingBottom"
|
app:layout_constraintBottom_toBottomOf="@+id/paddingBottom"
|
||||||
app:layout_constraintStart_toEndOf="@id/vwColor"
|
app:layout_constraintStart_toEndOf="@id/vwColor"
|
||||||
|
@ -339,7 +339,7 @@
|
||||||
android:layout_marginEnd="6dp"
|
android:layout_marginEnd="6dp"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
android:background="?android:attr/selectableItemBackground"
|
||||||
android:contentDescription="@string/title_legend_expander"
|
android:contentDescription="@string/title_legend_expander"
|
||||||
android:src="@drawable/baseline_expand_less_24"
|
android:src="@drawable/expander"
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
android:layout_marginStart="6dp"
|
android:layout_marginStart="6dp"
|
||||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
android:contentDescription="@string/title_legend_expander"
|
android:contentDescription="@string/title_legend_expander"
|
||||||
android:src="@drawable/baseline_expand_less_24"
|
android:src="@drawable/expander"
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/paddingBottom"
|
app:layout_constraintBottom_toBottomOf="@+id/paddingBottom"
|
||||||
app:layout_constraintStart_toEndOf="@id/vwColor"
|
app:layout_constraintStart_toEndOf="@id/vwColor"
|
||||||
|
@ -332,7 +332,7 @@
|
||||||
android:layout_marginEnd="6dp"
|
android:layout_marginEnd="6dp"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
android:background="?android:attr/selectableItemBackground"
|
||||||
android:contentDescription="@string/title_legend_expander"
|
android:contentDescription="@string/title_legend_expander"
|
||||||
android:src="@drawable/baseline_expand_less_24"
|
android:src="@drawable/expander"
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
|
Loading…
Reference in New Issue