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-15905: Android: Views using Ti.UI.FILL don't layout correctly when containing Window has implicit height/width #5069

Merged
merged 1 commit into from
Dec 6, 2013
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 @@ -278,8 +278,10 @@ public void windowCreated(TiBaseActivity activity) {
Object height = getProperty(TiC.PROPERTY_HEIGHT);
View decorView = win.getDecorView();
if (decorView != null) {
int w = width == null ? LayoutParams.MATCH_PARENT : TiConvert.toTiDimension(width, TiDimension.TYPE_WIDTH).getAsPixels(decorView);
int h = height == null ? LayoutParams.MATCH_PARENT : TiConvert.toTiDimension(height, TiDimension.TYPE_HEIGHT).getAsPixels(decorView);
int w = (width == null || width.equals(TiC.LAYOUT_FILL)) ? LayoutParams.MATCH_PARENT : TiConvert
.toTiDimension(width, TiDimension.TYPE_WIDTH).getAsPixels(decorView);
int h = (height == null || height.equals(TiC.LAYOUT_FILL)) ? LayoutParams.MATCH_PARENT : TiConvert
.toTiDimension(height, TiDimension.TYPE_HEIGHT).getAsPixels(decorView);
win.setLayout(w, h);
}
}
Expand Down Expand Up @@ -435,8 +437,10 @@ private void setWindowWidthHeight(Object width, Object height)
if (win != null) {
View decorView = win.getDecorView();
if (decorView != null) {
int w = width == null ? LayoutParams.MATCH_PARENT : TiConvert.toTiDimension(width, TiDimension.TYPE_WIDTH).getAsPixels(decorView);
int h = height == null ? LayoutParams.MATCH_PARENT : TiConvert.toTiDimension(height, TiDimension.TYPE_HEIGHT).getAsPixels(decorView);
int w = (width == null || width.equals(TiC.LAYOUT_FILL)) ? LayoutParams.MATCH_PARENT : TiConvert
.toTiDimension(width, TiDimension.TYPE_WIDTH).getAsPixels(decorView);
int h = (height == null || height.equals(TiC.LAYOUT_FILL)) ? LayoutParams.MATCH_PARENT : TiConvert
.toTiDimension(height, TiDimension.TYPE_HEIGHT).getAsPixels(decorView);
win.setLayout(w, h);
}
}
Expand Down