braintree / android-card-form

A ready-made card form layout that can be included in your Android app, making it easy to accept credit and debit cards.
MIT License
366 stars 130 forks source link

Text fields do not support RTL properly #120

Open PavloBohdanSonerim opened 1 year ago

PavloBohdanSonerim commented 1 year ago

General information

When layout is set to RTL, the text field behaviour becomes incorrect.

One of the visible issues is that for fields like Credit Card, the TextInputLayout gives opposite gravitations to its hint and text.

sshropshire commented 1 year ago

Hi @PavloBohdanSonerim thanks for using our library. Is there a video you can provide reproducing the issue? A video will help us get more visibility on the issue internally for prioritization.

PavloBohdanSonerim commented 3 months ago

@sshropshire . The issue is in the gravitation of the text for the apps in RTL mode.

This is the behavior in your latest release:

telegram-cloud-photo-size-2-5240203617355559740-x

Our project needs the Credit Card fields to look like this in RTL:

telegram-cloud-photo-size-2-5240203617355559675-x

I fixed it by removing this code in your sources:

private void setupRTL() {
        if (VERSION.SDK_INT >= 17 && this.getResources().getConfiguration().getLayoutDirection() == 1) {
            this.setTextDirection(3);
            this.setGravity(8388613);
        }
PavloBohdanSonerim commented 3 months ago

@sshropshire