Taracque / cordova-plugin-braintree

:credit_card: A Cordova plugin for the Braintree mobile payment processing SDK.
MIT License
27 stars 42 forks source link

changing header color #17

Open cordovapolymer opened 7 years ago

cordovapolymer commented 7 years ago

How can the blue header color be changed? Do I have to modify braintree sdk itself?

Taracque commented 7 years ago

Where you see that blue header?

cordovapolymer commented 7 years ago

@Taracque confused you, it's gray color header, and blue color button

Taracque commented 7 years ago

Can you please tell where is that header? Is it a PayPal thing, is it on iOS or Android?

cordovapolymer commented 7 years ago

it's in credit card entry screen on Android

Taracque commented 7 years ago

You mean this one? client-sdk-android-drop-in-series This one is part of the Braintree Drop-IN ui, there is no easy way to change that.

cordovapolymer commented 7 years ago

yes, as far as I have looked into this, there's a way to specify a theme for BraintreePaymentActivity. In this case the activity has another name com.braintreepayments.api.BraintreeBrowserSwitchActivity.

cordovapolymer commented 7 years ago

@Taracque any thoughts on this?

Taracque commented 7 years ago

I guess the activity name is AddCardActivity in the com.braintreepayments.api.dropin package. You should try to adjust the followings in the manifest to style that window:

        <activity android:name="com.braintreepayments.api.dropin.DropInActivity"
            android:theme="@style/bt_drop_in_activity_theme"/>
        <activity android:name="com.braintreepayments.api.dropin.AddCardActivity"
            android:theme="@style/bt_add_card_activity_theme" />

and those in the styles.xml:

    <style name="bt_drop_in_activity_theme" parent="Theme.AppCompat.NoActionBar">
        <item name="windowNoTitle">true</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowBackground">@color/bt_black_54</item>
        <item name="android:colorBackgroundCacheHint">@null</item>
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowTranslucentStatus" tools:targetApi="kitkat">true</item>
        <item name="android:windowAnimationStyle">@style/bt_fade_activity_animation</item>
        <item name="colorPrimary">@color/bt_color_primary</item>
        <item name="colorPrimaryDark">@color/bt_color_primary_dark</item>
        <item name="colorAccent">@color/bt_blue</item>
    </style>

    <style name="bt_add_card_activity_theme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="windowNoTitle">true</item>
        <item name="colorPrimary">@color/bt_color_primary</item>
        <item name="colorPrimaryDark">@color/bt_color_primary_dark</item>
        <item name="colorAccent">@color/bt_blue</item>
        <item name="titleTextColor">@color/bt_white</item>
        <item name="textColorError">@color/bt_error_red</item>
    </style>