Skip to content

Commit

Permalink
Merge pull request #7696 from falkolab/TIMOB-20357
Browse files Browse the repository at this point in the history
[TIMOB-20357] Android: 9-patch padding box area ignored for Button backgroundImage
  • Loading branch information
ashcoding committed Feb 24, 2016
2 parents 80ed18c + fc26565 commit 65cc61e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class TiUIButton extends TiUIView
{
private static final String TAG = "TiUIButton";
private static final float DEFAULT_SHADOW_RADIUS = 0.5f;

private int defaultColor;
private float shadowRadius = DEFAULT_SHADOW_RADIUS;
private float shadowX = 0f;
Expand Down Expand Up @@ -74,8 +74,8 @@ public void processProperties(KrollDict d)
Drawable image = drawableRef.getDensityScaledDrawable();
btn.setCompoundDrawablesWithIntrinsicBounds(image, null, null, null);
}
} else if (d.containsKey(TiC.PROPERTY_BACKGROUND_COLOR) || d.containsKey(TiC.PROPERTY_BACKGROUND_IMAGE)) {
// Reset the padding here if the background color/image is set. By default the padding will be calculated
} else if (d.containsKey(TiC.PROPERTY_BACKGROUND_COLOR)) {
// Reset the padding here if the background color is set. By default the padding will be calculated
// for the button, but if we set a background color, it will not look centered unless we reset the padding.
btn.setPadding(8, 0, 8, 0);
}
Expand Down

0 comments on commit 65cc61e

Please sign in to comment.