mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 04:35:57 +00:00
Simplification
This commit is contained in:
parent
d0e17641b1
commit
27af5265f0
6 changed files with 18 additions and 10 deletions
|
@ -225,8 +225,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
|||
lp.width = (account < 0 || !collapsable ? 1 : level) * dp12;
|
||||
vwLevel.setLayoutParams(lp);
|
||||
|
||||
ivExpander.setImageResource(folder.collapsed
|
||||
? R.drawable.baseline_expand_more_24 : R.drawable.baseline_expand_less_24);
|
||||
ivExpander.setImageLevel(folder.collapsed ? 1 /* more */ : 0 /* less */);
|
||||
ivExpander.setVisibility(account < 0 || !collapsable ? View.GONE : (folder.childs > 0 ? View.VISIBLE : View.INVISIBLE));
|
||||
|
||||
ivNotify.setVisibility(folder.notify ? View.VISIBLE : View.GONE);
|
||||
|
|
|
@ -526,7 +526,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
|
||||
// Expander
|
||||
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)
|
||||
ivExpander.setVisibility(EntityFolder.DRAFTS.equals(message.folderType) ? View.INVISIBLE : View.VISIBLE);
|
||||
else
|
||||
|
@ -774,7 +774,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
vwBody.setVisibility(show_html ? View.INVISIBLE : View.GONE);
|
||||
|
||||
// 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 to = MessageHelper.formatAddresses(message.to);
|
||||
|
@ -1287,7 +1287,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
boolean expanded = !properties.getValue("expanded", message.id);
|
||||
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) {
|
||||
bindExpanded(message);
|
||||
|
|
9
app/src/main/res/drawable/expander.xml
Normal file
9
app/src/main/res/drawable/expander.xml
Normal file
|
@ -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:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:src="@drawable/baseline_expand_less_24"
|
||||
android:src="@drawable/expander"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/paddingBottom"
|
||||
app:layout_constraintStart_toEndOf="@+id/vwLevel"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
android:layout_marginStart="6dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/title_legend_expander"
|
||||
android:src="@drawable/baseline_expand_less_24"
|
||||
android:src="@drawable/expander"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/paddingBottom"
|
||||
app:layout_constraintStart_toEndOf="@id/vwColor"
|
||||
|
@ -339,7 +339,7 @@
|
|||
android:layout_marginEnd="6dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/title_legend_expander"
|
||||
android:src="@drawable/baseline_expand_less_24"
|
||||
android:src="@drawable/expander"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
android:layout_marginStart="6dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/title_legend_expander"
|
||||
android:src="@drawable/baseline_expand_less_24"
|
||||
android:src="@drawable/expander"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/paddingBottom"
|
||||
app:layout_constraintStart_toEndOf="@id/vwColor"
|
||||
|
@ -332,7 +332,7 @@
|
|||
android:layout_marginEnd="6dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/title_legend_expander"
|
||||
android:src="@drawable/baseline_expand_less_24"
|
||||
android:src="@drawable/expander"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
Loading…
Reference in a new issue