FabianTerhorst / FastLayout

Generates a Java Object for your xml layout to reduce inflate time to zero
Apache License 2.0
443 stars 35 forks source link

Padding problems #25

Open ivanfeli opened 8 years ago

ivanfeli commented 8 years ago

With an xml like this:

android:paddingBottom="8dp"
android:paddingEnd="12dp"
android:paddingStart="12dp"
android:paddingTop="8dp"

results in the code:

leaderboard_item_player_rating.setPadding(0,LayoutUtils.convertDpToPixel(8f, getContext()),0,LayoutUtils.convertDpToPixel(8f, getContext()));
leaderboard_item_player_rating.setPaddingRelative(LayoutUtils.convertDpToPixel(12f, getContext()),LayoutUtils.convertDpToPixel(8f, getContext()),0,0);

paddingEnd seems to be missing, and the paddingBottom too (in the relative call).

If you look at the TextView class, both methods call the super.setPadding*(..); which then sets the same fields, so I think only the relative one should be called (but it will not support below API 19)