From 389dddc9ea00effe37d235383a8d3c3c24382702 Mon Sep 17 00:00:00 2001 From: bjoern Date: Fri, 11 Apr 2025 18:15:36 +0200 Subject: [PATCH] remove address from primary settings UI (#3730) * remove address from primary settings UI showing the address here prominently results in bad UX as ppl try to pass the address around, which will not result in e2ee and will often not work. see https://github.com/deltachat/deltachat-ios/pull/2664 for more resoning and discussion, eg. why remove it unconditionally * show status * update changelog --------- Co-authored-by: adb Co-authored-by: adbenitez --- CHANGELOG.md | 1 + .../widgets/ProfilePreference.java | 22 ++++++++++--------- .../res/layout/profile_preference_view.xml | 6 +++-- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2883aad3f..3e7853e9b 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 :)"/>