Prevent nfc dialog from closing when touching outside of it, add cancel button
This commit is contained in:
parent
de3791de3f
commit
703e0b34e7
|
@ -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();
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
android:measureAllChildren="false"
|
||||
android:minHeight="?listPreferredItemHeightSmall"
|
||||
android:outAnimation="@anim/fade_out"
|
||||
custom:initialView="3">
|
||||
custom:initialView="0">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -41,6 +41,16 @@
|
|||
android:adjustViewBounds="true"
|
||||
android:background="@android:color/transparent"
|
||||
android:src="@drawable/yubikey_phone" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/nfc_activity_0_cancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="48dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_below="@+id/nfc_activity_0_image"
|
||||
android:layout_margin="8dp"
|
||||
android:text="@string/progress_cancel" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
|
|
Loading…
Reference in a new issue