oursgris
oursgris

Reputation: 2882

Consequences of using paddingLeft on android 4.2+ with RTL language

I published an application on google play and I'm facing a bug which occurs only on Samsung Galaxy Tab 2 10.1 with android 4.1. (you can imagine that I don't have that device)

I have that bug report

java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: android.view.InflateException: Binary XML file line #8: Error inflating class <unknown>
...
Caused by: java.lang.NumberFormatException: Invalid int: "5.0dip"
at java.lang.Integer.invalidInt(Integer.java:138)

You can imagine it's hard to debug when we don't have the device but I think I found the same problem.

Most of the time, I use paddingStart & paddingEnd like this :

android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingStart="5dp"
android:paddingEnd="5dp"

Every time paddingleft = paddingstart (and paddingRight = paddingEnd), and most of the time the 4 attributes have the same value.

Does someone know the behaviour if I

Will it take the paddingLeft and paddingRight attribute ? I found a very interesting post but it doesn't handle that case. In particular, will the LTR language will be affected ?

And how can I test my application without that device ? I didn't found a special emulator for Samsung Galaxy tab 2 10.1 Android 4.1. The only method to test it from now is publising new release and hoping the problem will be resolved, that's a nonsense.

Upvotes: 4

Views: 371

Answers (1)

chksr
chksr

Reputation: 331

Bug in Samsung Android 4.1.2:

For a workaround, see https://gist.github.com/imminent/858a47904786aa2f4360

Upvotes: 1

Related Questions