mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
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:
@@ -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
|
||||
|
||||
+12
-10
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,12 +29,14 @@
|
||||
android:textSize="20sp"
|
||||
tools:text="Voltarine DeClyre"/>
|
||||
|
||||
<TextView android:id="@+id/number"
|
||||
<TextView android:id="@+id/profile_status"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="start"
|
||||
android:textAlignment="viewStart"
|
||||
tools:text="+14151231234"/>
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
tools:text="I use Delta Chat :)"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user