Directly show about sheet when you show a recipient sheet for yourself.
This commit is contained in:
parent
83c1bd61cb
commit
a886e5f9a0
11 changed files with 30 additions and 33 deletions
|
@ -54,7 +54,6 @@ public final class GroupMembersDialog {
|
|||
}
|
||||
|
||||
private void contactClick(@NonNull Recipient recipient) {
|
||||
RecipientBottomSheetDialogFragment.create(recipient.getId(), groupRecipient.requireGroupId())
|
||||
.show(fragmentActivity.getSupportFragmentManager(), "BOTTOM");
|
||||
RecipientBottomSheetDialogFragment.show(fragmentActivity.getSupportFragmentManager(), recipient.getId(), groupRecipient.requireGroupId());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -244,8 +244,7 @@ public final class AvatarImageView extends AppCompatImageView {
|
|||
ConversationSettingsActivity.createTransitionBundle(context, this));
|
||||
} else {
|
||||
if (context instanceof FragmentActivity) {
|
||||
RecipientBottomSheetDialogFragment.create(recipient.getId(), null)
|
||||
.show(((FragmentActivity) context).getSupportFragmentManager(), "BOTTOM");
|
||||
RecipientBottomSheetDialogFragment.show(((FragmentActivity) context).getSupportFragmentManager(), recipient.getId(), null);
|
||||
} else {
|
||||
context.startActivity(ConversationSettingsActivity.forRecipient(context, recipient.getId()),
|
||||
ConversationSettingsActivity.createTransitionBundle(context, this));
|
||||
|
|
|
@ -95,8 +95,7 @@ fun ResultItem(result: InternalSearchResult, modifier: Modifier = Modifier) {
|
|||
.clickable {
|
||||
if (activity != null) {
|
||||
RecipientBottomSheetDialogFragment
|
||||
.create(result.id, result.groupId)
|
||||
.show(activity.supportFragmentManager, "TAG")
|
||||
.show(activity.supportFragmentManager, result.id, result.groupId)
|
||||
}
|
||||
}
|
||||
.padding(8.dp)
|
||||
|
|
|
@ -695,7 +695,7 @@ class ConversationSettingsFragment : DSLSettingsFragment(
|
|||
recipient = member.member,
|
||||
isAdmin = member.isAdmin,
|
||||
onClick = {
|
||||
RecipientBottomSheetDialogFragment.create(member.member.id, groupState.groupId).show(parentFragmentManager, "BOTTOM")
|
||||
RecipientBottomSheetDialogFragment.show(parentFragmentManager, member.member.id, groupState.groupId)
|
||||
}
|
||||
)
|
||||
)
|
||||
|
|
|
@ -2725,7 +2725,7 @@ class ConversationFragment :
|
|||
|
||||
override fun onGroupMemberClicked(recipientId: RecipientId, groupId: GroupId) {
|
||||
context ?: return
|
||||
RecipientBottomSheetDialogFragment.create(recipientId, groupId).show(childFragmentManager, BottomSheetUtil.STANDARD_BOTTOM_SHEET_FRAGMENT_TAG)
|
||||
RecipientBottomSheetDialogFragment.show(childFragmentManager, recipientId, groupId)
|
||||
}
|
||||
|
||||
override fun onMessageWithErrorClicked(messageRecord: MessageRecord) {
|
||||
|
@ -2858,10 +2858,11 @@ class ConversationFragment :
|
|||
override fun onRecipientNameClicked(target: RecipientId) {
|
||||
context ?: return
|
||||
disposables += viewModel.recipient.firstOrError().observeOn(AndroidSchedulers.mainThread()).subscribeBy {
|
||||
RecipientBottomSheetDialogFragment.create(
|
||||
RecipientBottomSheetDialogFragment.show(
|
||||
parentFragmentManager,
|
||||
target,
|
||||
it.groupId.orElse(null)
|
||||
).show(parentFragmentManager, BottomSheetUtil.STANDARD_BOTTOM_SHEET_FRAGMENT_TAG)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -52,9 +52,7 @@ public class PendingMemberInvitesFragment extends Fragment {
|
|||
youInvited.initializeAdapter(getViewLifecycleOwner());
|
||||
othersInvited.initializeAdapter(getViewLifecycleOwner());
|
||||
|
||||
youInvited.setRecipientClickListener(recipient ->
|
||||
RecipientBottomSheetDialogFragment.create(recipient.getId(), null)
|
||||
.show(requireActivity().getSupportFragmentManager(), BottomSheetUtil.STANDARD_BOTTOM_SHEET_FRAGMENT_TAG));
|
||||
youInvited.setRecipientClickListener(recipient -> RecipientBottomSheetDialogFragment.show(requireActivity().getSupportFragmentManager(), recipient.getId(), null));
|
||||
|
||||
youInvited.setAdminActionsListener(new AdminActionsListener() {
|
||||
|
||||
|
|
|
@ -55,8 +55,7 @@ public class RequestingMembersFragment extends Fragment {
|
|||
requestingMembers.initializeAdapter(getViewLifecycleOwner());
|
||||
|
||||
requestingMembers.setRecipientClickListener(recipient -> {
|
||||
RecipientBottomSheetDialogFragment.create(recipient.getId(), null)
|
||||
.show(requireActivity().getSupportFragmentManager(), BottomSheetUtil.STANDARD_BOTTOM_SHEET_FRAGMENT_TAG);
|
||||
RecipientBottomSheetDialogFragment.show(requireActivity().getSupportFragmentManager(), recipient.getId(), null);
|
||||
});
|
||||
|
||||
requestingMembers.setAdminActionsListener(new AdminActionsListener() {
|
||||
|
|
|
@ -175,8 +175,7 @@ public class ReviewCardDialogFragment extends FullScreenDialogFragment {
|
|||
|
||||
@Override
|
||||
public void onCardClicked(@NonNull ReviewCard card) {
|
||||
RecipientBottomSheetDialogFragment.create(card.getReviewRecipient().getId(), null)
|
||||
.show(requireFragmentManager(), null);
|
||||
RecipientBottomSheetDialogFragment.show(getParentFragmentManager(), card.getReviewRecipient().getId(), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -19,6 +19,7 @@ import android.widget.Toast;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
|
@ -41,6 +42,7 @@ import org.thoughtcrime.securesms.recipients.RecipientExporter;
|
|||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientUtil;
|
||||
import org.thoughtcrime.securesms.recipients.ui.about.AboutSheet;
|
||||
import org.thoughtcrime.securesms.recipients.ui.about.AboutSheetKt;
|
||||
import org.thoughtcrime.securesms.util.BottomSheetUtil;
|
||||
import org.thoughtcrime.securesms.util.ContextUtil;
|
||||
import org.thoughtcrime.securesms.util.SpanUtil;
|
||||
|
@ -89,20 +91,23 @@ public final class RecipientBottomSheetDialogFragment extends BottomSheetDialogF
|
|||
|
||||
private ButtonStripPreference.ViewHolder buttonStripViewHolder;
|
||||
|
||||
public static BottomSheetDialogFragment create(@NonNull RecipientId recipientId,
|
||||
@Nullable GroupId groupId)
|
||||
{
|
||||
Bundle args = new Bundle();
|
||||
RecipientBottomSheetDialogFragment fragment = new RecipientBottomSheetDialogFragment();
|
||||
public static void show(FragmentManager fragmentManager, @NonNull RecipientId recipientId, @Nullable GroupId groupId) {
|
||||
Recipient recipient = Recipient.resolved(recipientId);
|
||||
if (recipient.isSelf()) {
|
||||
AboutSheet.create(recipient).show(fragmentManager, BottomSheetUtil.STANDARD_BOTTOM_SHEET_FRAGMENT_TAG);
|
||||
} else {
|
||||
Bundle args = new Bundle();
|
||||
RecipientBottomSheetDialogFragment fragment = new RecipientBottomSheetDialogFragment();
|
||||
|
||||
args.putString(ARGS_RECIPIENT_ID, recipientId.serialize());
|
||||
if (groupId != null) {
|
||||
args.putString(ARGS_GROUP_ID, groupId.toString());
|
||||
args.putString(ARGS_RECIPIENT_ID, recipientId.serialize());
|
||||
if (groupId != null) {
|
||||
args.putString(ARGS_GROUP_ID, groupId.toString());
|
||||
}
|
||||
|
||||
fragment.setArguments(args);
|
||||
|
||||
fragment.show(fragmentManager, BottomSheetUtil.STANDARD_BOTTOM_SHEET_FRAGMENT_TAG);
|
||||
}
|
||||
|
||||
fragment.setArguments(args);
|
||||
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -933,8 +933,7 @@ class StoryViewerPageFragment :
|
|||
private fun onSenderClicked(senderId: RecipientId) {
|
||||
viewModel.setIsDisplayingRecipientBottomSheet(true)
|
||||
RecipientBottomSheetDialogFragment
|
||||
.create(senderId, null)
|
||||
.show(childFragmentManager, "BOTTOM")
|
||||
.show(childFragmentManager, senderId, null)
|
||||
}
|
||||
|
||||
private fun presentBottomBar(post: StoryPost, replyState: StoryViewerPageState.ReplyState, isReceiptsEnabled: Boolean) {
|
||||
|
|
|
@ -271,8 +271,7 @@ class StoryGroupReplyFragment :
|
|||
onCopyClick = { s -> onCopyClick(s) },
|
||||
onMentionClick = { recipientId ->
|
||||
RecipientBottomSheetDialogFragment
|
||||
.create(recipientId, null)
|
||||
.show(childFragmentManager, null)
|
||||
.show(childFragmentManager, recipientId, null)
|
||||
},
|
||||
onDeleteClick = { m -> onDeleteClick(m) },
|
||||
onTapForDetailsClick = { m -> onTapForDetailsClick(m) }
|
||||
|
|
Loading…
Add table
Reference in a new issue