update icon & text

Signed-off-by: tobiaskaminsky <tobias@kaminsky.me>
This commit is contained in:
Tobias Kaminsky 2018-01-05 10:36:20 +01:00 committed by tobiasKaminsky
parent 44c1c725c0
commit 1d822ca658
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7
2 changed files with 24 additions and 21 deletions

View file

@ -38,6 +38,7 @@ import android.graphics.drawable.LayerDrawable;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.ColorInt;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
@ -53,7 +54,10 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import butterknife.BindString;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.animation.GlideAnimation;
import com.bumptech.glide.request.target.SimpleTarget;
@ -72,17 +76,11 @@ import com.owncloud.android.ui.events.TokenPushEvent;
import com.owncloud.android.utils.DisplayUtils;
import com.owncloud.android.utils.PushUtils;
import com.owncloud.android.utils.ThemeUtils;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.parceler.Parcels;
import butterknife.BindString;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
/**
* This Activity presents the user information.
*/
@ -261,11 +259,11 @@ public class UserInfoActivity extends FileActivity {
}
}
private void setErrorMessageForMultiList(String headline, String message) {
private void setErrorMessageForMultiList(String headline, String message, @DrawableRes int errorResource) {
if (emptyContentContainer != null && emptyContentMessage != null) {
emptyContentHeadline.setText(headline);
emptyContentMessage.setText(message);
emptyContentIcon.setImageResource(R.drawable.ic_list_empty_error);
emptyContentIcon.setImageResource(errorResource);
multiListProgressBar.setVisibility(View.GONE);
emptyContentIcon.setVisibility(View.VISIBLE);
@ -318,22 +316,24 @@ public class UserInfoActivity extends FileActivity {
}
private void populateUserInfoUi(UserInfo userInfo) {
userName.setText(account.name);
DisplayUtils.setAvatar(account, UserInfoActivity.this,
mCurrentAccountAvatarRadiusDimension, getResources(), getStorageManager(), avatar);
int tint = ThemeUtils.primaryColor(account);
if (!TextUtils.isEmpty(userInfo.getDisplayName())) {
fullName.setText(userInfo.getDisplayName());
}
if (userInfo.getPhone() == null && userInfo.getEmail() == null && userInfo.getAddress() == null
&& userInfo.getTwitter() == null & userInfo.getWebpage() == null) {
setErrorMessageForMultiList(getString(R.string.userinfo_no_info_headline),
getString(R.string.userinfo_no_info_text));
getString(R.string.userinfo_no_info_text), R.drawable.ic_user);
} else {
emptyContentContainer.setVisibility(View.GONE);
userInfoView.setVisibility(View.VISIBLE);
userName.setText(account.name);
DisplayUtils.setAvatar(account, UserInfoActivity.this,
mCurrentAccountAvatarRadiusDimension, getResources(), getStorageManager(), avatar);
int tint = ThemeUtils.primaryColor(account);
if (!TextUtils.isEmpty(userInfo.getDisplayName())) {
fullName.setText(userInfo.getDisplayName());
}
populateUserInfoElement(mPhoneNumberContainer, mPhoneNumberTextView, userInfo.getPhone(), mPhoneNumberIcon,
tint);
@ -470,7 +470,8 @@ public class UserInfoActivity extends FileActivity {
} else {
// show error
runOnUiThread(() -> setErrorMessageForMultiList(sorryMessage, result.getLogMessage()));
runOnUiThread(() -> setErrorMessageForMultiList(sorryMessage, result.getLogMessage(),
R.drawable.ic_list_empty_error));
Log_OC.d(TAG, result.getLogMessage());
}
});

View file

@ -749,5 +749,7 @@
<string name="screenshot_06_davdroid">Sync Calendar &amp; Contacts with DAVdroid</string>
<string name="userinfo_no_info_headline">No info</string>
<string name="userinfo_no_info_text">No user info available. You can add informations on your personal site.</string>
<string name="userinfo_no_info_text">No personal info set.\nAdd name, picture and contact details on your profile
page.
</string>
</resources>