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

[6_2_X][TIMOB-25158] Android: Fix TableView.rightImage size #9313

Merged
merged 2 commits into from
Aug 15, 2017
Merged
Changes from 1 commit
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 @@ -45,7 +45,6 @@ public class TiTableViewRowProxyItem extends TiBaseTableViewItem

private static final String LEFT_MARGIN = "6dp";
private static final String RIGHT_MARGIN = "6dp";
private static final String RIGHT_SIZE = "17dp";
private static final int MIN_HEIGHT = 48;

private BitmapDrawable hasChildDrawable, hasCheckDrawable;
Expand Down Expand Up @@ -551,9 +550,10 @@ protected void onLayout(boolean changed, int left, int top, int right, int botto
}

if (rightImage != null && rightImage.getVisibility() != GONE) {
int w = new TiDimension(RIGHT_SIZE, TiDimension.TYPE_RIGHT).getAsPixels(this);
int h = new TiDimension(RIGHT_SIZE, TiDimension.TYPE_RIGHT).getAsPixels(this);
int w = rightImage.getMeasuredWidth();
int h = rightImage.getMeasuredHeight();
int rightMargin = new TiDimension(RIGHT_MARGIN, TiDimension.TYPE_RIGHT).getAsPixels(this);

contentRight -= w + rightMargin;
int offset = (height - h) / 2;
rightImage.layout(right-w-rightMargin, top+offset, right-rightMargin, top+offset+h);
Expand Down