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.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; 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 { public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
View itemView; View itemView;
ImageView ivEdit;
TextView tvName; TextView tvName;
TextView tvMessages; TextView tvMessages;
TextView tvType; TextView tvType;
TextView tvAfter; TextView tvAfter;
ImageView ivSync; ImageView ivSync;
ImageButton ibEdit;
TextView tvError; TextView tvError;
ViewHolder(View itemView) { ViewHolder(View itemView) {
super(itemView); super(itemView);
this.itemView = itemView; this.itemView = itemView;
ivEdit = itemView.findViewById(R.id.ivEdit);
tvName = itemView.findViewById(R.id.tvName); tvName = itemView.findViewById(R.id.tvName);
tvMessages = itemView.findViewById(R.id.tvMessages); tvMessages = itemView.findViewById(R.id.tvMessages);
tvType = itemView.findViewById(R.id.tvType); tvType = itemView.findViewById(R.id.tvType);
tvAfter = itemView.findViewById(R.id.tvAfter); tvAfter = itemView.findViewById(R.id.tvAfter);
ivSync = itemView.findViewById(R.id.ivSync); ivSync = itemView.findViewById(R.id.ivSync);
ibEdit = itemView.findViewById(R.id.ibEdit);
tvError = itemView.findViewById(R.id.tvError); tvError = itemView.findViewById(R.id.tvError);
} }
private void wire(boolean properties) { private void wire(boolean properties) {
itemView.setOnClickListener(this); itemView.setOnClickListener(this);
if (properties) if (properties)
ibEdit.setOnClickListener(this);
ivEdit.setOnClickListener(this);
} }
private void unwire() { private void unwire() {
@ -116,7 +115,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
TupleFolderEx folder = filtered.get(pos); TupleFolderEx folder = filtered.get(pos);
if (view.getId() == R.id.ibEdit) {
if (view.getId() == R.id.ivEdit) {
if (!EntityFolder.OUTBOX.equals(folder.type)) { if (!EntityFolder.OUTBOX.equals(folder.type)) {
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context); LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
lbm.sendBroadcast( 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_height="wrap_content"
android:layout_marginBottom="6dp"> 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 <TextView
android:id="@+id/tvName" android:id="@+id/tvName"
android:layout_width="0dp" android:layout_width="0dp"
@ -17,7 +28,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintBottom_toBottomOf="@+id/ivMessages" app:layout_constraintBottom_toBottomOf="@+id/ivMessages"
app:layout_constraintEnd_toStartOf="@+id/tvAfter" app:layout_constraintEnd_toStartOf="@+id/tvAfter"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintStart_toEndOf="@id/ivEdit"
app:layout_constraintTop_toTopOf="@+id/ivMessages" /> app:layout_constraintTop_toTopOf="@+id/ivMessages" />
<TextView <TextView
@ -37,7 +48,7 @@
android:layout_height="24dp" android:layout_height="24dp"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:src="@drawable/baseline_mail_outline_24" android:src="@drawable/baseline_mail_outline_24"
app:layout_constraintEnd_toStartOf="@+id/ibEdit"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
@ -68,17 +79,8 @@
android:layout_height="24dp" android:layout_height="24dp"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:src="@drawable/baseline_sync_24" 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_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@id/ivMessages" />
<TextView <TextView
android:id="@+id/tvError" android:id="@+id/tvError"


Loading…
Cancel
Save