Better loading for View User datail activity

Closes #64
This commit is contained in:
Balazs Toldi 2023-08-16 19:44:46 +02:00
parent 4ec6666f93
commit a7c2a67d0c
No known key found for this signature in database
GPG Key ID: 6C7D440036F99D58
4 changed files with 29 additions and 8 deletions

View File

@ -21,6 +21,7 @@ import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.view.inputmethod.EditorInfo; import android.view.inputmethod.EditorInfo;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
@ -170,6 +171,9 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
@BindView(R.id.user_qualified_name_text_view_view_user_detail_activity) @BindView(R.id.user_qualified_name_text_view_view_user_detail_activity)
TextView qualifiedNameTextView; TextView qualifiedNameTextView;
@BindView(R.id.loading_user_progress_indicator_view_user_detail_activity)
ProgressBar progressBar;
@BindView(R.id.subscribe_user_chip_view_user_detail_activity) @BindView(R.id.subscribe_user_chip_view_user_detail_activity)
Chip subscribeUserChip; Chip subscribeUserChip;
@BindView(R.id.karma_text_view_view_user_detail_activity) @BindView(R.id.karma_text_view_view_user_detail_activity)
@ -310,6 +314,7 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
private void setupVisibleElements() { private void setupVisibleElements() {
Resources resources = getResources(); Resources resources = getResources();
String title = username; String title = username;
progressBar.setVisibility(View.GONE);
userNameTextView.setText(title); userNameTextView.setText(title);
qualifiedNameTextView.setText(qualifiedName); qualifiedNameTextView.setText(qualifiedName);
toolbar.setTitle(title); toolbar.setTitle(title);

View File

@ -51,6 +51,12 @@
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:layout_below="@id/banner_image_view_view_user_detail_activity"> android:layout_below="@id/banner_image_view_view_user_detail_activity">
<ProgressBar
android:id="@+id/loading_user_progress_indicator_view_user_detail_activity"
style="?android:attr/progressBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView <TextView
android:id="@+id/user_name_text_view_view_user_detail_activity" android:id="@+id/user_name_text_view_view_user_detail_activity"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -59,15 +65,14 @@
android:layout_marginBottom="4dp" android:layout_marginBottom="4dp"
android:textSize="?attr/font_18" android:textSize="?attr/font_18"
android:fontFamily="?attr/font_family" android:fontFamily="?attr/font_family"
android:layout_gravity="center_horizontal"/> android:layout_gravity="center_horizontal" />
<TextView <TextView
android:id="@+id/user_qualified_name_text_view_view_user_detail_activity" android:id="@+id/user_qualified_name_text_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_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp" />
android:text="TextView" />
<com.google.android.material.chip.Chip <com.google.android.material.chip.Chip
android:id="@+id/subscribe_user_chip_view_user_detail_activity" android:id="@+id/subscribe_user_chip_view_user_detail_activity"

View File

@ -51,6 +51,12 @@
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:layout_below="@id/banner_image_view_view_user_detail_activity"> android:layout_below="@id/banner_image_view_view_user_detail_activity">
<ProgressBar
android:id="@+id/loading_user_progress_indicator_view_user_detail_activity"
style="?android:attr/progressBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView <TextView
android:id="@+id/user_name_text_view_view_user_detail_activity" android:id="@+id/user_name_text_view_view_user_detail_activity"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -59,14 +65,14 @@
android:layout_marginBottom="4dp" android:layout_marginBottom="4dp"
android:textSize="?attr/font_18" android:textSize="?attr/font_18"
android:fontFamily="?attr/font_family" android:fontFamily="?attr/font_family"
android:layout_gravity="center_horizontal"/> android:layout_gravity="center_horizontal" />
<TextView <TextView
android:id="@+id/user_qualified_name_text_view_view_user_detail_activity" android:id="@+id/user_qualified_name_text_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_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp" />
android:text="TextView" />
<com.google.android.material.chip.Chip <com.google.android.material.chip.Chip
android:id="@+id/subscribe_user_chip_view_user_detail_activity" android:id="@+id/subscribe_user_chip_view_user_detail_activity"

View File

@ -51,6 +51,12 @@
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:layout_below="@id/banner_image_view_view_user_detail_activity"> android:layout_below="@id/banner_image_view_view_user_detail_activity">
<ProgressBar
android:id="@+id/loading_user_progress_indicator_view_user_detail_activity"
style="?android:attr/progressBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView <TextView
android:id="@+id/user_name_text_view_view_user_detail_activity" android:id="@+id/user_name_text_view_view_user_detail_activity"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -66,8 +72,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp" />
android:text="TextView" />
<com.google.android.material.chip.Chip <com.google.android.material.chip.Chip
android:id="@+id/subscribe_user_chip_view_user_detail_activity" android:id="@+id/subscribe_user_chip_view_user_detail_activity"