Merge branch 'main' into update-core-and-stuff-11/4/25

This commit is contained in:
adb 2025-04-11 16:17:31 +00:00 committed by GitHub
commit c07b2b4aa1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 12 deletions

View file

@ -3,6 +3,7 @@
## Unreleased ## Unreleased
* hide superfluous "Show Classic E-mails" advanced setting for chatmail * 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; * remove mostly non-telling transport addresses when referring to a contact;
the contact's profile gives a much better overview 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 * Disable AEAP to enable us to overhaul some things - there are big changes underway in this area, which will come in a few months

View file

@ -24,7 +24,7 @@ public class ProfilePreference extends Preference {
private ImageView avatarView; private ImageView avatarView;
private TextView profileNameView; private TextView profileNameView;
private TextView profileAddressView; private TextView profileStatusView;
public ProfilePreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { public ProfilePreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes); super(context, attrs, defStyleAttr, defStyleRes);
@ -55,21 +55,15 @@ public class ProfilePreference extends Preference {
super.onBindViewHolder(viewHolder); super.onBindViewHolder(viewHolder);
avatarView = (ImageView)viewHolder.findViewById(R.id.avatar); avatarView = (ImageView)viewHolder.findViewById(R.id.avatar);
profileNameView = (TextView)viewHolder.findViewById(R.id.profile_name); profileNameView = (TextView)viewHolder.findViewById(R.id.profile_name);
profileAddressView = (TextView)viewHolder.findViewById(R.id.number); profileStatusView = (TextView)viewHolder.findViewById(R.id.profile_status);
refresh(); refresh();
} }
public void refresh() { public void refresh() {
if (profileAddressView == null) return; if (profileNameView == null) return;
final String address = DcHelper.get(getContext(), DcHelper.CONFIG_CONFIGURED_ADDRESS); 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()))); final MyProfileContactPhoto profileImage = new MyProfileContactPhoto(address, String.valueOf(Prefs.getProfileAvatarId(getContext())));
GlideApp.with(getContext().getApplicationContext()) GlideApp.with(getContext().getApplicationContext())
@ -79,10 +73,18 @@ public class ProfilePreference extends Preference {
.diskCacheStrategy(DiskCacheStrategy.NONE) .diskCacheStrategy(DiskCacheStrategy.NONE)
.into(avatarView); .into(avatarView);
final String profileName = DcHelper.get(getContext(), DcHelper.CONFIG_DISPLAY_NAME);
if (!TextUtils.isEmpty(profileName)) { if (!TextUtils.isEmpty(profileName)) {
profileNameView.setText(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));
}
} }
} }

View file

@ -29,12 +29,14 @@
android:textSize="20sp" android:textSize="20sp"
tools:text="Voltarine DeClyre"/> tools:text="Voltarine DeClyre"/>
<TextView android:id="@+id/number" <TextView android:id="@+id/profile_status"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="start" android:gravity="start"
android:textAlignment="viewStart" android:textAlignment="viewStart"
tools:text="+14151231234"/> android:singleLine="true"
android:ellipsize="marquee"
tools:text="I use Delta Chat :)"/>
</LinearLayout> </LinearLayout>