resolves #1540 adding a proper error message

This commit is contained in:
AndyScherzinger 2017-09-13 18:31:50 +02:00
parent c4bd5233ae
commit 12b2d015fa
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
2 changed files with 8 additions and 3 deletions

View file

@ -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());

View file

@ -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>