Add share hint for sharing group link.
This commit is contained in:
parent
f707c1d02c
commit
f81f50646e
3 changed files with 26 additions and 4 deletions
|
@ -6,6 +6,7 @@ import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
@ -54,10 +55,11 @@ public final class GroupLinkBottomSheetDialogFragment extends BottomSheetDialogF
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @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 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 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 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 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 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();
|
GroupId.V2 groupId = GroupId.parseOrThrow(Objects.requireNonNull(requireArguments().getString(ARG_GROUP_ID))).requireV2();
|
||||||
|
|
||||||
|
@ -70,6 +72,10 @@ public final class GroupLinkBottomSheetDialogFragment extends BottomSheetDialogF
|
||||||
return;
|
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 -> {
|
shareViaSignalButton.setOnClickListener(v -> {
|
||||||
Context context = requireContext();
|
Context context = requireContext();
|
||||||
Intent intent = new Intent(context, ShareActivity.class);
|
Intent intent = new Intent(context, ShareActivity.class);
|
||||||
|
|
|
@ -16,6 +16,20 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/group_link_bottom_sheet_hint"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textAppearance="@style/TextAppearance.Signal.Body2"
|
||||||
|
android:textColor="@color/signal_text_secondary"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:text="@string/GroupLinkBottomSheet_share_hint_requiring_approval"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/group_link_bottom_sheet_share_via_signal_button"
|
android:id="@+id/group_link_bottom_sheet_share_via_signal_button"
|
||||||
style="@style/Widget.Signal.Button.TextButton.Drawable"
|
style="@style/Widget.Signal.Button.TextButton.Drawable"
|
||||||
|
|
|
@ -2780,6 +2780,8 @@
|
||||||
<string name="GroupsLearnMore_paragraph_3">Signal will offer a way to upgrade Legacy Groups in the future.</string>
|
<string name="GroupsLearnMore_paragraph_3">Signal will offer a way to upgrade Legacy Groups in the future.</string>
|
||||||
|
|
||||||
<!-- GroupLinkBottomSheetDialogFragment -->
|
<!-- GroupLinkBottomSheetDialogFragment -->
|
||||||
|
<string name="GroupLinkBottomSheet_share_hint_requiring_approval">Anyone with this link can view the group\'s name and photo and request to join. Share it with people you trust.</string>
|
||||||
|
<string name="GroupLinkBottomSheet_share_hint_not_requiring_approval">Anyone with this link can view the group\'s name and photo and join the group. Share it with people you trust.</string>
|
||||||
<string name="GroupLinkBottomSheet_share_via_signal">Share via Signal</string>
|
<string name="GroupLinkBottomSheet_share_via_signal">Share via Signal</string>
|
||||||
<string name="GroupLinkBottomSheet_copy">Copy</string>
|
<string name="GroupLinkBottomSheet_copy">Copy</string>
|
||||||
<string name="GroupLinkBottomSheet_qr_code">QR Code</string>
|
<string name="GroupLinkBottomSheet_qr_code">QR Code</string>
|
||||||
|
|
Loading…
Add table
Reference in a new issue