Java Code Examples for com.firebase.ui.auth.AuthUI#getDefaultTheme()

The following examples show how to use com.firebase.ui.auth.AuthUI#getDefaultTheme() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AuthUiActivity.java    From FirebaseUI-Android with Apache License 2.0 5 votes vote down vote up
@StyleRes
private int getSelectedTheme() {
    if (mGreenTheme.isChecked()) {
        return R.style.GreenTheme;
    }

    if (mPurpleTheme.isChecked()) {
        return R.style.PurpleTheme;
    }

    return AuthUI.getDefaultTheme();
}
 
Example 2
Source File: TestHelper.java    From FirebaseUI-Android with Apache License 2.0 4 votes vote down vote up
public static FlowParameters getFlowParameters(Collection<String> providerIds,
                                               boolean enableAnonymousUpgrade,
                                               AuthMethodPickerLayout customLayout) {
    List<IdpConfig> idpConfigs = new ArrayList<>();
    for (String providerId : providerIds) {
        switch (providerId) {
            case GoogleAuthProvider.PROVIDER_ID:
                idpConfigs.add(new IdpConfig.GoogleBuilder().build());
                break;
            case FacebookAuthProvider.PROVIDER_ID:
                idpConfigs.add(new IdpConfig.FacebookBuilder().build());
                break;
            case TwitterAuthProvider.PROVIDER_ID:
                idpConfigs.add(new IdpConfig.TwitterBuilder().build());
                break;
            case GithubAuthProvider.PROVIDER_ID:
                idpConfigs.add(new IdpConfig.GitHubBuilder().build());
                break;
            case EMAIL_LINK_PROVIDER:
                idpConfigs.add(new IdpConfig.EmailBuilder().enableEmailLinkSignIn()
                        .setActionCodeSettings(ActionCodeSettings.newBuilder().setUrl("URL")
                                .setHandleCodeInApp(true).build()).build());
                break;
            case EmailAuthProvider.PROVIDER_ID:
                idpConfigs.add(new IdpConfig.EmailBuilder().build());
                break;
            case PhoneAuthProvider.PROVIDER_ID:
                idpConfigs.add(new IdpConfig.PhoneBuilder().build());
                break;
            case AuthUI.ANONYMOUS_PROVIDER:
                idpConfigs.add(new IdpConfig.AnonymousBuilder().build());
                break;
            case MICROSOFT_PROVIDER:
                idpConfigs.add(new IdpConfig.MicrosoftBuilder().build());
                break;
            default:
                throw new IllegalArgumentException("Unknown provider: " + providerId);
        }
    }
    return new FlowParameters(
            DEFAULT_APP_NAME,
            idpConfigs,
            AuthUI.getDefaultTheme(),
            AuthUI.NO_LOGO,
            null,
            null,
            true,
            true,
            enableAnonymousUpgrade,
            false,
            null,
            customLayout);
}