mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
committed by
Cody Henthorne
parent
1965d5879f
commit
7ea9fc0c3b
@@ -6,6 +6,8 @@ import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
|
||||
/**
|
||||
@@ -22,7 +24,7 @@ public final class CanNotSendPaymentDialog {
|
||||
}
|
||||
|
||||
public static void show(@NonNull Context context, @Nullable Runnable onSendAMessageClicked) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context)
|
||||
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context)
|
||||
.setTitle(R.string.CanNotSendPaymentDialog__cant_send_payment)
|
||||
.setMessage(R.string.CanNotSendPaymentDialog__to_send_a_payment_to_this_user);
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@ import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.navigation.Navigation;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.util.navigation.SafeNavigation;
|
||||
import org.thoughtcrime.securesms.util.text.AfterTextChanged;
|
||||
@@ -53,7 +55,7 @@ public class PaymentsRecoveryPasteFragment extends Fragment {
|
||||
}
|
||||
|
||||
private void showErrorDialog() {
|
||||
new AlertDialog.Builder(requireContext())
|
||||
new MaterialAlertDialogBuilder(requireContext())
|
||||
.setTitle(R.string.PaymentsRecoveryPasteFragment__invalid_recovery_phrase)
|
||||
.setMessage(getString(R.string.PaymentsRecoveryPasteFragment__make_sure, PaymentsConstants.MNEMONIC_LENGTH))
|
||||
.setPositiveButton(android.R.string.ok, (dialog, which) -> dialog.dismiss())
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package org.thoughtcrime.securesms.payments.backup.phrase;
|
||||
|
||||
import android.app.AlarmManager;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
@@ -21,6 +20,7 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import org.signal.core.util.PendingIntentFlags;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
@@ -134,7 +134,7 @@ public class PaymentsRecoveryPhraseFragment extends Fragment {
|
||||
}
|
||||
|
||||
private void confirmCopy(@NonNull List<String> words) {
|
||||
new AlertDialog.Builder(requireContext())
|
||||
new MaterialAlertDialogBuilder(requireContext())
|
||||
.setTitle(R.string.PaymentsRecoveryPhraseFragment__copy_to_clipboard)
|
||||
.setMessage(R.string.PaymentsRecoveryPhraseFragment__if_you_choose_to_store)
|
||||
.setPositiveButton(R.string.PaymentsRecoveryPhraseFragment__copy, (dialog, which) -> copyWordsToClipboard(words))
|
||||
@@ -149,7 +149,7 @@ public class PaymentsRecoveryPhraseFragment extends Fragment {
|
||||
Navigation.findNavController(requireView()).popBackStack(R.id.paymentsHome, false);
|
||||
break;
|
||||
case ERROR:
|
||||
new AlertDialog.Builder(requireContext())
|
||||
new MaterialAlertDialogBuilder(requireContext())
|
||||
.setTitle(R.string.PaymentsRecoveryPhraseFragment__invalid_recovery_phrase)
|
||||
.setMessage(R.string.PaymentsRecoveryPhraseFragment__make_sure_youve_entered_your_phrase_correctly_and_try_again)
|
||||
.setPositiveButton(android.R.string.ok, (dialog, which) -> dialog.dismiss())
|
||||
|
||||
@@ -125,7 +125,7 @@ public class ConfirmPaymentFragment extends BottomSheetDialogFragment {
|
||||
RecipientHasNotEnabledPaymentsDialog.show(requireContext());
|
||||
break;
|
||||
case CAN_NOT_GET_FEE:
|
||||
new AlertDialog.Builder(requireContext())
|
||||
new MaterialAlertDialogBuilder(requireContext())
|
||||
.setMessage(R.string.ConfirmPaymentFragment__unable_to_request_a_network_fee)
|
||||
.setPositiveButton(android.R.string.ok, (dialog, which) -> {
|
||||
dialog.dismiss();
|
||||
|
||||
@@ -319,7 +319,7 @@ public class PaymentsHomeFragment extends LoggingFragment {
|
||||
}
|
||||
|
||||
private void showPaymentsDisabledDialog() {
|
||||
new AlertDialog.Builder(requireActivity())
|
||||
new MaterialAlertDialogBuilder(requireActivity())
|
||||
.setMessage(R.string.PaymentsHomeFragment__payments_not_available)
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.show();
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package org.thoughtcrime.securesms.payments.preferences.transfer;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.AlertDialog;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
@@ -15,6 +14,8 @@ import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.navigation.NavDirections;
|
||||
import androidx.navigation.Navigation;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.LoggingFragment;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
@@ -67,7 +68,7 @@ public final class PaymentsTransferFragment extends LoggingFragment {
|
||||
MobileCoinPublicAddress publicAddress = MobileCoinPublicAddress.fromBase58(base58Address);
|
||||
|
||||
if (ownAddress.equals(publicAddress)) {
|
||||
new AlertDialog.Builder(requireContext())
|
||||
new MaterialAlertDialogBuilder(requireContext())
|
||||
.setTitle(R.string.PaymentsTransferFragment__invalid_address)
|
||||
.setMessage(R.string.PaymentsTransferFragment__you_cant_transfer_to_your_own_signal_wallet_address)
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
@@ -82,7 +83,7 @@ public final class PaymentsTransferFragment extends LoggingFragment {
|
||||
return true;
|
||||
} catch (MobileCoinPublicAddress.AddressException e) {
|
||||
Log.w(TAG, "Address is not valid", e);
|
||||
new AlertDialog.Builder(requireContext())
|
||||
new MaterialAlertDialogBuilder(requireContext())
|
||||
.setTitle(R.string.PaymentsTransferFragment__invalid_address)
|
||||
.setMessage(R.string.PaymentsTransferFragment__check_the_wallet_address)
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
@@ -103,7 +104,7 @@ public final class PaymentsTransferFragment extends LoggingFragment {
|
||||
}
|
||||
|
||||
private void onCameraPermissionPermanentlyDenied() {
|
||||
new AlertDialog.Builder(requireContext())
|
||||
new MaterialAlertDialogBuilder(requireContext())
|
||||
.setTitle(R.string.Permissions_permission_required)
|
||||
.setMessage(R.string.PaymentsTransferFragment__signal_needs_the_camera_permission_to_capture_qr_code_go_to_settings)
|
||||
.setPositiveButton(R.string.PaymentsTransferFragment__settings, (dialog, which) -> requireActivity().startActivity(Permissions.getApplicationSettingsIntent(requireContext())))
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.thoughtcrime.securesms.payments.preferences.viewholder;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextPaint;
|
||||
@@ -15,6 +14,8 @@ import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.content.res.AppCompatResources;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.payments.preferences.PaymentsHomeAdapter;
|
||||
import org.thoughtcrime.securesms.payments.preferences.model.InfoCard;
|
||||
@@ -50,7 +51,7 @@ public class InfoCardViewHolder extends MappingViewHolder<InfoCard> {
|
||||
toolbar.inflateMenu(R.menu.payment_info_card_overflow);
|
||||
toolbar.setOnMenuItemClickListener(item -> {
|
||||
if (item.getItemId() == R.id.action_hide) {
|
||||
new AlertDialog.Builder(getContext())
|
||||
new MaterialAlertDialogBuilder(getContext())
|
||||
.setMessage(R.string.payment_info_card_hide_this_card)
|
||||
.setPositiveButton(R.string.payment_info_card_hide, (dialog, which) -> {
|
||||
model.dismiss();
|
||||
|
||||
Reference in New Issue
Block a user