Browse Source

Improved layout

main
M66B 6 years ago
parent
commit
3a9f457706
2 changed files with 18 additions and 17 deletions
  1. +4
    -5
      app/src/main/java/eu/faircode/email/AdapterFolder.java
  2. +14
    -12
      app/src/main/res/layout/item_folder.xml

+ 4
- 5
app/src/main/java/eu/faircode/email/AdapterFolder.java View File

@ -26,7 +26,6 @@ import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
@ -51,31 +50,31 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
View itemView;
ImageView ivEdit;
TextView tvName;
TextView tvMessages;
TextView tvType;
TextView tvAfter;
ImageView ivSync;
ImageButton ibEdit;
TextView tvError;
ViewHolder(View itemView) {
super(itemView);
this.itemView = itemView;
ivEdit = itemView.findViewById(R.id.ivEdit);
tvName = itemView.findViewById(R.id.tvName);
tvMessages = itemView.findViewById(R.id.tvMessages);
tvType = itemView.findViewById(R.id.tvType);
tvAfter = itemView.findViewById(R.id.tvAfter);
ivSync = itemView.findViewById(R.id.ivSync);
ibEdit = itemView.findViewById(R.id.ibEdit);
tvError = itemView.findViewById(R.id.tvError);
}
private void wire(boolean properties) {
itemView.setOnClickListener(this);
if (properties)
ibEdit.setOnClickListener(this);
ivEdit.setOnClickListener(this);
}
private void unwire() {
@ -116,7 +115,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
TupleFolderEx folder = filtered.get(pos);
if (view.getId() == R.id.ibEdit) {
if (view.getId() == R.id.ivEdit) {
if (!EntityFolder.OUTBOX.equals(folder.type)) {
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
lbm.sendBroadcast(


+ 14
- 12
app/src/main/res/layout/item_folder.xml View File

@ -5,6 +5,17 @@
android:layout_height="wrap_content"
android:layout_marginBottom="6dp">
<ImageView
android:id="@+id/ivEdit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:src="@drawable/baseline_edit_24"
app:layout_constraintBottom_toBottomOf="@+id/ivMessages"
app:layout_constraintEnd_toStartOf="@+id/tvName"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/ivMessages" />
<TextView
android:id="@+id/tvName"
android:layout_width="0dp"
@ -17,7 +28,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintBottom_toBottomOf="@+id/ivMessages"
app:layout_constraintEnd_toStartOf="@+id/tvAfter"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintStart_toEndOf="@id/ivEdit"
app:layout_constraintTop_toTopOf="@+id/ivMessages" />
<TextView
@ -37,7 +48,7 @@
android:layout_height="24dp"
android:layout_marginEnd="6dp"
android:src="@drawable/baseline_mail_outline_24"
app:layout_constraintEnd_toStartOf="@+id/ibEdit"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
@ -68,17 +79,8 @@
android:layout_height="24dp"
android:layout_marginEnd="6dp"
android:src="@drawable/baseline_sync_24"
app:layout_constraintEnd_toStartOf="@+id/ibEdit"
app:layout_constraintTop_toBottomOf="@id/ivMessages" />
<ImageButton
android:id="@+id/ibEdit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:src="@drawable/baseline_edit_24"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@id/ivMessages" />
<TextView
android:id="@+id/tvError"


Loading…
Cancel
Save