Show instance for user listings

Closes #166
This commit is contained in:
Balazs Toldi 2023-09-12 09:02:27 +02:00
parent af63bba54a
commit 29547f4750
No known key found for this signature in database
GPG Key ID: 6C7D440036F99D58
3 changed files with 26 additions and 1 deletions

View File

@ -136,7 +136,9 @@ public class UserListingRecyclerViewAdapter extends PagedListAdapter<UserData, R
.into(((DataViewHolder) holder).iconGifImageView);
}
((DataViewHolder) holder).userNameTextView.setText(userData.getName());
((DataViewHolder) holder).userNameTextView.setText(userData.getTitle().equals("") ? userData.getName() : userData.getTitle());
String qualifiedName = LemmyUtils.actorID2FullName(userData.getActorId());
((DataViewHolder) holder).userInstanceTextView.setText(qualifiedName.substring(qualifiedName.indexOf('@')));
if (!isMultiSelection) {
CheckIsFollowingUser.checkIsFollowingUser(executor, new Handler(), redditDataRoomDatabase,
@ -237,6 +239,9 @@ public class UserListingRecyclerViewAdapter extends PagedListAdapter<UserData, R
GifImageView iconGifImageView;
@BindView(R.id.user_name_text_view_item_user_listing)
TextView userNameTextView;
@BindView(R.id.user_instance_text_view_item_user_listing)
TextView userInstanceTextView;
@BindView(R.id.subscribe_image_view_item_user_listing)
ImageView subscribeButton;
@BindView(R.id.checkbox__item_user_listing)
@ -246,6 +251,7 @@ public class UserListingRecyclerViewAdapter extends PagedListAdapter<UserData, R
super(itemView);
ButterKnife.bind(this, itemView);
userNameTextView.setTextColor(primaryTextColor);
userInstanceTextView.setTextColor(CustomThemeWrapper.darkenColor(primaryTextColor, 0.7f));
subscribeButton.setColorFilter(unsubscribedColor, android.graphics.PorterDuff.Mode.SRC_IN);
if (activity.typeface != null) {

View File

@ -24,6 +24,8 @@
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:fontFamily="?attr/font_family"
android:maxLines="1"
android:ellipsize="end"
android:textSize="?attr/font_default"
app:layout_constraintStart_toEndOf="@+id/subreddit_icon_gif_image_view_item_subreddit_listing"
app:layout_constraintTop_toTopOf="parent" />
@ -33,6 +35,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="?attr/font_family"
android:maxLines="1"
android:ellipsize="end"
android:textSize="?attr/font_default"
app:layout_constraintStart_toEndOf="@+id/subreddit_name_text_view_item_subreddit_listing"
app:layout_constraintTop_toTopOf="parent" />

View File

@ -24,12 +24,27 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="32dp"
android:maxLines="1"
android:ellipsize="end"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/user_icon_gif_image_view_item_user_listing"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/user_instance_text_view_item_user_listing"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:fontFamily="?attr/font_family"
android:maxLines="1"
android:ellipsize="end"
android:textSize="?attr/font_default"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/user_name_text_view_item_user_listing"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/subscribe_image_view_item_user_listing"
android:layout_width="wrap_content"