Closed acouhier-luna closed 3 weeks ago
Crash is in version v5.3.0 but not in v5.2.0
Hi @acouhier-luna, thanks for reaching out. It seems to me that this issue is coming from the AppCompat
library.
Can you check our theming guide to see whether you have the correct setup on your side?
And since @qmetzler-luna mentioned that you see this issue with 5.3.0
but not in 5.2.0
then it could be related to a dependency update. Can you also update your dependencies and try again? You can check which dependencies we updated in the bottom of our release notes and try to update to the same versions.
Hey! I've got the same issue like @acouhier-luna, down to the line in the xml where it crashes. This is my first time integrating this SDK on version 5.3.0 so can't say i had it working on previous verisons.
I tried updating app dependencies to the latest values in the release notes you mentioned, but it didn't help.
Setting the style to the default works:
<style name="AdyenCheckout" parent="Adyen" />
If, for example, i set the color primary in the theme to an attribute of my app theme, e.g.:
`
</style>`
I get another exception thrown:
While if i reference a color directly everything seems to work. Ideally I'd expect all of the styles to be inherited from my app theme. Please let me know if i can provide any more information to help resolve this.
Also, for some reason, overriding the following, without overriding the AdyenCheckout
style also seems to work, don't know why.
<style name="AdyenCheckout.Card.AddressLookup.DropdownTextInputEditText" parent="AdyenCheckout.DropdownTextInputEditText">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">match_parent</item>
</style>
but then again, overriding both the dropdown text input edit text, and the colors in the adyen checkout works as well:
<style name="AdyenCheckout.Card.AddressLookup.DropdownTextInputEditText" parent="AdyenCheckout.DropdownTextInputEditText">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">match_parent</item>
</style>
<style name="AdyenCheckout" parent="AppTheme">
<item name="colorPrimary">?idBasePrimary</item>
<item name="colorAccent">?idBasePrimary</item>
<item name="android:textColor">?idTextPrimary</item>
<item name="android:textColorPrimary">?idTextPrimary</item>
<item name="android:textColorSecondary">?idTextSecondary</item>
<item name="android:textColorTertiary">?idTextTertiary</item>
</style>
@markosopcic thanks for the detailed info! We'll investigate this and get back to you when we have an update.
@acouhier-luna @qmetzler-luna @markosopcic Hi again, could you try the following solutions and let us know which one(s) solve the issue:
styles.xml
file: <style name="AdyenCheckout" parent="Adyen" />
.android:textColor
attribute there (or directly in your app theme):
<style name="AdyenCheckout" parent="YOUR_APP_THEME">
<item name="android:textColor">@color/text_color_primary</item>
...
</style>
You might need to define other attributes, take a look at MyAppTheme in our example app for guidance.
Hey @jreij!
When setting the SDK up with the default theming, everything works, but as expected, it uses the default theme from the app.
when extending the AdyenCheckout
theme from my app theme, and setting the android:textColor
, property, it works as well, but the colors from the app theme don't get recognized, even though we have them set. This is what the drop in component looks like in that case (i barely even noticed the cancel button on the "awaiting completion screen"):
after i set most of the values to the same color (#001B40) that are set in the MyAppTheme
example, i.e.:
<style name="AdyenCheckout" parent="AppTheme" >
<item name="android:textColor">@color/id_blue_100</item>
<item name="colorPrimary">@color/id_blue_100</item>
<item name="colorOnPrimary">@color/id_blue_100</item>
<item name="colorSecondary">@color/id_blue_100</item>
<item name="colorOnSecondary">@color/id_blue_100</item>
<item name="colorAccent">@color/id_blue_100</item>
<item name="android:colorBackground">@color/id_blue_100</item>
<item name="colorOnBackground">@color/id_blue_100</item>
<item name="colorSurface">@color/id_blue_100</item>
<item name="colorOnSurface">@color/id_blue_100</item>
<item name="colorControlNormal">@color/id_blue_100</item>
<item name="colorControlHighlight">@color/id_blue_100</item>
<item name="android:textColorPrimary">@color/id_blue_100</item>
<item name="android:textColorSecondary">@color/id_blue_100</item>
<item name="android:textColorTertiary">@color/id_blue_100</item>
<item name="android:textColorLink">@color/id_blue_100</item>
</style>
It doesn't look like the color is applied anywhere, i.e.:
My solution was to override most of the components we intend to use:
<style name="AdyenCheckout" parent="AppTheme">
<item name="colorPrimary">?idBasePrimary</item>
<item name="colorAccent">?idBasePrimary</item>
<item name="android:textColor">?idTextPrimary</item>
<item name="android:textColorPrimary">?idTextPrimary</item>
<item name="android:textColorSecondary">?idTextSecondary</item>
<item name="android:textColorTertiary">?idTextTertiary</item>
</style>
<style name="AdyenCheckout.TextInputLayout" parent="OneDaTexInputLayout">
<item name="boxStrokeColor">?idBasePrimary</item>
<item name="hintTextColor">?idBasePrimary</item>
<item name="indicatorColor">?idTextPrimary</item>
<item name="boxCornerRadiusTopStart">@dimen/corner_radius_1.5x</item>
<item name="boxCornerRadiusTopEnd">@dimen/corner_radius_1.5x</item>
<item name="boxCornerRadiusBottomStart">@dimen/corner_radius_1.5x</item>
<item name="boxCornerRadiusBottomEnd">@dimen/corner_radius_1.5x</item>
<item name="errorIconTint">?idAlertPrimary</item>
</style>
<style name="AdyenCheckout.PaymentInProgressView.CancelButton" parent="Widget.MaterialComponents.Button.TextButton">
<item name="android:text">@string/paymentInProgressView_cancelButton</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginTop">@dimen/spacing_2x</item>
<item name="android:layout_marginBottom">@dimen/spacing_1x</item>
<item name="android:paddingVertical">@dimen/spacing_1x</item>
<item name="android:textColor">@color/text_color_oneda_button_secondary</item>
<item name="android:foreground">@drawable/bg_oneda_secondary_button</item>
<item name="cornerRadius">@dimen/corner_radius_max</item>
</style>
<style name="AdyenCheckout.Button.Colored" parent="Widget.OneDA.Button.Primary">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginTop">@dimen/spacing_2x</item>
<item name="android:layout_marginStart">@dimen/standard_margin</item>
<item name="android:layout_marginEnd">@dimen/standard_margin</item>
<item name="android:focusable">false</item>
<item name="android:focusableInTouchMode">false</item>
<item name="colorAccent">?idBasePrimary</item>
<item name="backgroundTint">?idBasePrimary</item>
</style>
<style name="AdyenCheckout.PaymentInProgressView.ProgressBar" parent="AdyenCheckout">
<item name="android:layout_width">@dimen/spacing_3x</item>
<item name="android:layout_height">@dimen/spacing_3x</item>
<item name="android:layout_marginTop">@dimen/spacing_6x</item>
<item name="android:indeterminateTint">?idBasePrimary</item>
</style>
Hi @markosopcic , thanks for the detailed info!
We just opened a PR that should remove the need to manually add android:textColor
to the styles, it will be included in the next release and you can remove this temp fix after upgrading.
As for the rest of the styling, I just tried your styling code with this color <color name="id_blue_100">#001B40</color>
and my whole drop-in is blue 😄
Could you maybe share a few more things:
AppTheme
? You can find that in your manifest file under application
-> android:theme
.AppTheme
extend from? Feel free to share the whole xml block where you define it.Hi, we just released 5.3.1 in which this issue should be fixed.
Describe the bug When I want to pay with a new credit card, I crash
To Reproduce Steps to reproduce the behavior:
Credit Card
Expected behavior I would like to use a new credit card
Credit card
Smartphone (please complete the following information):
Additional context
Logcat
``` FATAL EXCEPTION: main Process: XXX, PID: 2890 android.view.InflateException: Binary XML file line #166 in XXX:layout/card_view: Binary XML file line #166 in XXX:layout/card_view: Error inflating class androidx.appcompat.widget.AppCompatAutoCompleteTextView Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@e5b11a3, Dispatchers.Main.immediate] Caused by: android.view.InflateException: Binary XML file line #166 in XXX:layout/card_view: Error inflating class androidx.appcompat.widget.AppCompatAutoCompleteTextView Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:343) at android.view.LayoutInflater.createView(LayoutInflater.java:852) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1004) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:959) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1121) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1124) at android.view.LayoutInflater.inflate(LayoutInflater.java:654) at android.view.LayoutInflater.inflate(LayoutInflater.java:532) at android.view.LayoutInflater.inflate(LayoutInflater.java:479) at com.adyen.checkout.card.databinding.CardViewBinding.inflate(CardViewBinding.java:185) at com.adyen.checkout.card.internal.ui.view.CardView.