* commit '8cea65f99f23c1a86d7a760b2dba89fa83036959': [Fingerprint] Add skip dialog during SUW
This commit is contained in:
@@ -759,6 +759,13 @@
|
|||||||
<string name="setup_fingerprint_enroll_finish_message">Just touch the fingerprint sensor to wake and unlock your device.</string>
|
<string name="setup_fingerprint_enroll_finish_message">Just touch the fingerprint sensor to wake and unlock your device.</string>
|
||||||
<!-- Message shown when fingerprint enrollment is completed, telling user about the fingerprint icon that will be shown whenever they can use their fingerprint [CHAR LIMIT=NONE] -->
|
<!-- Message shown when fingerprint enrollment is completed, telling user about the fingerprint icon that will be shown whenever they can use their fingerprint [CHAR LIMIT=NONE] -->
|
||||||
<string name="setup_fingerprint_enroll_finish_message_secondary">When you see this icon, you can use your fingerprint.</string>
|
<string name="setup_fingerprint_enroll_finish_message_secondary">When you see this icon, you can use your fingerprint.</string>
|
||||||
|
<!-- Title of the dialog shown when the user tries to skip fingerprint setup, asking them to confirm the action [CHAR LIMIT=40] -->
|
||||||
|
<string name="setup_fingerprint_enroll_enrolling_skip_title">Skip fingerprint setup?</string>
|
||||||
|
<!-- Content of the dialog shown when the user tries to skip fingerprint setup, asking them to confirm the action [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="setup_fingerprint_enroll_enrolling_skip_message">To set up fingerprint access, stay on this screen and follow the instructions.</string>
|
||||||
|
<!-- Label of the button for the user to stay on fingerprint setup screen [CHAR LIMIT=20] -->
|
||||||
|
<string name="setup_fingerprint_enroll_enrolling_stay_button">Stay</string>
|
||||||
|
|
||||||
<!-- Button text to setup screen lock in onboard dialog [CHAR LIMIT=34] -->
|
<!-- Button text to setup screen lock in onboard dialog [CHAR LIMIT=34] -->
|
||||||
<string name="security_settings_fingerprint_enroll_setup_screen_lock">Set up screen lock</string>
|
<string name="security_settings_fingerprint_enroll_setup_screen_lock">Set up screen lock</string>
|
||||||
<!-- Button text to exit fingerprint wizard after everything is done [CHAR LIMIT=15] -->
|
<!-- Button text to exit fingerprint wizard after everything is done [CHAR LIMIT=15] -->
|
||||||
|
@@ -16,19 +16,29 @@
|
|||||||
|
|
||||||
package com.android.settings.fingerprint;
|
package com.android.settings.fingerprint;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.app.DialogFragment;
|
||||||
|
import android.app.FragmentManager;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
|
||||||
import com.android.internal.logging.MetricsLogger;
|
import com.android.internal.logging.MetricsLogger;
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.SetupWizardUtils;
|
import com.android.settings.SetupWizardUtils;
|
||||||
|
import com.android.setupwizardlib.util.SystemBarHelper;
|
||||||
import com.android.setupwizardlib.view.NavigationBar;
|
import com.android.setupwizardlib.view.NavigationBar;
|
||||||
|
|
||||||
public class SetupFingerprintEnrollEnrolling extends FingerprintEnrollEnrolling
|
public class SetupFingerprintEnrollEnrolling extends FingerprintEnrollEnrolling
|
||||||
implements NavigationBar.NavigationBarListener {
|
implements NavigationBar.NavigationBarListener {
|
||||||
|
|
||||||
|
private static final String TAG_DIALOG = "dialog";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Intent getFinishIntent() {
|
protected Intent getFinishIntent() {
|
||||||
final Intent intent = new Intent(this, SetupFingerprintEnrollFinish.class);
|
final Intent intent = new Intent(this, SetupFingerprintEnrollFinish.class);
|
||||||
@@ -69,12 +79,53 @@ public class SetupFingerprintEnrollEnrolling extends FingerprintEnrollEnrolling
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNavigateNext() {
|
public void onNavigateNext() {
|
||||||
setResult(RESULT_SKIP);
|
new SkipDialog().show(getFragmentManager(), TAG_DIALOG);
|
||||||
finish();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getMetricsCategory() {
|
protected int getMetricsCategory() {
|
||||||
return MetricsLogger.FINGERPRINT_ENROLLING_SETUP;
|
return MetricsLogger.FINGERPRINT_ENROLLING_SETUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class SkipDialog extends DialogFragment {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void show(FragmentManager manager, String tag) {
|
||||||
|
if (manager.findFragmentByTag(tag) == null) {
|
||||||
|
super.show(manager, tag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public SkipDialog() {
|
||||||
|
// no-arg constructor for fragment
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||||
|
final AlertDialog dialog = new AlertDialog.Builder(getActivity())
|
||||||
|
.setTitle(R.string.setup_fingerprint_enroll_enrolling_skip_title)
|
||||||
|
.setMessage(R.string.setup_fingerprint_enroll_enrolling_skip_message)
|
||||||
|
.setCancelable(false)
|
||||||
|
.setPositiveButton(R.string.skip_label,
|
||||||
|
new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
Activity activity = getActivity();
|
||||||
|
if (activity != null) {
|
||||||
|
activity.setResult(RESULT_SKIP);
|
||||||
|
activity.finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton(R.string.setup_fingerprint_enroll_enrolling_stay_button,
|
||||||
|
new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.create();
|
||||||
|
SystemBarHelper.hideSystemBars(dialog);
|
||||||
|
return dialog;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user