Browse Source

Layout improvements

main
M66B 6 years ago
parent
commit
bb143540f4
6 changed files with 69 additions and 37 deletions
  1. BIN
      .idea/caches/build_file_checksums.ser
  2. +3
    -2
      app/build.gradle
  3. +5
    -4
      app/src/main/java/eu/faircode/email/AdapterAccount.java
  4. +10
    -4
      app/src/main/java/eu/faircode/email/AdapterIdentity.java
  5. +16
    -17
      app/src/main/res/layout/item_account.xml
  6. +35
    -10
      app/src/main/res/layout/item_identity.xml

BIN
.idea/caches/build_file_checksums.ser View File


+ 3
- 2
app/build.gradle View File

@ -45,7 +45,7 @@ repositories {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
def support_version = "1.0.0-rc01"
def support_version = "1.0.0-alpha1"
def androidx_version = "2.0.0-alpha1"
def javamail_version = "1.6.0"
def jsoup_version = "1.11.3"
@ -58,8 +58,9 @@ dependencies {
implementation "com.google.android.material:material:$support_version"
implementation "androidx.browser:browser:$support_version"
implementation "androidx.constraintlayout:constraintlayout:1.1.2"
// https://developer.android.com/topic/libraries/architecture/adding-components.html
implementation "androidx.constraintlayout:constraintlayout:$androidx_version"
implementation "androidx.lifecycle:lifecycle-extensions:$androidx_version"
implementation "androidx.room:room-runtime:$androidx_version"
implementation "androidx.paging:paging-runtime:$androidx_version"


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

@ -52,8 +52,8 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
ImageView ivPrimary;
TextView tvName;
ImageView ivSync;
TextView tvHost;
TextView tvUser;
TextView tvHost;
ImageView ivState;
TextView tvError;
@ -64,8 +64,8 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
ivPrimary = itemView.findViewById(R.id.ivPrimary);
tvName = itemView.findViewById(R.id.tvName);
ivSync = itemView.findViewById(R.id.ivSync);
tvHost = itemView.findViewById(R.id.tvHost);
tvUser = itemView.findViewById(R.id.tvUser);
tvHost = itemView.findViewById(R.id.tvHost);
ivState = itemView.findViewById(R.id.ivState);
tvError = itemView.findViewById(R.id.tvError);
}
@ -79,11 +79,12 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
}
private void bindTo(EntityAccount account) {
ivPrimary.setVisibility(account.primary ? View.VISIBLE : View.GONE);
ivPrimary.setVisibility(account.primary ? View.VISIBLE : View.INVISIBLE);
tvName.setText(account.name);
ivSync.setVisibility(account.synchronize ? View.VISIBLE : View.INVISIBLE);
tvHost.setText(String.format("%s:%d", account.host, account.port));
tvUser.setText(account.user);
tvHost.setText(String.format("%s:%d", account.host, account.port));
if ("connected".equals(account.state))
ivState.setImageResource(R.drawable.baseline_cloud_24);
else if ("connecting".equals(account.state))


+ 10
- 4
app/src/main/java/eu/faircode/email/AdapterIdentity.java View File

@ -52,8 +52,10 @@ public class AdapterIdentity extends RecyclerView.Adapter<AdapterIdentity.ViewHo
ImageView ivPrimary;
TextView tvName;
ImageView ivSync;
TextView tvUser;
TextView tvHost;
TextView tvAccount;
TextView tvEmail;
TextView tvError;
ViewHolder(View itemView) {
super(itemView);
@ -62,8 +64,10 @@ public class AdapterIdentity extends RecyclerView.Adapter<AdapterIdentity.ViewHo
ivPrimary = itemView.findViewById(R.id.ivPrimary);
tvName = itemView.findViewById(R.id.tvName);
ivSync = itemView.findViewById(R.id.ivSync);
tvUser = itemView.findViewById(R.id.tvUser);
tvHost = itemView.findViewById(R.id.tvHost);
tvAccount = itemView.findViewById(R.id.tvAccount);
tvEmail = itemView.findViewById(R.id.tvEmail);
tvError = itemView.findViewById(R.id.tvError);
}
private void wire() {
@ -75,11 +79,13 @@ public class AdapterIdentity extends RecyclerView.Adapter<AdapterIdentity.ViewHo
}
private void bindTo(TupleIdentityEx identity) {
ivPrimary.setVisibility(identity.primary ? View.VISIBLE : View.GONE);
ivPrimary.setVisibility(identity.primary ? View.VISIBLE : View.INVISIBLE);
tvName.setText(identity.name);
ivSync.setVisibility(identity.synchronize ? View.VISIBLE : View.INVISIBLE);
tvUser.setText(identity.email);
tvHost.setText(String.format("%s:%d", identity.host, identity.port));
tvAccount.setText(identity.accountName);
tvEmail.setText(String.format("%s/%s:%d", identity.email, identity.host, identity.port));
tvError.setVisibility(View.GONE);
}
@Override


+ 16
- 17
app/src/main/res/layout/item_account.xml View File

@ -39,6 +39,18 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvUser"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:layout_marginStart="6dp"
android:text="user"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toStartOf="@+id/ivSync"
app:layout_constraintStart_toEndOf="@+id/ivPrimary"
app:layout_constraintTop_toBottomOf="@id/ivSync" />
<ImageView
android:id="@+id/ivState"
android:layout_width="24dp"
@ -47,34 +59,21 @@
android:layout_marginStart="6dp"
android:src="@drawable/baseline_cloud_off_24"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ivSync" />
app:layout_constraintTop_toBottomOf="@id/tvUser" />
<TextView
android:id="@+id/tvHost"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:layout_marginStart="6dp"
android:ellipsize="end"
android:maxLines="1"
android:text="host"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintBottom_toBottomOf="@id/ivState"
app:layout_constraintEnd_toStartOf="@+id/tvUser"
app:layout_constraintStart_toEndOf="@id/ivState"
app:layout_constraintTop_toTopOf="@id/ivState" />
<TextView
android:id="@+id/tvUser"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:layout_marginStart="6dp"
android:text="user"
android:textAlignment="textEnd"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintBottom_toBottomOf="@id/ivState"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tvHost"
app:layout_constraintStart_toEndOf="@id/ivState"
app:layout_constraintTop_toTopOf="@id/ivState" />
<TextView
@ -88,7 +87,7 @@
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ivState" />
app:layout_constraintTop_toBottomOf="@id/tvHost" />
<View
android:id="@+id/vSeparator"


+ 35
- 10
app/src/main/res/layout/item_identity.xml View File

@ -39,30 +39,55 @@
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvAccount"
android:id="@+id/tvUser"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:layout_marginStart="6dp"
android:text="user"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toStartOf="@+id/ivSync"
app:layout_constraintStart_toEndOf="@+id/ivPrimary"
app:layout_constraintTop_toBottomOf="@id/ivSync" />
<TextView
android:id="@+id/tvHost"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:ellipsize="end"
android:maxLines="1"
android:text="account"
android:text="host"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toStartOf="@+id/tvEmail"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ivSync" />
app:layout_constraintEnd_toStartOf="@+id/tvAccount"
app:layout_constraintStart_toEndOf="@+id/ivPrimary"
app:layout_constraintTop_toBottomOf="@id/tvUser" />
<TextView
android:id="@+id/tvEmail"
android:id="@+id/tvAccount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:layout_marginStart="6dp"
android:text="user@host"
android:text="account"
android:textAlignment="textEnd"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tvAccount"
app:layout_constraintTop_toBottomOf="@id/ivSync" />
app:layout_constraintStart_toEndOf="@id/tvHost"
app:layout_constraintTop_toBottomOf="@id/tvUser" />
<TextView
android:id="@+id/tvError"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:layout_marginStart="6dp"
android:text="error"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvHost" />
<View
android:id="@+id/vSeparator"
@ -72,5 +97,5 @@
android:layout_marginTop="6dp"
android:background="?attr/colorSeparator"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvEmail" />
app:layout_constraintTop_toBottomOf="@id/tvError" />
</androidx.constraintlayout.widget.ConstraintLayout>

Loading…
Cancel
Save