app/src/main/java/com/sap/cloud/mobile/fiori/demo/onboarding/OnboardingView.java
@Override
    public void startEnterPasscode() {
        Intent i = new Intent();
        i.setComponent(new ComponentName(activity.getPackageName(),
                "com.sap.cloud.mobile.onboarding.passcode.EnterPasscodeActivity"));
        EnterPasscodeSettings settings;

        if (activity.isUITest) {
            settings = new EnterPasscodeSettings(activity.getIntent());
        } else {
            settings = new EnterPasscodeSettings();

            boolean resetEnabled = activity.sharedPreferences.getBoolean(
                    "passcode_reset_enabled", true);
            settings.setResetEnabled(resetEnabled);

            boolean finalDisabled = activity.sharedPreferences.getBoolean(
                    "passcode_final_disabled", false);
            settings.setFinalDisabled(finalDisabled);

            String headlineLabel = activity.sharedPreferences.getString(
                    "passcode_enter_title", null);
            if (headlineLabel != null) {
                settings.setTitle(headlineLabel);
            }

            String detailLabel = activity.sharedPreferences.getString(
                    "passcode_enter_instruction_text", null);
            if (detailLabel != null) {
                settings.setInstructionText(detailLabel);
            }

            String changeHeadlineLabel = activity.sharedPreferences.getString(
                    "passcode_change_title", null);
            if (changeHeadlineLabel != null) {
                settings.setChangeTitle(changeHeadlineLabel);
            }

            String changeDetailLabel = activity.sharedPreferences.getString(
                    "passcode_change_instruction_text", null);
            if (changeDetailLabel != null) {
                settings.setChangeInstructionText(changeDetailLabel);
            }

            String enterButtonText = activity.sharedPreferences.getString(
                    "passcode_enter_done_button_text", null);
            if (enterButtonText != null) {
                settings.setDoneButtonText(enterButtonText);
            }

            String resetButtonText = activity.sharedPreferences.getString(
                    "passcode_enter_reset_button_text", null);
            if (resetButtonText != null) {
                settings.setResetButtonText(resetButtonText);
            }

            String skipButtonText = activity.sharedPreferences.getString(
                    "passcode_change_skip_button_text", null);
            if (skipButtonText != null) {
                settings.setCancelButtonText(skipButtonText);
            }

            String alertDialogHeaderText = activity.sharedPreferences.getString(
                    "passcode_alert_dialog_header_text", null);
            if (alertDialogHeaderText != null) {
                settings.setMaxAttemptsReachedMessage(alertDialogHeaderText);
            }

            String alertDialogBodyText = activity.sharedPreferences.getString(
                    "passcode_alert_dialog_body_text", null);
            if (alertDialogBodyText != null) {
                settings.setEnterCredentialsMessage(alertDialogBodyText);
            }

            String alertDialogButtonText = activity.sharedPreferences.getString(
                    "passcode_alert_dialog_button_text", null);
            if (alertDialogButtonText != null) {
                settings.setOkButtonString(alertDialogButtonText);
            }
        }

        settings.saveToIntent(i);
        activity.startActivityForResult(i, OnboardingActivity.ENTER_PASSCODE);
    }
/**
     * Starts an enter passcode activity with intent configured based on the shared preferences.
     */
Starts an enter passcode activity with intent configured based on the shared preferences.
Starts an enter passcode activity with intent configured based on the shared preferences .
@Override
    public void startEnterPasscode() {
        Intent i = new Intent();
        i.setComponent(new ComponentName(activity.getPackageName(),
                "com.sap.cloud.mobile.onboarding.passcode.EnterPasscodeActivity"));
        EnterPasscodeSettings settings;
        if (activity.isUITest) {
            settings = new EnterPasscodeSettings(activity.getIntent());
        } else {
            settings = new EnterPasscodeSettings();
            boolean resetEnabled = activity.sharedPreferences.getBoolean(
                    "passcode_reset_enabled", true);
            settings.setResetEnabled(resetEnabled);
            boolean finalDisabled = activity.sharedPreferences.getBoolean(
                    "passcode_final_disabled", false);
            settings.setFinalDisabled(finalDisabled);
            String headlineLabel = activity.sharedPreferences.getString(
                    "passcode_enter_title", null);
            if (headlineLabel != null) {
                settings.setTitle(headlineLabel);
            }
            String detailLabel = activity.sharedPreferences.getString(
                    "passcode_enter_instruction_text", null);
            if (detailLabel != null) {
                settings.setInstructionText(detailLabel);
            }
            String changeHeadlineLabel = activity.sharedPreferences.getString(
                    "passcode_change_title", null);
            if (changeHeadlineLabel != null) {
                settings.setChangeTitle(changeHeadlineLabel);
            }
            String changeDetailLabel = activity.sharedPreferences.getString(
                    "passcode_change_instruction_text", null);
            if (changeDetailLabel != null) {
                settings.setChangeInstructionText(changeDetailLabel);
            }
            String enterButtonText = activity.sharedPreferences.getString(
                    "passcode_enter_done_button_text", null);
            if (enterButtonText != null) {
                settings.setDoneButtonText(enterButtonText);
            }
            String resetButtonText = activity.sharedPreferences.getString(
                    "passcode_enter_reset_button_text", null);
            if (resetButtonText != null) {
                settings.setResetButtonText(resetButtonText);
            }
            String skipButtonText = activity.sharedPreferences.getString(
                    "passcode_change_skip_button_text", null);
            if (skipButtonText != null) {
                settings.setCancelButtonText(skipButtonText);
            }
            String alertDialogHeaderText = activity.sharedPreferences.getString(
                    "passcode_alert_dialog_header_text", null);
            if (alertDialogHeaderText != null) {
                settings.setMaxAttemptsReachedMessage(alertDialogHeaderText);
            }
            String alertDialogBodyText = activity.sharedPreferences.getString(
                    "passcode_alert_dialog_body_text", null);
            if (alertDialogBodyText != null) {
                settings.setEnterCredentialsMessage(alertDialogBodyText);
            }
            String alertDialogButtonText = activity.sharedPreferences.getString(
                    "passcode_alert_dialog_button_text", null);
            if (alertDialogButtonText != null) {
                settings.setOkButtonString(alertDialogButtonText);
            }
        }
        settings.saveToIntent(i);
        activity.startActivityForResult(i, OnboardingActivity.ENTER_PASSCODE);
    }
@ Override public void startEnterPasscode ( ) { Intent i = new Intent ( ) ; i . setComponent ( new ComponentName ( activity . getPackageName ( ) , "com.sap.cloud.mobile.onboarding.passcode.EnterPasscodeActivity" ) ) ; EnterPasscodeSettings settings ; if ( activity . isUITest ) { settings = new EnterPasscodeSettings ( activity . getIntent ( ) ) ; } else { settings = new EnterPasscodeSettings ( ) ; boolean resetEnabled = activity . sharedPreferences . getBoolean ( "passcode_reset_enabled" , true ) ; settings . setResetEnabled ( resetEnabled ) ; boolean finalDisabled = activity . sharedPreferences . getBoolean ( "passcode_final_disabled" , false ) ; settings . setFinalDisabled ( finalDisabled ) ; String headlineLabel = activity . sharedPreferences . getString ( "passcode_enter_title" , null ) ; if ( headlineLabel != null ) { settings . setTitle ( headlineLabel ) ; } String detailLabel = activity . sharedPreferences . getString ( "passcode_enter_instruction_text" , null ) ; if ( detailLabel != null ) { settings . setInstructionText ( detailLabel ) ; } String changeHeadlineLabel = activity . sharedPreferences . getString ( "passcode_change_title" , null ) ; if ( changeHeadlineLabel != null ) { settings . setChangeTitle ( changeHeadlineLabel ) ; } String changeDetailLabel = activity . sharedPreferences . getString ( "passcode_change_instruction_text" , null ) ; if ( changeDetailLabel != null ) { settings . setChangeInstructionText ( changeDetailLabel ) ; } String enterButtonText = activity . sharedPreferences . getString ( "passcode_enter_done_button_text" , null ) ; if ( enterButtonText != null ) { settings . setDoneButtonText ( enterButtonText ) ; } String resetButtonText = activity . sharedPreferences . getString ( "passcode_enter_reset_button_text" , null ) ; if ( resetButtonText != null ) { settings . setResetButtonText ( resetButtonText ) ; } String skipButtonText = activity . sharedPreferences . getString ( "passcode_change_skip_button_text" , null ) ; if ( skipButtonText != null ) { settings . setCancelButtonText ( skipButtonText ) ; } String alertDialogHeaderText = activity . sharedPreferences . getString ( "passcode_alert_dialog_header_text" , null ) ; if ( alertDialogHeaderText != null ) { settings . setMaxAttemptsReachedMessage ( alertDialogHeaderText ) ; } String alertDialogBodyText = activity . sharedPreferences . getString ( "passcode_alert_dialog_body_text" , null ) ; if ( alertDialogBodyText != null ) { settings . setEnterCredentialsMessage ( alertDialogBodyText ) ; } String alertDialogButtonText = activity . sharedPreferences . getString ( "passcode_alert_dialog_button_text" , null ) ; if ( alertDialogButtonText != null ) { settings . setOkButtonString ( alertDialogButtonText ) ; } } settings . saveToIntent ( i ) ; activity . startActivityForResult ( i , OnboardingActivity . ENTER_PASSCODE ) ; }
Starts an enter passcode activity with intent configured based on the shared preferences.
Starts an enter passcode activity with intent configured based on the shared preferences .