diff --git a/CHANGELOG.md b/CHANGELOG.md index cdfecb308..76e910654 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased * hide superfluous "Show Classic E-mails" advanced setting for chatmail +* show profile bio/status under name in main settings screen * remove mostly non-telling transport addresses when referring to a contact; the contact's profile gives a much better overview * Disable AEAP to enable us to overhaul some things - there are big changes underway in this area, which will come in a few months diff --git a/src/main/java/org/thoughtcrime/securesms/preferences/widgets/ProfilePreference.java b/src/main/java/org/thoughtcrime/securesms/preferences/widgets/ProfilePreference.java index 34785739e..307c79a76 100644 --- a/src/main/java/org/thoughtcrime/securesms/preferences/widgets/ProfilePreference.java +++ b/src/main/java/org/thoughtcrime/securesms/preferences/widgets/ProfilePreference.java @@ -24,7 +24,7 @@ public class ProfilePreference extends Preference { private ImageView avatarView; private TextView profileNameView; - private TextView profileAddressView; + private TextView profileStatusView; public ProfilePreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); @@ -55,21 +55,15 @@ public class ProfilePreference extends Preference { super.onBindViewHolder(viewHolder); avatarView = (ImageView)viewHolder.findViewById(R.id.avatar); profileNameView = (TextView)viewHolder.findViewById(R.id.profile_name); - profileAddressView = (TextView)viewHolder.findViewById(R.id.number); + profileStatusView = (TextView)viewHolder.findViewById(R.id.profile_status); refresh(); } public void refresh() { - if (profileAddressView == null) return; + if (profileNameView == null) return; final String address = DcHelper.get(getContext(), DcHelper.CONFIG_CONFIGURED_ADDRESS); - String profileName = DcHelper.get(getContext(), DcHelper.CONFIG_DISPLAY_NAME); - - if(profileName==null || profileName.isEmpty()) { - profileName = getContext().getString(R.string.pref_profile_info_headline); - } - final MyProfileContactPhoto profileImage = new MyProfileContactPhoto(address, String.valueOf(Prefs.getProfileAvatarId(getContext()))); GlideApp.with(getContext().getApplicationContext()) @@ -79,10 +73,18 @@ public class ProfilePreference extends Preference { .diskCacheStrategy(DiskCacheStrategy.NONE) .into(avatarView); + final String profileName = DcHelper.get(getContext(), DcHelper.CONFIG_DISPLAY_NAME); if (!TextUtils.isEmpty(profileName)) { profileNameView.setText(profileName); + } else { + profileNameView.setText(getContext().getString(R.string.pref_profile_info_headline)); } - profileAddressView.setText(address); + final String status = DcHelper.get(getContext(), DcHelper.CONFIG_SELF_STATUS); + if (!TextUtils.isEmpty(status)) { + profileStatusView.setText(status); + } else { + profileStatusView.setText(getContext().getString(R.string.pref_default_status_label)); + } } } diff --git a/src/main/res/layout/profile_preference_view.xml b/src/main/res/layout/profile_preference_view.xml index 2c0351c52..1662572c2 100644 --- a/src/main/res/layout/profile_preference_view.xml +++ b/src/main/res/layout/profile_preference_view.xml @@ -29,12 +29,14 @@ android:textSize="20sp" tools:text="Voltarine DeClyre"/> - + android:singleLine="true" + android:ellipsize="marquee" + tools:text="I use Delta Chat :)"/>