0

UPDATE: Solution: http://www.reddit.com/r/androiddev/comments/2p3khg/conflicting_lint_messages_regarding_paddingstart/

I have designed a layout in which I have used the following multiple times in different ImageView(s). and I never get an error.

android:paddingStart="5dp"

and

android:paddingEnd="5dp"

However when I used this on a TextView:

 <TextView
    android:id="@+id/blah1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:paddingLeft="5dp"
    android:paddingStart="5dp"
    android:textSize="12sp"
    android:textStyle="italic" />

I get a lint warning on android:paddingStart="5dp". Warning:

Attribute paddingStart referenced here can result in a crash on some specific devices older than API 17 (current min is 16)

The weird part is that I am using android:paddingEnd on the following textview and I don't get any warning.

<TextView
    android:id="@+id/blah2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_alignParentEnd="true"
    android:layout_alignParentRight="true"
    android:paddingEnd="5dp"
    android:paddingRight="5dp"
    android:textSize="12sp"
    android:textStyle="italic" />
poortechworker
  • 627
  • 1
  • 6
  • 21
  • 1
    see https://code.google.com/p/android/issues/detail?id=60055 and http://stackoverflow.com/questions/27449776/conflicting-lint-messages-regarding-paddingstart-usage – M4rtini Jun 20 '15 at 21:51
  • @m4rtini Got it! Samsung bug :( So, I must remove this and only keep paddingLeft and pray to god that nobody uses my app in RTL. Any solutions recommended? – poortechworker Jun 20 '15 at 21:56
  • @DennisAnderson perhaps you are wrong. I have added paddingLeft for backwards compatibility. And also if that was the case I have used paddingStart in lot of ImageView, none of them indicated an error. Ir is a samsung bug as mentioned above and occurs only in TextView. – poortechworker Jun 20 '15 at 22:00
  • 1
    http://www.reddit.com/r/androiddev/comments/2p3khg/conflicting_lint_messages_regarding_paddingstart/ this claims to have a solution. I think android ignores unknown tags, which is why only certain devices crash. It seems like samsung had their "own" paddingStart tag causing it not to be ignored. – M4rtini Jun 20 '15 at 22:04
  • @M4rtini Seems like a lot of effort for a small bug. But I guess that is what keeps us developers ticking. Thanks a lot. If you want you can answer this. I will accept the answer and relate this question to the other stackoverflow post (as they are slightly different). – poortechworker Jun 20 '15 at 22:13
  • A lot of effort yeah. Probably not worth it unless you have a big userbase. I doubt the userbase of those specific samsung tablets is that big ^^ I could write an answer, but it would only be links to other resources and that is discouraged here. And i don't feel like i have actually solved the problem anyway :P the reddit solution seems kinda hacky. – M4rtini Jun 20 '15 at 22:19
  • 1
    Understood, I'll update my question then to include links to those who seek the solution. – poortechworker Jun 20 '15 at 22:22

1 Answers1

0

Just wanted to mark this question as closed. The solution is posted in the question as well. Just to reiterate:

http://www.reddit.com/r/androiddev/comments/2p3khg/conflicting_lint_messages_regarding_paddingstart/

It is a kind of hack and maybe not worth it unless you have a sufficient user base.

poortechworker
  • 627
  • 1
  • 6
  • 21