Review account name

pull/199/head
M66B 4 years ago
parent a63b237bda
commit 6f07aef373

@ -48,6 +48,7 @@ public class FragmentDialogAccount extends FragmentDialogBase {
final Context context = getContext(); final Context context = getContext();
final View dview = LayoutInflater.from(context).inflate(R.layout.dialog_review_account, null); final View dview = LayoutInflater.from(context).inflate(R.layout.dialog_review_account, null);
final TextView tvName = dview.findViewById(R.id.tvName);
final TextView tvInbox = dview.findViewById(R.id.tvInbox); final TextView tvInbox = dview.findViewById(R.id.tvInbox);
final TextView tvDrafts = dview.findViewById(R.id.tvDrafts); final TextView tvDrafts = dview.findViewById(R.id.tvDrafts);
final TextView tvSent = dview.findViewById(R.id.tvSent); final TextView tvSent = dview.findViewById(R.id.tvSent);
@ -71,8 +72,9 @@ public class FragmentDialogAccount extends FragmentDialogBase {
tvJunk.setCompoundDrawablesRelative(null, null, null, null); tvJunk.setCompoundDrawablesRelative(null, null, null, null);
tvArchive.setCompoundDrawablesRelative(null, null, null, null); tvArchive.setCompoundDrawablesRelative(null, null, null, null);
tvLeft.setText(""); tvName.setText(null);
tvRight.setText(""); tvLeft.setText(null);
tvRight.setText(null);
Bundle args = getArguments(); Bundle args = getArguments();
final long account = args.getLong("account"); final long account = args.getLong("account");
@ -90,6 +92,14 @@ public class FragmentDialogAccount extends FragmentDialogBase {
}); });
DB db = DB.getInstance(context); DB db = DB.getInstance(context);
db.account().liveAccount(account).observe(this, new Observer<EntityAccount>() {
@Override
public void onChanged(EntityAccount account) {
tvName.setText(account.name);
}
});
db.account().liveAccountSwipes(account).observe(this, new Observer<List<TupleAccountSwipes>>() { db.account().liveAccountSwipes(account).observe(this, new Observer<List<TupleAccountSwipes>>() {
@Override @Override
public void onChanged(List<TupleAccountSwipes> swipes) { public void onChanged(List<TupleAccountSwipes> swipes) {

@ -10,15 +10,25 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<eu.faircode.email.FixedTextView
android:id="@+id/tvName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<eu.faircode.email.FixedTextView <eu.faircode.email.FixedTextView
android:id="@+id/tvSuccess" android:id="@+id/tvSuccess"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="@string/title_setup_quick_success" android:text="@string/title_setup_quick_success"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toBottomOf="@+id/tvName" />
<eu.faircode.email.FixedTextView <eu.faircode.email.FixedTextView
android:id="@+id/tvInbox" android:id="@+id/tvInbox"

Loading…
Cancel
Save