Browse Source

resolves #1540 adding a proper error message

AndyScherzinger 7 years ago
parent
commit
12b2d015fa

+ 7 - 3
src/main/java/com/owncloud/android/ui/activity/UserInfoActivity.java

@@ -167,7 +167,7 @@ public class UserInfoActivity extends FileActivity {
     @BindView(R.id.empty_list_progress)
     public ProgressBar multiListProgressBar;
 
-    @BindString(R.string.preview_sorry)
+    @BindString(R.string.user_information_retrieval_error)
     public String sorryMessage;
 
     private float mCurrentAccountAvatarRadiusDimension;
@@ -256,18 +256,22 @@ public class UserInfoActivity extends FileActivity {
             emptyContentMessage.setText("");
 
             emptyContentIcon.setVisibility(View.GONE);
+            emptyContentMessage.setVisibility(View.GONE);
             multiListProgressBar.getIndeterminateDrawable().setColorFilter(ThemeUtils.primaryColor(),
                     PorterDuff.Mode.SRC_IN);
             multiListProgressBar.setVisibility(View.VISIBLE);
         }
     }
 
-    private void setMessageForMultiList(String headline, String message) {
+    private void setErrorMessageForMultiList(String headline, String message) {
         if (emptyContentContainer != null && emptyContentMessage != null) {
             emptyContentHeadline.setText(headline);
             emptyContentMessage.setText(message);
+            emptyContentIcon.setImageResource(R.drawable.ic_list_empty_error);
 
             multiListProgressBar.setVisibility(View.GONE);
+            emptyContentIcon.setVisibility(View.VISIBLE);
+            emptyContentMessage.setVisibility(View.VISIBLE);
         }
     }
 
@@ -483,7 +487,7 @@ public class UserInfoActivity extends FileActivity {
                     runOnUiThread(new Runnable() {
                         @Override
                         public void run() {
-                            setMessageForMultiList(result.getLogMessage(), sorryMessage);
+                            setErrorMessageForMultiList(sorryMessage, result.getLogMessage());
                         }
                     });
                     Log_OC.d(TAG, result.getLogMessage());

+ 1 - 0
src/main/res/values/strings.xml

@@ -651,6 +651,7 @@
     <string name="user_info_twitter">Twitter</string>
 
     <string name="user_information_description">User information</string>
+    <string name="user_information_retrieval_error">Error retrieving user information</string>
 
     <!-- Activities -->
     <string name="activities_no_results_headline">No activity yet</string>