Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for OutlinedBox #2958

Open
leandrofavarin opened this issue Oct 22, 2020 · 11 comments
Open

Support for OutlinedBox #2958

leandrofavarin opened this issue Oct 22, 2020 · 11 comments
Assignees
Labels
CardInputWidget Styling triaged Issue has been reviewed by Stripe and is being tracked internally

Comments

@leandrofavarin
Copy link

Summary

Can't use the Material OutlinedBox variant of the TextInputLayout

Code to reproduce

<com.google.android.material.textfield.TextInputLayout
    style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    >
  <com.stripe.android.view.CardInputWidget
    style="@style/Stripe.CardInputWidget.EditText"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:shouldShowPostalCode="false"
    />
</com.google.android.material.textfield.TextInputLayout>

Android version

Q

Impacted devices

n/A

Installation method

n/A

SDK version

16.0.1

Other information

Also tried using the Stripe.CardInputWidget.TextInputLayout, as well as without the TextInputLayout wrapping the CardInputWidget.

Currently it looks like this:

Screenshot 2020-10-22 at 11 34 58

@mshafrir-stripe
Copy link
Collaborator

@leandrofavarin thanks for filing. We'll add this to our backlog.

@mshafrir-stripe mshafrir-stripe self-assigned this Oct 22, 2020
@mshafrir-stripe mshafrir-stripe added the triaged Issue has been reviewed by Stripe and is being tracked internally label Oct 22, 2020
@leandrofavarin
Copy link
Author

Thanks Michael!

@sebj54
Copy link

sebj54 commented Feb 17, 2021

Hi @mshafrir-stripe, is there any update or any workaround while we're waiting for an "official" way of supporting this? Maybe by overriding a layout?

It doesn't seem to work with a FilledBox also.

I found an issue and a related PR which should have addressed this issue but it does not work either:

I also tested by adding this to my app's styles (code is reduced to the minimum):

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
    <style name="AppTheme" parent="AppThemeBase">
        <item name="textInputStyle">@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox</item>
    </style>
</resources>

It has no effect either.

Also, it would be very convenient to have a "how to theme widgets" guide in the docs (with at least one example).

Thanks for your help on this!

@sebj54
Copy link

sebj54 commented Sep 22, 2021

Hi Stripe, any update on this in 7 months?

@michelleb-stripe
Copy link
Contributor

@sebj54 Sorry for the delay just looking to see if I have an alternative

@sebj54
Copy link

sebj54 commented Sep 24, 2021

Hi @michelleb-stripe, thanks for catching up!

I don't know if it can be useful, but here's the better I can get with CardMultilineWidget's style: triniwiz/nativescript-plugins#83 (comment)

@michelleb-stripe
Copy link
Contributor

@sebj54 Based on that comment looks like you were able to do a lot of the style, but still were unable to make it an OutlineBox. Is that correct?

@sebj54
Copy link

sebj54 commented Sep 24, 2021

Exactly! If I use an OutlineBox in the XML layout file, it throws an error. If I remember well, it is because OutlineBox does not implement everything the Stripe view is using (I don't remember if it's the Layout or the EditText).

@michelleb-stripe
Copy link
Contributor

@sebj54 Thanks for that clarification. We have some work in our backlog to work on our overall widget styling strategy.

@sebj54
Copy link

sebj54 commented Sep 24, 2021

Great! Can't wait to try it 😃

@mtychyna
Copy link

It would be great to migrate all the Stripe styles to Material Components. It will give possibility to override any style on any screen. Meanwhile with Stripe I everyday face with AppCompat vs MaterialComponents theme conflicts.
photo_2021-11-18_11-54-06

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CardInputWidget Styling triaged Issue has been reviewed by Stripe and is being tracked internally
Projects
None yet
Development

No branches or pull requests

5 participants