From f81f50646e22ea80983ad1b67800dee2ed291ff4 Mon Sep 17 00:00:00 2001 From: Alan Evans Date: Thu, 25 Feb 2021 18:09:36 -0400 Subject: [PATCH] Add share hint for sharing group link. --- .../GroupLinkBottomSheetDialogFragment.java | 14 ++++++++++---- .../res/layout/group_link_share_bottom_sheet.xml | 14 ++++++++++++++ app/src/main/res/values/strings.xml | 2 ++ 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/recipients/ui/sharablegrouplink/GroupLinkBottomSheetDialogFragment.java b/app/src/main/java/org/thoughtcrime/securesms/recipients/ui/sharablegrouplink/GroupLinkBottomSheetDialogFragment.java index 708f8195be6..bb82061b476 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/recipients/ui/sharablegrouplink/GroupLinkBottomSheetDialogFragment.java +++ b/app/src/main/java/org/thoughtcrime/securesms/recipients/ui/sharablegrouplink/GroupLinkBottomSheetDialogFragment.java @@ -6,6 +6,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; @@ -54,10 +55,11 @@ public void onCreate(@Nullable Bundle savedInstanceState) { public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.group_link_share_bottom_sheet, container, false); - View shareViaSignalButton = view.findViewById(R.id.group_link_bottom_sheet_share_via_signal_button); - View copyButton = view.findViewById(R.id.group_link_bottom_sheet_copy_button); - View viewQrButton = view.findViewById(R.id.group_link_bottom_sheet_qr_code_button); - View shareBySystemButton = view.findViewById(R.id.group_link_bottom_sheet_share_via_system_button); + View shareViaSignalButton = view.findViewById(R.id.group_link_bottom_sheet_share_via_signal_button); + View copyButton = view.findViewById(R.id.group_link_bottom_sheet_copy_button); + View viewQrButton = view.findViewById(R.id.group_link_bottom_sheet_qr_code_button); + View shareBySystemButton = view.findViewById(R.id.group_link_bottom_sheet_share_via_system_button); + TextView hint = view.findViewById(R.id.group_link_bottom_sheet_hint); GroupId.V2 groupId = GroupId.parseOrThrow(Objects.requireNonNull(requireArguments().getString(ARG_GROUP_ID))).requireV2(); @@ -70,6 +72,10 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c return; } + hint.setText(groupLink.isRequiresApproval() ? R.string.GroupLinkBottomSheet_share_hint_requiring_approval + : R.string.GroupLinkBottomSheet_share_hint_not_requiring_approval); + hint.setVisibility(View.VISIBLE); + shareViaSignalButton.setOnClickListener(v -> { Context context = requireContext(); Intent intent = new Intent(context, ShareActivity.class); diff --git a/app/src/main/res/layout/group_link_share_bottom_sheet.xml b/app/src/main/res/layout/group_link_share_bottom_sheet.xml index 4632665aec3..13590c32afa 100644 --- a/app/src/main/res/layout/group_link_share_bottom_sheet.xml +++ b/app/src/main/res/layout/group_link_share_bottom_sheet.xml @@ -16,6 +16,20 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> + +