Prevent nfc dialog from closing when touching outside of it, add cancel button
This commit is contained in:
@@ -238,7 +238,7 @@ public class CreateKeyEmailFragment extends Fragment {
|
||||
if (createKeyActivity.mCreateYubiKey) {
|
||||
hideKeyboard();
|
||||
|
||||
CreateYubiKeyPinRepeatFragment frag = CreateYubiKeyPinRepeatFragment.newInstance();
|
||||
CreateYubiKeyPinFragment frag = CreateYubiKeyPinFragment.newInstance();
|
||||
mCreateKeyActivity.loadFragment(frag, FragAction.TO_RIGHT);
|
||||
} else {
|
||||
CreateKeyPassphraseFragment frag = CreateKeyPassphraseFragment.newInstance();
|
||||
|
||||
@@ -37,7 +37,7 @@ import java.security.SecureRandom;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
|
||||
public class CreateYubiKeyPinRepeatFragment extends Fragment {
|
||||
public class CreateYubiKeyPinFragment extends Fragment {
|
||||
|
||||
// view
|
||||
CreateKeyActivity mCreateKeyActivity;
|
||||
@@ -65,8 +65,8 @@ public class CreateYubiKeyPinRepeatFragment extends Fragment {
|
||||
/**
|
||||
* Creates new instance of this fragment
|
||||
*/
|
||||
public static CreateYubiKeyPinRepeatFragment newInstance() {
|
||||
CreateYubiKeyPinRepeatFragment frag = new CreateYubiKeyPinRepeatFragment();
|
||||
public static CreateYubiKeyPinFragment newInstance() {
|
||||
CreateYubiKeyPinFragment frag = new CreateYubiKeyPinFragment();
|
||||
|
||||
Bundle args = new Bundle();
|
||||
frag.setArguments(args);
|
||||
@@ -101,7 +101,7 @@ public class CreateYubiKeyPinRepeatFragment extends Fragment {
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.create_yubi_key_pin_repeat_fragment, container, false);
|
||||
View view = inflater.inflate(R.layout.create_yubi_key_pin_fragment, container, false);
|
||||
|
||||
mPin = (EditText) view.findViewById(R.id.create_yubi_key_pin);
|
||||
mPinRepeat = (EditText) view.findViewById(R.id.create_yubi_key_pin_repeat);
|
||||
@@ -92,7 +92,9 @@ public class NfcOperationActivity extends BaseNfcActivity {
|
||||
|
||||
// prevent annoying orientation changes while fumbling with the device
|
||||
OrientationUtils.lockOrientation(this);
|
||||
|
||||
// prevent close when touching outside of the dialog (happens easily when fumbling with the device)
|
||||
setFinishOnTouchOutside(false);
|
||||
// keep screen on
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
|
||||
mInputParcel = getIntent().getParcelableExtra(EXTRA_CRYPTO_INPUT);
|
||||
@@ -115,6 +117,14 @@ public class NfcOperationActivity extends BaseNfcActivity {
|
||||
vAnimator.setDisplayedChild(0);
|
||||
}
|
||||
});
|
||||
Button vCancel = (Button) findViewById(R.id.nfc_activity_0_cancel);
|
||||
vCancel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
setResult(RESULT_CANCELED);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
Intent intent = getIntent();
|
||||
Bundle data = intent.getExtras();
|
||||
|
||||
Reference in New Issue
Block a user