Show bottom sheet when you tap an avatar in the story viewer.

This commit is contained in:
Greyson Parrelli
2022-11-08 17:34:02 -05:00
parent 9851bc300e
commit 512ba2b0a8
4 changed files with 43 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ package org.thoughtcrime.securesms.recipients.ui.bottomsheet;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
@@ -83,6 +84,7 @@ public final class RecipientBottomSheetDialogFragment extends BottomSheetDialogF
private View buttonStrip;
private View interactionsContainer;
private BadgeImageView badgeImageView;
private Callback callback;
public static BottomSheetDialogFragment create(@NonNull RecipientId recipientId,
@Nullable GroupId groupId)
@@ -341,6 +343,8 @@ public final class RecipientBottomSheetDialogFragment extends BottomSheetDialogF
removeAdminButton.setEnabled(!busy);
removeFromGroupButton.setEnabled(!busy);
});
callback = getParentFragment() != null && getParentFragment() instanceof Callback ? (Callback) getParentFragment() : null;
}
private void openSystemContactSheet(@NonNull Intent intent) {
@@ -363,4 +367,16 @@ public final class RecipientBottomSheetDialogFragment extends BottomSheetDialogF
public void show(@NonNull FragmentManager manager, @Nullable String tag) {
BottomSheetUtil.show(manager, tag, this);
}
@Override
public void onDismiss(@NonNull DialogInterface dialog) {
super.onDismiss(dialog);
if (callback != null) {
callback.onRecipientBottomSheetDismissed();
}
}
public interface Callback {
void onRecipientBottomSheetDismissed();
}
}