Do not show statistics block while loading

This commit is contained in:
Balazs Toldi 2023-08-20 10:24:09 +02:00
parent 3322b5b4e8
commit 76fee50cd5
No known key found for this signature in database
GPG Key ID: 6C7D440036F99D58
8 changed files with 9 additions and 5 deletions

View File

@ -600,11 +600,10 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
nSubscribersTextView.setText(nSubscribers);
if (mCommunityStats != null && showStatistics) {
communityStatisticsBlock.setVisibility(View.VISIBLE);
nActiveUsersTextView.setText(getString(R.string.active_users_number_detail, mCommunityStats.getActiveUsers()));
nPostsTextView.setText(getString(R.string.post_count_detail, mCommunityStats.getPosts()));
nCommentsTextView.setText(getString(R.string.comment_count_detail, mCommunityStats.getComments()));
} else {
communityStatisticsBlock.setVisibility(View.GONE);
}
description = subredditData.getDescription();

View File

@ -629,6 +629,7 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
cakedayTextView.setText((String) userData.getCakeday());
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) {
@ -640,8 +641,6 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
postUpvoteCountIconImageView.setVisibility(View.GONE);
commentUpvoteCountIconImageView.setVisibility(View.GONE);
}
} else {
userStatisticsBlock.setVisibility(View.GONE);
}
if (userData.getDescription() == null || userData.getDescription().equals("")) {

View File

@ -80,6 +80,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:visibility="gone"
android:id="@+id/community_statistics_block_view_subreddit_detail_activity">
<ImageView

View File

@ -86,6 +86,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:id="@+id/user_statistics_block_view_user_detail_activity">
<TextView

View File

@ -76,11 +76,12 @@
app:chipStrokeColor="#00000000" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/community_statistics_block_view_subreddit_detail_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:id="@+id/community_statistics_block_view_subreddit_detail_activity">
android:visibility="gone">
<ImageView
android:id="@+id/subscriber_count_image_view_view_subreddit_detail_activity"

View File

@ -86,6 +86,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:id="@+id/user_statistics_block_view_user_detail_activity">
<TextView

View File

@ -79,6 +79,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:visibility="gone"
android:id="@+id/community_statistics_block_view_subreddit_detail_activity">
<ImageView

View File

@ -86,6 +86,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:id="@+id/user_statistics_block_view_user_detail_activity">
<TextView