Updated on 2026-08-14
This commit is contained in:
parent
6578d7c8c2
commit
89a6e55bab
16 changed files with 259 additions and 359 deletions
|
|
@ -1,40 +0,0 @@
|
|||
package com.tangem.presentation.dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.app.DialogFragment;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
|
||||
import com.tangem.wallet.R;
|
||||
|
||||
/**
|
||||
* Created by dvol on 18.02.2018.
|
||||
*/
|
||||
|
||||
public class NFCEnableDialog extends DialogFragment {
|
||||
public static final String TAG = NFCEnableDialog.class.getSimpleName();
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||
builder.setCancelable(false)
|
||||
.setIcon(R.drawable.ic_action_nfc_gray)
|
||||
.setTitle(R.string.nfc_disabled)
|
||||
.setMessage(R.string.enable_nfc)
|
||||
.setPositiveButton(R.string.dialog_ok,
|
||||
(dialog, id) -> {
|
||||
// take user to wireless settings
|
||||
getActivity().startActivity(new Intent(Settings.ACTION_WIRELESS_SETTINGS));
|
||||
})
|
||||
.setNegativeButton(R.string.dialog_quit,
|
||||
(dialog, id) -> {
|
||||
dialog.cancel();
|
||||
getActivity().finish();
|
||||
});
|
||||
return builder.create();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.tangem.presentation.dialog
|
||||
|
||||
import android.app.Dialog
|
||||
import android.app.DialogFragment
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.provider.Settings
|
||||
import android.support.v7.app.AlertDialog
|
||||
|
||||
import com.tangem.wallet.R
|
||||
|
||||
class NfcEnableDialog : DialogFragment() {
|
||||
|
||||
companion object {
|
||||
val TAG: String = NfcEnableDialog::class.java.simpleName
|
||||
}
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
|
||||
val builder = AlertDialog.Builder(activity)
|
||||
builder.setCancelable(false)
|
||||
.setIcon(R.drawable.ic_action_nfc_gray)
|
||||
.setTitle(R.string.nfc_disabled)
|
||||
.setMessage(R.string.enable_nfc)
|
||||
.setPositiveButton(R.string.dialog_ok
|
||||
) { _, _ ->
|
||||
// take user to wireless settings
|
||||
activity.startActivity(Intent(Settings.ACTION_WIRELESS_SETTINGS))
|
||||
}
|
||||
.setNegativeButton(R.string.dialog_quit
|
||||
) { dialog, _ ->
|
||||
dialog.cancel()
|
||||
activity.finish()
|
||||
}
|
||||
return builder.create()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
package com.tangem.presentation.dialog;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.app.DialogFragment;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.tangem.wallet.R;
|
||||
|
||||
public class NoExtendedLengthSupportDialog extends DialogFragment {
|
||||
public static final String TAG = NoExtendedLengthSupportDialog.class.getSimpleName();
|
||||
|
||||
public static boolean allReadyShowed = false;
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
return new AlertDialog.Builder(getActivity())
|
||||
.setIcon(R.drawable.tangem_logo_small_new)
|
||||
.setTitle(R.string.warning)
|
||||
.setMessage(R.string.the_nfc_adapter_length_apdu)
|
||||
.setPositiveButton(R.string.got_it, (dialog, whichButton) -> NoExtendedLengthSupportDialog.allReadyShowed = true)
|
||||
.create();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
super.onCancel(dialog);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.tangem.presentation.dialog
|
||||
|
||||
import android.app.AlertDialog
|
||||
import android.app.Dialog
|
||||
import android.app.DialogFragment
|
||||
import android.os.Bundle
|
||||
|
||||
import com.tangem.wallet.R
|
||||
|
||||
class NoExtendedLengthSupportDialog : DialogFragment() {
|
||||
|
||||
companion object {
|
||||
val TAG: String = NoExtendedLengthSupportDialog::class.java.simpleName
|
||||
var allReadyShowed = false
|
||||
}
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
return AlertDialog.Builder(activity)
|
||||
.setIcon(R.drawable.tangem_logo_small_new)
|
||||
.setTitle(R.string.warning)
|
||||
.setMessage(R.string.the_nfc_adapter_length_apdu)
|
||||
.setPositiveButton(R.string.got_it) { _, _ -> NoExtendedLengthSupportDialog.allReadyShowed = true }
|
||||
.create()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
package com.tangem.presentation.dialog;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.app.DialogFragment;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.tangem.wallet.R;
|
||||
|
||||
public class RootFoundDialog extends DialogFragment {
|
||||
public static final String TAG = RootFoundDialog.class.getSimpleName();
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
return new AlertDialog.Builder(getActivity())
|
||||
.setIcon(R.drawable.tangem_logo_small_new)
|
||||
.setTitle(R.string.device_is_rooted)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(R.string.got_it, null)
|
||||
.create();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.tangem.presentation.dialog
|
||||
|
||||
import android.app.AlertDialog
|
||||
import android.app.Dialog
|
||||
import android.app.DialogFragment
|
||||
import android.os.Bundle
|
||||
|
||||
import com.tangem.wallet.R
|
||||
|
||||
class RootFoundDialog : DialogFragment() {
|
||||
|
||||
companion object {
|
||||
val TAG: String = RootFoundDialog::class.java.simpleName
|
||||
}
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
return AlertDialog.Builder(activity)
|
||||
.setIcon(R.drawable.tangem_logo_small_new)
|
||||
.setTitle(R.string.device_is_rooted)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(R.string.got_it, null)
|
||||
.create()
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue