Skip to content

Commit 20bc0f0

Browse files
committed
Fixed a bug in PgpContactAdapter.
1 parent 0fe0b12 commit 20bc0f0

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

FlowCrypt/src/main/java/com/flowcrypt/email/ui/adapter/PgpContactAdapter.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,21 @@ public CharSequence convertToString(Cursor cursor) {
4848

4949
@Override
5050
public void bindView(View view, Context context, Cursor cursor) {
51-
TextView textViewName = (TextView) view.findViewById(R.id.textViewName);
52-
TextView textViewEmail = (TextView) view.findViewById(R.id.textViewEmail);
53-
TextView textViewOnlyEmail = (TextView) view.findViewById(R.id.textViewOnlyEmail);
51+
TextView textViewName = view.findViewById(R.id.textViewName);
52+
TextView textViewEmail = view.findViewById(R.id.textViewEmail);
53+
TextView textViewOnlyEmail = view.findViewById(R.id.textViewOnlyEmail);
5454

5555
String name = cursor.getString(cursor.getColumnIndex(ContactsDaoSource.COL_NAME));
5656
String email = cursor.getString(cursor.getColumnIndex(ContactsDaoSource.COL_EMAIL));
5757

5858
if (TextUtils.isEmpty(name)) {
59-
textViewName.setVisibility(View.GONE);
60-
textViewEmail.setVisibility(View.GONE);
61-
textViewOnlyEmail.setVisibility(View.VISIBLE);
59+
textViewEmail.setText(null);
60+
textViewName.setText(null);
6261
textViewOnlyEmail.setText(email);
6362
} else {
64-
textViewName.setVisibility(View.VISIBLE);
65-
textViewEmail.setVisibility(View.VISIBLE);
66-
textViewOnlyEmail.setVisibility(View.GONE);
67-
6863
textViewEmail.setText(email);
6964
textViewName.setText(name);
65+
textViewOnlyEmail.setText(null);
7066
}
7167
}
7268
}

FlowCrypt/src/main/res/layout/pgp_contact_item.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
android:layout_height="wrap_content"
1818
android:layout_marginStart="@dimen/default_margin_content_small"
1919
android:textSize="@dimen/default_text_size_big"
20-
android:visibility="visible"
2120
app:layout_constraintBottom_toTopOf="@+id/textViewEmail"
2221
app:layout_constraintLeft_toLeftOf="parent"
2322
app:layout_constraintTop_toTopOf="parent"
@@ -28,7 +27,6 @@
2827
android:layout_width="wrap_content"
2928
android:layout_height="wrap_content"
3029
android:layout_marginStart="@dimen/default_margin_content_small"
31-
android:visibility="visible"
3230
app:layout_constraintBottom_toBottomOf="parent"
3331
app:layout_constraintLeft_toLeftOf="parent"
3432
app:layout_constraintTop_toBottomOf="@+id/textViewName"
@@ -42,7 +40,6 @@
4240
android:layout_marginStart="@dimen/default_margin_content_small"
4341
android:layout_marginTop="@dimen/default_margin_content_small"
4442
android:textSize="@dimen/default_text_size_big"
45-
android:visibility="gone"
4643
app:layout_constraintBottom_toBottomOf="parent"
4744
app:layout_constraintLeft_toLeftOf="parent"
4845
app:layout_constraintTop_toTopOf="parent"

0 commit comments

Comments
 (0)