From b0cbecbdc504f88959af90c357837e00634285e0 Mon Sep 17 00:00:00 2001 From: Balazs Toldi Date: Sun, 30 Jun 2024 11:32:33 +0200 Subject: [PATCH] Remove score from user pages This has been removed from lemmy. No longer needed. --- .../activities/ViewUserDetailActivity.java | 29 +----- .../utils/SharedPreferencesUtils.java | 1 - .../res/layout/activity_view_user_detail.xml | 91 +++---------------- .../main/res/xml/interface_preferences.xml | 4 - 4 files changed, 15 insertions(+), 110 deletions(-) diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/activities/ViewUserDetailActivity.java b/app/src/main/java/eu/toldi/infinityforlemmy/activities/ViewUserDetailActivity.java index 7a01d90c..10e0fb6f 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/activities/ViewUserDetailActivity.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/activities/ViewUserDetailActivity.java @@ -189,21 +189,11 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele @BindView(R.id.comment_count_text_view_view_user_detail_activity) TextView commentCountTextView; - @BindView(R.id.upvote_count_post_text_view_view_user_detail_activity) - TextView upvoteCountPostTextView; - - @BindView(R.id.upvote_count_comment_text_view_view_user_detail_activity) - TextView upvoteCountCommentTextView; - @BindView(R.id.posts_count_icon_image_view_view_user_detail_activity) ImageView postsCountIconImageView; @BindView(R.id.comments_count_icon_image_view_view_user_detail_activity) ImageView commentsCountIconImageView; - @BindView(R.id.upvote_count_posts_icon_image_view_view_user_detail_activity) - ImageView postUpvoteCountIconImageView; - @BindView(R.id.upvote_count_comments_icon_image_view_view_user_detail_activity) - ImageView commentUpvoteCountIconImageView; @BindView(R.id.account_created_cake_icon_image_view_view_user_detail_activity) ImageView accountCreatedCakeIconImageView; @@ -262,7 +252,6 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele private String description; private boolean showStatistics; - private boolean showScore; private boolean subscriptionReady = false; private boolean mFetchUserInfoSuccess = false; private int expandedTabTextColor; @@ -328,7 +317,6 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele lockBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.LOCK_BOTTOM_APP_BAR, false); showStatistics = mSharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_STATISTICS, true); - showScore = mSharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_POST_AND_COMMENT_SCORE, true); if (savedInstanceState == null) { mMessageId = getIntent().getIntExtra(EXTRA_MESSAGE_FULLNAME, 0); @@ -631,17 +619,8 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele UserStats userStats = mUserData.getStats(); if (userStats != null && showStatistics) { userStatisticsBlock.setVisibility(View.VISIBLE); - postCountTextView.setText(String.valueOf(userStats.getPostCount())); - commentCountTextView.setText(String.valueOf(userStats.getCommentCount())); - if (showScore) { - upvoteCountPostTextView.setText(String.valueOf(userStats.getPostScore())); - upvoteCountCommentTextView.setText(String.valueOf(userStats.getCommentScore())); - } else { - upvoteCountPostTextView.setVisibility(View.GONE); - upvoteCountCommentTextView.setVisibility(View.GONE); - postUpvoteCountIconImageView.setVisibility(View.GONE); - commentUpvoteCountIconImageView.setVisibility(View.GONE); - } + postCountTextView.setText(getString(R.string.post_count_detail, userStats.getPostCount())); + commentCountTextView.setText(getString(R.string.comment_count_detail, userStats.getCommentCount())); } if (userData.getDescription() == null || userData.getDescription().equals("")) { @@ -711,9 +690,7 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele subscribedColor = mCustomThemeWrapper.getSubscribed(); userNameTextView.setTextColor(mCustomThemeWrapper.getUsername()); postCountTextView.setTextColor(mCustomThemeWrapper.getPrimaryTextColor()); - upvoteCountPostTextView.setTextColor(mCustomThemeWrapper.getPrimaryTextColor()); commentCountTextView.setTextColor(mCustomThemeWrapper.getPrimaryTextColor()); - upvoteCountCommentTextView.setTextColor(mCustomThemeWrapper.getPrimaryTextColor()); postsCountIconImageView.setColorFilter(mCustomThemeWrapper.getPrimaryTextColor(), PorterDuff.Mode.SRC_IN); commentsCountIconImageView.setColorFilter(mCustomThemeWrapper.getPrimaryTextColor(), PorterDuff.Mode.SRC_IN); accountCreatedCakeIconImageView.setColorFilter(mCustomThemeWrapper.getPrimaryTextColor(), PorterDuff.Mode.SRC_IN); @@ -726,9 +703,7 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele if (typeface != null) { userNameTextView.setTypeface(typeface); postCountTextView.setTypeface(typeface); - upvoteCountPostTextView.setTypeface(typeface); commentCountTextView.setTypeface(typeface); - upvoteCountCommentTextView.setTypeface(typeface); cakedayTextView.setTypeface(typeface); subscribeUserChip.setTypeface(typeface); descriptionTextView.setTypeface(typeface); diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/utils/SharedPreferencesUtils.java b/app/src/main/java/eu/toldi/infinityforlemmy/utils/SharedPreferencesUtils.java index d96bbe68..d4efae94 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/utils/SharedPreferencesUtils.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/utils/SharedPreferencesUtils.java @@ -420,7 +420,6 @@ public class SharedPreferencesUtils { public static final String ACCOUNT_QUALIFIED_NAME = "account_qualified_name"; public static final String CAN_DOWNVOTE = "can_downvote"; public static final String SHOW_STATISTICS = "show_statistics"; - public static final String SHOW_POST_AND_COMMENT_SCORE = "show_score"; public static final String SHARE_LINK_ON_LOCAL_INSTANCE = "share_link_on_local_instance"; diff --git a/app/src/main/res/layout/activity_view_user_detail.xml b/app/src/main/res/layout/activity_view_user_detail.xml index 61317dd5..a051a1da 100644 --- a/app/src/main/res/layout/activity_view_user_detail.xml +++ b/app/src/main/res/layout/activity_view_user_detail.xml @@ -84,20 +84,11 @@ app:chipStrokeColor="#00000000" /> + android:visibility="gone"> - + app:layout_constraintTop_toTopOf="parent" /> - - - - - + app:layout_constraintTop_toTopOf="parent" /> - - - - - + app:layout_constraintTop_toBottomOf="@+id/post_count_text_view_view_user_detail_activity" /> - \ No newline at end of file