willowtreeapps / sign-in-with-apple-button-android

An Android library for Sign In with Apple
MIT License
283 stars 68 forks source link

Hide/Show Apple icon & Custom Typeface support #69

Open jcchikikomori opened 4 years ago

jcchikikomori commented 4 years ago

Usages

Hide/Show Apple icon

<!-- Add "sign_in_with_apple_button_enableIcon" -->
<com.willowtreeapps.signinwithapplebutton.view.SignInWithAppleButton
            android:id="@+id/sign_in_with_apple_button"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="6dp"
            android:background="@drawable/bg_apple_signin_button"
            app:sign_in_with_apple_button_textType="signInWithApple"
            app:sign_in_with_apple_button_enableIcon="false" 
            style="@style/AppleSignInButton" />

Custom Typeface support

@BindView(R.id.sign_in_with_apple_button)
SignInWithAppleButton signInWithAppleButton;

...

SignInWithAppleConfiguration configuration = new SignInWithAppleConfiguration(
         BuildConfig.APPLE_SIGNIN_CLIENT_ID,
         BuildConfig.APPLE_SIGNIN_REDIRECT_URL,
         "name email"
);
signInWithAppleButton.setTypeFace(Typeface.createFromAsset(this.getAssets(), "fonts/whatever.ttf"));