stripe-android icon indicating copy to clipboard operation
stripe-android copied to clipboard

Tint CardBrandView in CardInputWidget

Open jakeaaron opened this issue 6 years ago • 3 comments

Summary

I'm having trouble figuring out how to tint the CardBrandView image for the case when brand == CardBrand.Unknown

I can see that it uses a tintColorInt to tint it but it's an internal field in an internal class that I can't access without reflection.

Looking at the CardInputWidget it appears that changing the hintTextColors for the EditText associated with the brand view would change the tintColorInt for me, but it doesn't appear to be working.

Am I missing something?

Thanks for your help.

jakeaaron avatar May 21 '20 16:05 jakeaaron

Hi @jakeaaron. Sorry for the late response here! Seems like we completely missed this issue.

You can use the cardTint attribute to achieve this result

e.g.

        <com.stripe.android.view.CardInputWidget
            android:id="@+id/card_widget"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="8dp"
            stripe:cardHintText="@string/sample_card_requiring_3ds"
            stripe:cardTint="@android:color/holo_purple"
            />

Screenshot_1596839698

smaskell-stripe avatar Aug 07 '20 22:08 smaskell-stripe

Hey, @smaskell-stripe, no worries. Thanks a lot for the response 🙏

jakeaaron avatar Sep 15 '20 16:09 jakeaaron

Is there a support for this class in flutter?

Prashast-Blink avatar Aug 01 '23 08:08 Prashast-Blink