Merge branch 'main' into adb/pgp-contacts2

This commit is contained in:
adb 2025-07-08 21:20:15 +00:00 committed by GitHub
commit 0ba20e9fc8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 18 additions and 27 deletions

View file

@ -9,6 +9,7 @@
* New icon for the in-chat apps button
* Improve hint for app drafts
* Add Text-To-Speech (TTS) support for in-chat apps
* New icon for the QR icon
## v1.58.4
2025-05

View file

@ -157,8 +157,4 @@ public class ConversationTitleView extends RelativeLayout {
public void setOnBackClickedListener(@Nullable OnClickListener listener) {
this.back.setOnClickListener(listener);
}
public void registerForContextMenu(Activity activity) {
activity.registerForContextMenu(content);
}
}

View file

@ -8,6 +8,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
import com.b44t.messenger.DcChat;
@ -44,6 +45,7 @@ public class ProfileAdapter extends RecyclerView.Adapter
public static final int ITEM_SHARED_CHATS = 60;
private final @NonNull Context context;
private final @NonNull Fragment fragment;
private final @NonNull DcContext dcContext;
private @Nullable DcChat dcChat;
private @Nullable DcContact dcContact;
@ -83,12 +85,13 @@ public class ProfileAdapter extends RecyclerView.Adapter
}
};
public ProfileAdapter(@NonNull Context context,
public ProfileAdapter(@NonNull Fragment fragment,
@NonNull GlideRequests glideRequests,
@Nullable ItemClickListener clickListener)
{
super();
this.context = context;
this.fragment = fragment;
this.context = fragment.requireContext();
this.glideRequests = glideRequests;
this.clickListener = clickListener;
this.dcContext = DcHelper.getContext(context);
@ -211,6 +214,9 @@ public class ProfileAdapter extends RecyclerView.Adapter
if (data.viewType == ITEM_LAST_SEEN || data.viewType == ITEM_ADDRESS) {
int padding = (int)((float)context.getResources().getDimensionPixelSize(R.dimen.contact_list_normal_padding) * 1.2);
item.setPadding(item.getPaddingLeft(), item.getPaddingTop(), item.getPaddingRight(), padding);
if (data.viewType == ITEM_ADDRESS) {
fragment.registerForContextMenu(item);
}
} else if (data.viewType == ITEM_INTRODUCED_BY) {
int padding = context.getResources().getDimensionPixelSize(R.dimen.contact_list_normal_padding);
item.setPadding(item.getPaddingLeft(), padding, item.getPaddingRight(), item.getPaddingBottom());
@ -318,7 +324,7 @@ public class ProfileAdapter extends RecyclerView.Adapter
}
}
if (sharedChats != null && !isDeviceTalk) {
if (!isDeviceTalk && sharedChats != null && sharedChats.getCnt() > 0) {
itemData.add(new ItemData(ITEM_HEADER, context.getString(R.string.profile_shared_chats), 0));
for (int i = 0; i < sharedChats.getCnt(); i++) {
itemData.add(new ItemData(ITEM_SHARED_CHATS, 0, i));

View file

@ -67,7 +67,7 @@ public class ProfileFragment extends Fragment
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.profile_fragment, container, false);
adapter = new ProfileAdapter(requireContext(), GlideApp.with(this), this);
adapter = new ProfileAdapter(this, GlideApp.with(this), this);
RecyclerView list = ViewUtil.findById(view, R.id.recycler_view);
list.setAdapter(adapter);

View file

@ -79,7 +79,7 @@ public class ContactSelectionListItem extends LinearLayout implements RecipientM
this.nameView.setTypeface(null, Typeface.NORMAL);
}
if (specialId == DcContact.DC_CONTACT_ID_QR_INVITE) {
this.avatar.setImageDrawable(new ResourceContactPhoto(R.drawable.baseline_qr_code_24).asDrawable(getContext(), ThemeUtil.getDummyContactColor(getContext())));
this.avatar.setImageDrawable(new ResourceContactPhoto(R.drawable.ic_qr_code_24).asDrawable(getContext(), ThemeUtil.getDummyContactColor(getContext())));
} else {
this.avatar.setAvatar(glideRequests, recipient, false);
}

View file

@ -1,15 +0,0 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M3,11h8V3H3V11zM5,5h4v4H5V5z"/>
<path android:fillColor="@android:color/white" android:pathData="M3,21h8v-8H3V21zM5,15h4v4H5V15z"/>
<path android:fillColor="@android:color/white" android:pathData="M13,3v8h8V3H13zM19,9h-4V5h4V9z"/>
<path android:fillColor="@android:color/white" android:pathData="M19,19h2v2h-2z"/>
<path android:fillColor="@android:color/white" android:pathData="M13,13h2v2h-2z"/>
<path android:fillColor="@android:color/white" android:pathData="M15,15h2v2h-2z"/>
<path android:fillColor="@android:color/white" android:pathData="M13,17h2v2h-2z"/>
<path android:fillColor="@android:color/white" android:pathData="M15,19h2v2h-2z"/>
<path android:fillColor="@android:color/white" android:pathData="M17,17h2v2h-2z"/>
<path android:fillColor="@android:color/white" android:pathData="M17,13h2v2h-2z"/>
<path android:fillColor="@android:color/white" android:pathData="M19,15h2v2h-2z"/>
</vector>

View file

@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M15,21h-2v-2h2V21zM13,14h-2v5h2V14zM21,12h-2v4h2V12zM19,10h-2v2h2V10zM7,12H5v2h2V12zM5,10H3v2h2V10zM12,5h2V3h-2V5zM4.5,4.5v3h3v-3H4.5zM9,9H3V3h6V9zM4.5,16.5v3h3v-3H4.5zM9,21H3v-6h6V21zM16.5,4.5v3h3v-3H16.5zM21,9h-6V3h6V9zM19,19v-3l-4,0v2h2v3h4v-2H19zM17,12l-4,0v2h4V12zM13,10H7v2h2v2h2v-2h2V10zM14,9V7h-2V5h-2v4L14,9zM6.75,5.25h-1.5v1.5h1.5V5.25zM6.75,17.25h-1.5v1.5h1.5V17.25zM18.75,5.25h-1.5v1.5h1.5V5.25z"/>
</vector>

View file

@ -6,9 +6,9 @@
<View android:id="@+id/label"
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_height="1dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="?attr/contact_list_divider"/>
android:background="?attr/conversation_list_item_divider"/>
</LinearLayout>

View file

@ -4,7 +4,7 @@
<item android:title="@string/qr_code"
android:id="@+id/menu_qr"
android:icon="@drawable/baseline_qr_code_24"
android:icon="@drawable/ic_qr_code_24"
app:showAsAction="ifRoom"/>
<item android:title="@string/invite_friends"