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

        if(activity.isUITest){
            settings = new SetPasscodeSettings(activity.getIntent());
            confirmSettings = new ConfirmPasscodeSettings(activity.getIntent());
        }else{
            settings = new SetPasscodeSettings();
            confirmSettings = new ConfirmPasscodeSettings();

            String createPasscodeValidationActionHandler = activity.sharedPreferences.getString("passcode_create_validation_action_handler", null);
            if (createPasscodeValidationActionHandler != null && !createPasscodeValidationActionHandler.equals("")) {
                settings.setValidationActionHandler(createPasscodeValidationActionHandler);
            }

            String createPasscodeSkipButtonText = activity.sharedPreferences.getString("passcode_skip_button_text", null);
            if (createPasscodeSkipButtonText != null && !createPasscodeSkipButtonText.equals("")) {
                settings.setSkipButtonText(createPasscodeSkipButtonText);
            }

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

            String createDoneButtonText = activity.sharedPreferences.getString("passcode_done_button_text", null);
            if (createDoneButtonText != null && !createDoneButtonText.equals("")) {
                settings.setDoneButtonText(createDoneButtonText);
            }

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

            String lowercaseLabel = activity.sharedPreferences.getString("passcode_lowercase_label", null);
            if (lowercaseLabel != null && !lowercaseLabel.equals("")) {
                settings.setLowerCaseLabel(lowercaseLabel);
            }

            String uppercaseLabel = activity.sharedPreferences.getString("passcode_uppercase_label", null);
            if (uppercaseLabel != null && !uppercaseLabel.equals("")) {
                settings.setUpperCaseLabel(uppercaseLabel);
            }

            String digitLabel = activity.sharedPreferences.getString("passcode_digit_label", null);
            if (digitLabel != null && !digitLabel.equals("")) {
                settings.setDigitCaseLabel(digitLabel);
            }

            String symbolLabel = activity.sharedPreferences.getString("passcode_symbol_label", null);
            if (symbolLabel != null && !symbolLabel.equals("")) {
                settings.setSymbolCaseLabel(symbolLabel);
            }

            String nullPolicyAlertHeaderText = activity.sharedPreferences.getString("passcode_alert_dialog_null_policy_header_text", null);
            if (nullPolicyAlertHeaderText != null && !nullPolicyAlertHeaderText.equals("")) {
                settings.setNullPolicyAlertHeaderText(nullPolicyAlertHeaderText);
            }

            String nullPolicyAlertDescText = activity.sharedPreferences.getString("passcode_alert_dialog_null_policy_desc_text", null);
            if (nullPolicyAlertDescText != null && !nullPolicyAlertDescText.equals("")) {
                settings.setNullPolicyAlertDescriptionText(nullPolicyAlertDescText);
            }
            String nullPolicyAlertRetryText = activity.sharedPreferences.getString("passcode_alert_dialog_null_policy_retry_button_text", null);
            if (nullPolicyAlertRetryText != null && !nullPolicyAlertRetryText.equals("")) {
                settings.setNullPolicyAlertRetryButtonText(nullPolicyAlertRetryText);
            }
            String nullPolicyAlertCancelText = activity.sharedPreferences.getString("passcode_alert_dialog_null_policy_cancel_button_text", null);
            if (nullPolicyAlertCancelText != null && !nullPolicyAlertCancelText.equals("")) {
                settings.setNullPolicyAlertCancelButtonText(nullPolicyAlertCancelText);
            }

            String confirmTitleText = activity.sharedPreferences.getString("passcode_confirm_title", null);
            if (confirmTitleText != null && !confirmTitleText.equals("")) {
                confirmSettings.setTitle(confirmTitleText);
            }

            String confirmDoneButtonText = activity.sharedPreferences.getString("passcode_confirm_done_button_text", null);
            if (confirmDoneButtonText != null && !confirmDoneButtonText.equals("")) {
                confirmSettings.setDoneButtonText(confirmDoneButtonText);
            }

            String confirmInstructionText = activity.sharedPreferences.getString("passcode_confirm_instruction_text", null);
            if (confirmInstructionText != null && !confirmInstructionText.equals("")) {
                confirmSettings.setInstructionText(confirmInstructionText);
            }

            String confirmMisMatchText = activity.sharedPreferences.getString("passcode_confirm_mismatch_text", null);
            if (confirmMisMatchText != null && !confirmMisMatchText.equals("")) {
                confirmSettings.setConfirmMismatchText(confirmMisMatchText);
            }

            String confirmCancelButtonText = activity.sharedPreferences.getString("passcode_confirm_button_cancel_text", null);
            if (confirmCancelButtonText != null && !confirmCancelButtonText.equals("")) {
                confirmSettings.setCancelButtonText(confirmCancelButtonText);
            }
        }

        settings.saveToIntent(i);
        confirmSettings.saveToIntent(i);

        activity.startActivityForResult(i, OnboardingActivity.SET_PASSCODE);
    }
/**
     * Starts a set passcode activity with intent configured based on the shared preferences.
     */
Starts a set passcode activity with intent configured based on the shared preferences.
Starts a set passcode activity with intent configured based on the shared preferences .
@Override
    public void startCreatePasscode() {
        Intent i = new Intent();
        i.setComponent(new ComponentName(activity.getPackageName(), "com.sap.cloud.mobile.onboarding.passcode.SetPasscodeActivity"));
        SetPasscodeSettings settings;
        ConfirmPasscodeSettings confirmSettings;
        if(activity.isUITest){
            settings = new SetPasscodeSettings(activity.getIntent());
            confirmSettings = new ConfirmPasscodeSettings(activity.getIntent());
        }else{
            settings = new SetPasscodeSettings();
            confirmSettings = new ConfirmPasscodeSettings();
            String createPasscodeValidationActionHandler = activity.sharedPreferences.getString("passcode_create_validation_action_handler", null);
            if (createPasscodeValidationActionHandler != null && !createPasscodeValidationActionHandler.equals("")) {
                settings.setValidationActionHandler(createPasscodeValidationActionHandler);
            }
            String createPasscodeSkipButtonText = activity.sharedPreferences.getString("passcode_skip_button_text", null);
            if (createPasscodeSkipButtonText != null && !createPasscodeSkipButtonText.equals("")) {
                settings.setSkipButtonText(createPasscodeSkipButtonText);
            }
            String headlineLabel = activity.sharedPreferences.getString("passcode_create_title", null);
            if (headlineLabel != null && !headlineLabel.equals("")) {
                settings.setTitle(headlineLabel);
            }
            String createDoneButtonText = activity.sharedPreferences.getString("passcode_done_button_text", null);
            if (createDoneButtonText != null && !createDoneButtonText.equals("")) {
                settings.setDoneButtonText(createDoneButtonText);
            }
            String detailLabel = activity.sharedPreferences.getString("passcode_create_instruction_text", null);
            if (detailLabel != null && !detailLabel.equals("")) {
                settings.setInstructionText(detailLabel);
            }
            String lowercaseLabel = activity.sharedPreferences.getString("passcode_lowercase_label", null);
            if (lowercaseLabel != null && !lowercaseLabel.equals("")) {
                settings.setLowerCaseLabel(lowercaseLabel);
            }
            String uppercaseLabel = activity.sharedPreferences.getString("passcode_uppercase_label", null);
            if (uppercaseLabel != null && !uppercaseLabel.equals("")) {
                settings.setUpperCaseLabel(uppercaseLabel);
            }
            String digitLabel = activity.sharedPreferences.getString("passcode_digit_label", null);
            if (digitLabel != null && !digitLabel.equals("")) {
                settings.setDigitCaseLabel(digitLabel);
            }
            String symbolLabel = activity.sharedPreferences.getString("passcode_symbol_label", null);
            if (symbolLabel != null && !symbolLabel.equals("")) {
                settings.setSymbolCaseLabel(symbolLabel);
            }
            String nullPolicyAlertHeaderText = activity.sharedPreferences.getString("passcode_alert_dialog_null_policy_header_text", null);
            if (nullPolicyAlertHeaderText != null && !nullPolicyAlertHeaderText.equals("")) {
                settings.setNullPolicyAlertHeaderText(nullPolicyAlertHeaderText);
            }
            String nullPolicyAlertDescText = activity.sharedPreferences.getString("passcode_alert_dialog_null_policy_desc_text", null);
            if (nullPolicyAlertDescText != null && !nullPolicyAlertDescText.equals("")) {
                settings.setNullPolicyAlertDescriptionText(nullPolicyAlertDescText);
            }
            String nullPolicyAlertRetryText = activity.sharedPreferences.getString("passcode_alert_dialog_null_policy_retry_button_text", null);
            if (nullPolicyAlertRetryText != null && !nullPolicyAlertRetryText.equals("")) {
                settings.setNullPolicyAlertRetryButtonText(nullPolicyAlertRetryText);
            }
            String nullPolicyAlertCancelText = activity.sharedPreferences.getString("passcode_alert_dialog_null_policy_cancel_button_text", null);
            if (nullPolicyAlertCancelText != null && !nullPolicyAlertCancelText.equals("")) {
                settings.setNullPolicyAlertCancelButtonText(nullPolicyAlertCancelText);
            }
            String confirmTitleText = activity.sharedPreferences.getString("passcode_confirm_title", null);
            if (confirmTitleText != null && !confirmTitleText.equals("")) {
                confirmSettings.setTitle(confirmTitleText);
            }
            String confirmDoneButtonText = activity.sharedPreferences.getString("passcode_confirm_done_button_text", null);
            if (confirmDoneButtonText != null && !confirmDoneButtonText.equals("")) {
                confirmSettings.setDoneButtonText(confirmDoneButtonText);
            }
            String confirmInstructionText = activity.sharedPreferences.getString("passcode_confirm_instruction_text", null);
            if (confirmInstructionText != null && !confirmInstructionText.equals("")) {
                confirmSettings.setInstructionText(confirmInstructionText);
            }
            String confirmMisMatchText = activity.sharedPreferences.getString("passcode_confirm_mismatch_text", null);
            if (confirmMisMatchText != null && !confirmMisMatchText.equals("")) {
                confirmSettings.setConfirmMismatchText(confirmMisMatchText);
            }
            String confirmCancelButtonText = activity.sharedPreferences.getString("passcode_confirm_button_cancel_text", null);
            if (confirmCancelButtonText != null && !confirmCancelButtonText.equals("")) {
                confirmSettings.setCancelButtonText(confirmCancelButtonText);
            }
        }
        settings.saveToIntent(i);
        confirmSettings.saveToIntent(i);
        activity.startActivityForResult(i, OnboardingActivity.SET_PASSCODE);
    }
@ Override public void startCreatePasscode ( ) { Intent i = new Intent ( ) ; i . setComponent ( new ComponentName ( activity . getPackageName ( ) , "com.sap.cloud.mobile.onboarding.passcode.SetPasscodeActivity" ) ) ; SetPasscodeSettings settings ; ConfirmPasscodeSettings confirmSettings ; if ( activity . isUITest ) { settings = new SetPasscodeSettings ( activity . getIntent ( ) ) ; confirmSettings = new ConfirmPasscodeSettings ( activity . getIntent ( ) ) ; } else { settings = new SetPasscodeSettings ( ) ; confirmSettings = new ConfirmPasscodeSettings ( ) ; String createPasscodeValidationActionHandler = activity . sharedPreferences . getString ( "passcode_create_validation_action_handler" , null ) ; if ( createPasscodeValidationActionHandler != null && ! createPasscodeValidationActionHandler . equals ( "" ) ) { settings . setValidationActionHandler ( createPasscodeValidationActionHandler ) ; } String createPasscodeSkipButtonText = activity . sharedPreferences . getString ( "passcode_skip_button_text" , null ) ; if ( createPasscodeSkipButtonText != null && ! createPasscodeSkipButtonText . equals ( "" ) ) { settings . setSkipButtonText ( createPasscodeSkipButtonText ) ; } String headlineLabel = activity . sharedPreferences . getString ( "passcode_create_title" , null ) ; if ( headlineLabel != null && ! headlineLabel . equals ( "" ) ) { settings . setTitle ( headlineLabel ) ; } String createDoneButtonText = activity . sharedPreferences . getString ( "passcode_done_button_text" , null ) ; if ( createDoneButtonText != null && ! createDoneButtonText . equals ( "" ) ) { settings . setDoneButtonText ( createDoneButtonText ) ; } String detailLabel = activity . sharedPreferences . getString ( "passcode_create_instruction_text" , null ) ; if ( detailLabel != null && ! detailLabel . equals ( "" ) ) { settings . setInstructionText ( detailLabel ) ; } String lowercaseLabel = activity . sharedPreferences . getString ( "passcode_lowercase_label" , null ) ; if ( lowercaseLabel != null && ! lowercaseLabel . equals ( "" ) ) { settings . setLowerCaseLabel ( lowercaseLabel ) ; } String uppercaseLabel = activity . sharedPreferences . getString ( "passcode_uppercase_label" , null ) ; if ( uppercaseLabel != null && ! uppercaseLabel . equals ( "" ) ) { settings . setUpperCaseLabel ( uppercaseLabel ) ; } String digitLabel = activity . sharedPreferences . getString ( "passcode_digit_label" , null ) ; if ( digitLabel != null && ! digitLabel . equals ( "" ) ) { settings . setDigitCaseLabel ( digitLabel ) ; } String symbolLabel = activity . sharedPreferences . getString ( "passcode_symbol_label" , null ) ; if ( symbolLabel != null && ! symbolLabel . equals ( "" ) ) { settings . setSymbolCaseLabel ( symbolLabel ) ; } String nullPolicyAlertHeaderText = activity . sharedPreferences . getString ( "passcode_alert_dialog_null_policy_header_text" , null ) ; if ( nullPolicyAlertHeaderText != null && ! nullPolicyAlertHeaderText . equals ( "" ) ) { settings . setNullPolicyAlertHeaderText ( nullPolicyAlertHeaderText ) ; } String nullPolicyAlertDescText = activity . sharedPreferences . getString ( "passcode_alert_dialog_null_policy_desc_text" , null ) ; if ( nullPolicyAlertDescText != null && ! nullPolicyAlertDescText . equals ( "" ) ) { settings . setNullPolicyAlertDescriptionText ( nullPolicyAlertDescText ) ; } String nullPolicyAlertRetryText = activity . sharedPreferences . getString ( "passcode_alert_dialog_null_policy_retry_button_text" , null ) ; if ( nullPolicyAlertRetryText != null && ! nullPolicyAlertRetryText . equals ( "" ) ) { settings . setNullPolicyAlertRetryButtonText ( nullPolicyAlertRetryText ) ; } String nullPolicyAlertCancelText = activity . sharedPreferences . getString ( "passcode_alert_dialog_null_policy_cancel_button_text" , null ) ; if ( nullPolicyAlertCancelText != null && ! nullPolicyAlertCancelText . equals ( "" ) ) { settings . setNullPolicyAlertCancelButtonText ( nullPolicyAlertCancelText ) ; } String confirmTitleText = activity . sharedPreferences . getString ( "passcode_confirm_title" , null ) ; if ( confirmTitleText != null && ! confirmTitleText . equals ( "" ) ) { confirmSettings . setTitle ( confirmTitleText ) ; } String confirmDoneButtonText = activity . sharedPreferences . getString ( "passcode_confirm_done_button_text" , null ) ; if ( confirmDoneButtonText != null && ! confirmDoneButtonText . equals ( "" ) ) { confirmSettings . setDoneButtonText ( confirmDoneButtonText ) ; } String confirmInstructionText = activity . sharedPreferences . getString ( "passcode_confirm_instruction_text" , null ) ; if ( confirmInstructionText != null && ! confirmInstructionText . equals ( "" ) ) { confirmSettings . setInstructionText ( confirmInstructionText ) ; } String confirmMisMatchText = activity . sharedPreferences . getString ( "passcode_confirm_mismatch_text" , null ) ; if ( confirmMisMatchText != null && ! confirmMisMatchText . equals ( "" ) ) { confirmSettings . setConfirmMismatchText ( confirmMisMatchText ) ; } String confirmCancelButtonText = activity . sharedPreferences . getString ( "passcode_confirm_button_cancel_text" , null ) ; if ( confirmCancelButtonText != null && ! confirmCancelButtonText . equals ( "" ) ) { confirmSettings . setCancelButtonText ( confirmCancelButtonText ) ; } } settings . saveToIntent ( i ) ; confirmSettings . saveToIntent ( i ) ; activity . startActivityForResult ( i , OnboardingActivity . SET_PASSCODE ) ; }
Starts a set passcode activity with intent configured based on the shared preferences.
Starts a set passcode activity with intent configured based on the shared preferences .