From 44fe43c74cb31591a9aef16f81f5de7d44d93238 Mon Sep 17 00:00:00 2001 From: Alan Evans Date: Wed, 10 Jun 2020 08:47:40 -0300 Subject: [PATCH] Hide 'Add to a group' for non-registered users. --- .../ui/bottomsheet/RecipientBottomSheetDialogFragment.java | 2 ++ app/src/main/res/layout/recipient_bottom_sheet.xml | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/recipients/ui/bottomsheet/RecipientBottomSheetDialogFragment.java b/app/src/main/java/org/thoughtcrime/securesms/recipients/ui/bottomsheet/RecipientBottomSheetDialogFragment.java index f29edd2b47..5699d8f8f9 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/recipients/ui/bottomsheet/RecipientBottomSheetDialogFragment.java +++ b/app/src/main/java/org/thoughtcrime/securesms/recipients/ui/bottomsheet/RecipientBottomSheetDialogFragment.java @@ -148,6 +148,8 @@ public final class RecipientBottomSheetDialogFragment extends BottomSheetDialogF startActivityForResult(RecipientExporter.export(recipient).asAddContactIntent(), REQUEST_CODE_ADD_CONTACT); }); } + + addToGroupButton.setVisibility(recipient.isRegistered() && !recipient.isGroup() ? View.VISIBLE : View.GONE); }); viewModel.getAdminActionStatus().observe(getViewLifecycleOwner(), adminStatus -> { diff --git a/app/src/main/res/layout/recipient_bottom_sheet.xml b/app/src/main/res/layout/recipient_bottom_sheet.xml index 6627bd910e..6d017a2533 100644 --- a/app/src/main/res/layout/recipient_bottom_sheet.xml +++ b/app/src/main/res/layout/recipient_bottom_sheet.xml @@ -127,7 +127,9 @@ android:paddingStart="20dp" android:paddingEnd="20dp" android:text="@string/RecipientBottomSheet_add_to_a_group" - app:drawableStartCompat="?attr/recipient_make_admin_icon" /> + android:visibility="gone" + app:drawableStartCompat="?attr/recipient_make_admin_icon" + tools:visibility="visible" />