Remove score from user pages

This has been removed from lemmy. No longer needed.
This commit is contained in:
Balazs Toldi 2024-06-30 11:32:33 +02:00
parent 1276435494
commit b0cbecbdc5
4 changed files with 15 additions and 110 deletions

@ -189,21 +189,11 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
@BindView(R.id.comment_count_text_view_view_user_detail_activity) @BindView(R.id.comment_count_text_view_view_user_detail_activity)
TextView commentCountTextView; 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) @BindView(R.id.posts_count_icon_image_view_view_user_detail_activity)
ImageView postsCountIconImageView; ImageView postsCountIconImageView;
@BindView(R.id.comments_count_icon_image_view_view_user_detail_activity) @BindView(R.id.comments_count_icon_image_view_view_user_detail_activity)
ImageView commentsCountIconImageView; 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) @BindView(R.id.account_created_cake_icon_image_view_view_user_detail_activity)
ImageView accountCreatedCakeIconImageView; ImageView accountCreatedCakeIconImageView;
@ -262,7 +252,6 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
private String description; private String description;
private boolean showStatistics; private boolean showStatistics;
private boolean showScore;
private boolean subscriptionReady = false; private boolean subscriptionReady = false;
private boolean mFetchUserInfoSuccess = false; private boolean mFetchUserInfoSuccess = false;
private int expandedTabTextColor; private int expandedTabTextColor;
@ -328,7 +317,6 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
lockBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.LOCK_BOTTOM_APP_BAR, false); lockBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.LOCK_BOTTOM_APP_BAR, false);
showStatistics = mSharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_STATISTICS, true); showStatistics = mSharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_STATISTICS, true);
showScore = mSharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_POST_AND_COMMENT_SCORE, true);
if (savedInstanceState == null) { if (savedInstanceState == null) {
mMessageId = getIntent().getIntExtra(EXTRA_MESSAGE_FULLNAME, 0); mMessageId = getIntent().getIntExtra(EXTRA_MESSAGE_FULLNAME, 0);
@ -631,17 +619,8 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
UserStats userStats = mUserData.getStats(); UserStats userStats = mUserData.getStats();
if (userStats != null && showStatistics) { if (userStats != null && showStatistics) {
userStatisticsBlock.setVisibility(View.VISIBLE); userStatisticsBlock.setVisibility(View.VISIBLE);
postCountTextView.setText(String.valueOf(userStats.getPostCount())); postCountTextView.setText(getString(R.string.post_count_detail, userStats.getPostCount()));
commentCountTextView.setText(String.valueOf(userStats.getCommentCount())); commentCountTextView.setText(getString(R.string.comment_count_detail, 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);
}
} }
if (userData.getDescription() == null || userData.getDescription().equals("")) { if (userData.getDescription() == null || userData.getDescription().equals("")) {
@ -711,9 +690,7 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
subscribedColor = mCustomThemeWrapper.getSubscribed(); subscribedColor = mCustomThemeWrapper.getSubscribed();
userNameTextView.setTextColor(mCustomThemeWrapper.getUsername()); userNameTextView.setTextColor(mCustomThemeWrapper.getUsername());
postCountTextView.setTextColor(mCustomThemeWrapper.getPrimaryTextColor()); postCountTextView.setTextColor(mCustomThemeWrapper.getPrimaryTextColor());
upvoteCountPostTextView.setTextColor(mCustomThemeWrapper.getPrimaryTextColor());
commentCountTextView.setTextColor(mCustomThemeWrapper.getPrimaryTextColor()); commentCountTextView.setTextColor(mCustomThemeWrapper.getPrimaryTextColor());
upvoteCountCommentTextView.setTextColor(mCustomThemeWrapper.getPrimaryTextColor());
postsCountIconImageView.setColorFilter(mCustomThemeWrapper.getPrimaryTextColor(), PorterDuff.Mode.SRC_IN); postsCountIconImageView.setColorFilter(mCustomThemeWrapper.getPrimaryTextColor(), PorterDuff.Mode.SRC_IN);
commentsCountIconImageView.setColorFilter(mCustomThemeWrapper.getPrimaryTextColor(), PorterDuff.Mode.SRC_IN); commentsCountIconImageView.setColorFilter(mCustomThemeWrapper.getPrimaryTextColor(), PorterDuff.Mode.SRC_IN);
accountCreatedCakeIconImageView.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) { if (typeface != null) {
userNameTextView.setTypeface(typeface); userNameTextView.setTypeface(typeface);
postCountTextView.setTypeface(typeface); postCountTextView.setTypeface(typeface);
upvoteCountPostTextView.setTypeface(typeface);
commentCountTextView.setTypeface(typeface); commentCountTextView.setTypeface(typeface);
upvoteCountCommentTextView.setTypeface(typeface);
cakedayTextView.setTypeface(typeface); cakedayTextView.setTypeface(typeface);
subscribeUserChip.setTypeface(typeface); subscribeUserChip.setTypeface(typeface);
descriptionTextView.setTypeface(typeface); descriptionTextView.setTypeface(typeface);

@ -420,7 +420,6 @@ public class SharedPreferencesUtils {
public static final String ACCOUNT_QUALIFIED_NAME = "account_qualified_name"; public static final String ACCOUNT_QUALIFIED_NAME = "account_qualified_name";
public static final String CAN_DOWNVOTE = "can_downvote"; public static final String CAN_DOWNVOTE = "can_downvote";
public static final String SHOW_STATISTICS = "show_statistics"; 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"; public static final String SHARE_LINK_ON_LOCAL_INSTANCE = "share_link_on_local_instance";

@ -84,20 +84,11 @@
app:chipStrokeColor="#00000000" /> app:chipStrokeColor="#00000000" />
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/user_statistics_block_view_user_detail_activity"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone" android:visibility="gone">
android:id="@+id/user_statistics_block_view_user_detail_activity">
<TextView
android:id="@+id/post_stats_text_view_view_user_detail_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="@string/posts"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView <ImageView
android:id="@+id/posts_count_icon_image_view_view_user_detail_activity" android:id="@+id/posts_count_icon_image_view_view_user_detail_activity"
@ -106,7 +97,8 @@
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/post_stats_text_view_view_user_detail_activity"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_post_add_24" /> app:srcCompat="@drawable/ic_post_add_24" />
<TextView <TextView
@ -114,30 +106,11 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="9dp" android:layout_marginTop="10dp"
android:text="0" android:text="0"
app:layout_constraintStart_toEndOf="@+id/posts_count_icon_image_view_view_user_detail_activity" app:layout_constraintStart_toEndOf="@+id/posts_count_icon_image_view_view_user_detail_activity"
app:layout_constraintTop_toBottomOf="@+id/post_stats_text_view_view_user_detail_activity" /> app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/upvote_count_posts_icon_image_view_view_user_detail_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintStart_toEndOf="@+id/post_count_text_view_view_user_detail_activity"
app:layout_constraintTop_toBottomOf="@+id/post_stats_text_view_view_user_detail_activity"
app:srcCompat="@drawable/ic_arrow_upward_black_24dp" />
<TextView
android:id="@+id/upvote_count_post_text_view_view_user_detail_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="9dp"
android:text="0"
app:layout_constraintStart_toEndOf="@+id/upvote_count_posts_icon_image_view_view_user_detail_activity"
app:layout_constraintTop_toBottomOf="@+id/post_stats_text_view_view_user_detail_activity" />
<androidx.constraintlayout.widget.Guideline <androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline3" android:id="@+id/guideline3"
@ -146,22 +119,13 @@
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintGuide_percent="0.5" /> app:layout_constraintGuide_percent="0.5" />
<TextView
android:id="@+id/comment_stats_text_view_view_user_detail_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/comments"
app:layout_constraintStart_toStartOf="@+id/guideline3"
app:layout_constraintTop_toTopOf="parent" />
<ImageView <ImageView
android:id="@+id/comments_count_icon_image_view_view_user_detail_activity" android:id="@+id/comments_count_icon_image_view_view_user_detail_activity"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
app:layout_constraintStart_toStartOf="@+id/guideline3" app:layout_constraintStart_toStartOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@+id/comment_stats_text_view_view_user_detail_activity" app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_comment_black_24" /> app:srcCompat="@drawable/ic_comment_black_24" />
<TextView <TextView
@ -169,49 +133,20 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="9dp" android:layout_marginTop="10dp"
android:text="0" android:text="0"
app:layout_constraintStart_toEndOf="@+id/comments_count_icon_image_view_view_user_detail_activity" app:layout_constraintStart_toEndOf="@+id/comments_count_icon_image_view_view_user_detail_activity"
app:layout_constraintTop_toBottomOf="@+id/comment_stats_text_view_view_user_detail_activity" /> app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/upvote_count_comments_icon_image_view_view_user_detail_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintStart_toEndOf="@+id/comment_count_text_view_view_user_detail_activity"
app:layout_constraintTop_toBottomOf="@+id/comment_stats_text_view_view_user_detail_activity"
app:srcCompat="@drawable/ic_arrow_upward_black_24dp" />
<TextView
android:id="@+id/upvote_count_comment_text_view_view_user_detail_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="9dp"
android:text="0"
app:layout_constraintStart_toEndOf="@+id/upvote_count_comments_icon_image_view_view_user_detail_activity"
app:layout_constraintTop_toBottomOf="@+id/comment_stats_text_view_view_user_detail_activity" />
<TextView
android:id="@+id/account_created_text_view_view_user_detail_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:text="Account Created"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/posts_count_icon_image_view_view_user_detail_activity" />
<ImageView <ImageView
android:id="@+id/account_created_cake_icon_image_view_view_user_detail_activity" android:id="@+id/account_created_cake_icon_image_view_view_user_detail_activity"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="8dp" android:layout_marginTop="24dp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/account_created_text_view_view_user_detail_activity" app:layout_constraintTop_toBottomOf="@+id/posts_count_icon_image_view_view_user_detail_activity"
app:srcCompat="@drawable/ic_cake_24" /> app:srcCompat="@drawable/ic_cake_24" />
<TextView <TextView
@ -219,9 +154,9 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="11dp" android:layout_marginTop="30dp"
app:layout_constraintStart_toEndOf="@+id/account_created_cake_icon_image_view_view_user_detail_activity" app:layout_constraintStart_toEndOf="@+id/account_created_cake_icon_image_view_view_user_detail_activity"
app:layout_constraintTop_toBottomOf="@+id/account_created_text_view_view_user_detail_activity" /> app:layout_constraintTop_toBottomOf="@+id/post_count_text_view_view_user_detail_activity" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<TextView <TextView

@ -93,9 +93,5 @@
app:key="show_statistics" app:key="show_statistics"
app:title="@string/settings_show_statistics" /> app:title="@string/settings_show_statistics" />
<eu.toldi.infinityforlemmy.customviews.CustomFontSwitchPreference
app:defaultValue="true"
app:key="show_score"
app:title="@string/settings_show_post_and_comment_score" />
</PreferenceScreen> </PreferenceScreen>