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 <adb@merlinux.eu>
Co-authored-by: adbenitez <asieldbenitez@gmail.com>
This commit is contained in:
bjoern
2025-04-11 18:15:36 +02:00
committed by GitHub
parent c6c66f19f2
commit 389dddc9ea
3 changed files with 17 additions and 12 deletions
@@ -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));
}
}
}