Updated on 2026-08-14
This commit is contained in:
parent
858f609667
commit
9bb8931709
84 changed files with 619 additions and 659 deletions
|
|
@ -18,9 +18,9 @@ class NoExtendedLengthSupportDialog : DialogFragment() {
|
|||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
return AlertDialog.Builder(activity)
|
||||
.setIcon(R.drawable.tangem_logo_small_new)
|
||||
.setTitle(R.string.warning)
|
||||
.setTitle(R.string.dialog_warning)
|
||||
.setMessage(message)
|
||||
.setPositiveButton(R.string.got_it) { _, _ -> NoExtendedLengthSupportDialog.allReadyShowed = false }
|
||||
.setPositiveButton(R.string.dialog_btn_got_it) { _, _ -> NoExtendedLengthSupportDialog.allReadyShowed = false }
|
||||
.create()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,11 +38,11 @@ public class PINSwapWarningDialog extends DialogFragment {
|
|||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
return new AlertDialog.Builder(getActivity())
|
||||
.setIcon(R.drawable.tangem_logo_small_new)
|
||||
.setTitle(R.string.your_money_is_at_risk)
|
||||
.setTitle(R.string.dialog_title_money_is_at_risk)
|
||||
.setMessage(message)
|
||||
.setCancelable(true)
|
||||
.setNegativeButton(R.string.cancel, (dialog, which) -> dismiss())
|
||||
.setPositiveButton(R.string.contin, (dialog, whichButton) -> mOnPositiveButton.onRefresh())
|
||||
.setNegativeButton(R.string.general_cancel, (dialog, which) -> dismiss())
|
||||
.setPositiveButton(R.string.general_continue, (dialog, whichButton) -> mOnPositiveButton.onRefresh())
|
||||
.create();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@ class RootFoundDialog : DialogFragment() {
|
|||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
return AlertDialog.Builder(activity)
|
||||
.setIcon(R.drawable.tangem_logo_small_new)
|
||||
.setTitle(R.string.device_is_rooted)
|
||||
.setTitle(R.string.dialog_device_is_rooted)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(R.string.got_it, null)
|
||||
.setPositiveButton(R.string.dialog_btn_got_it, null)
|
||||
.create()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,12 +11,12 @@ import android.view.WindowManager;
|
|||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.tangem.util.UtilHelper;
|
||||
import com.tangem.wallet.R;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
|
||||
import com.tangem.util.UtilHelper;
|
||||
import com.tangem.wallet.R;
|
||||
|
||||
/**
|
||||
* Created by dvol on 06.03.2018.
|
||||
*/
|
||||
|
|
@ -49,9 +49,9 @@ public class ShowQRCodeDialog extends DialogFragment {
|
|||
|
||||
return new AlertDialog.Builder(getActivity())
|
||||
.setIcon(R.drawable.tangem_logo_small_new)
|
||||
.setTitle(R.string.show_wallet_qr_code)
|
||||
.setTitle(R.string.loaded_wallet_dialog_show_qr)
|
||||
.setView(v)
|
||||
.setPositiveButton(R.string.ok, (dialog,which)->dismiss() )
|
||||
.setPositiveButton(R.string.general_ok, (dialog, which)->dismiss() )
|
||||
.create();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ public class WaitSecurityDelayDialog extends DialogFragment {
|
|||
}, 1000, 1000);
|
||||
return new AlertDialog.Builder(getActivity())
|
||||
.setIcon(R.drawable.tangem_logo_small_new)
|
||||
.setTitle(R.string.security_delay)
|
||||
.setTitle(R.string.dialog_security_delay)
|
||||
.setView(v)
|
||||
.setCancelable(false)
|
||||
.create();
|
||||
|
|
@ -79,6 +79,9 @@ public class WaitSecurityDelayDialog extends DialogFragment {
|
|||
}
|
||||
|
||||
public static void onReadBeforeRequest(final FragmentActivity activity, final int timeout) {
|
||||
if (activity == null) return;
|
||||
|
||||
Log.e(TAG, "onReadBeforeRequest callback(" + timeout + ")");
|
||||
activity.runOnUiThread(() -> {
|
||||
if (timerToShowDelayDialog != null || timeout < delayBeforeShowDialog + minRemainingDelayToShowDialog)
|
||||
return;
|
||||
|
|
@ -98,44 +101,31 @@ public class WaitSecurityDelayDialog extends DialogFragment {
|
|||
}
|
||||
|
||||
public static void onReadAfterRequest(final Activity activity) {
|
||||
activity.runOnUiThread(() -> {
|
||||
if (timerToShowDelayDialog == null) return;
|
||||
timerToShowDelayDialog.cancel();
|
||||
timerToShowDelayDialog = null;
|
||||
});
|
||||
if (timerToShowDelayDialog == null) return;
|
||||
timerToShowDelayDialog.cancel();
|
||||
timerToShowDelayDialog = null;
|
||||
}
|
||||
|
||||
public static void onReadWait(final FragmentActivity activity, final int msec) {
|
||||
Log.e(TAG, "onReadWait callback(" + msec + ")");
|
||||
if (timerToShowDelayDialog != null) {
|
||||
timerToShowDelayDialog.cancel();
|
||||
timerToShowDelayDialog = null;
|
||||
}
|
||||
|
||||
if (msec == 0 && instance != null) {
|
||||
try {
|
||||
instance.dismissAllowingStateLoss();
|
||||
instance = null;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (activity == null) return;
|
||||
|
||||
activity.runOnUiThread(() -> {
|
||||
Log.e(TAG, "onReadWait on ui thread(" + msec + ")");
|
||||
if (timerToShowDelayDialog != null) {
|
||||
timerToShowDelayDialog.cancel();
|
||||
timerToShowDelayDialog = null;
|
||||
}
|
||||
|
||||
if (msec == 0) {
|
||||
if (instance != null) {
|
||||
if (instance.isAdded()) {
|
||||
instance.dismissAllowingStateLoss();
|
||||
instance = null;
|
||||
} else {
|
||||
Log.e(TAG, "onReadWait(0) with not added dialog");
|
||||
// instance.progressBar.postDelayed(() -> {
|
||||
// Log.e(TAG, "onReadWait(0) dismiss delayed");
|
||||
try {
|
||||
instance.dismissAllowingStateLoss();
|
||||
instance = null;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
// }, 10000);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (instance == null) {
|
||||
if (msec > delayBeforeShowDialog + minRemainingDelayToShowDialog) {
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import android.annotation.SuppressLint
|
|||
import android.app.AlertDialog
|
||||
import android.app.Dialog
|
||||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatDialogFragment
|
||||
import android.widget.ProgressBar
|
||||
import androidx.appcompat.app.AppCompatDialogFragment
|
||||
import com.tangem.ui.event.ReadAfterRequest
|
||||
import com.tangem.ui.event.ReadBeforeRequest
|
||||
import com.tangem.ui.event.ReadWait
|
||||
|
|
@ -54,7 +54,7 @@ class WaitSecurityDelayDialogNew : AppCompatDialogFragment() {
|
|||
|
||||
return AlertDialog.Builder(activity)
|
||||
.setIcon(R.drawable.tangem_logo_small_new)
|
||||
.setTitle(R.string.security_delay)
|
||||
.setTitle(R.string.dialog_security_delay)
|
||||
.setView(v)
|
||||
.setCancelable(false)
|
||||
.create()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue