Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-20357] Android: 9-patch padding box area ignored for Button backgroundImage #7696

Merged
merged 1 commit into from
Feb 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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