GridLayout desired size is based on the children desired size when alignment is not Stretch.

Identation is now spaces instead of tabs.
This commit is contained in:
hshristov
2015-10-09 10:47:02 +03:00
parent 91bb8ce4a5
commit c3f28ba42d
6 changed files with 19 additions and 16 deletions

View File

@@ -700,10 +700,12 @@ class MeasureHelper {
this.columnStarValue = columnStarCount > 0 ? (this.width - currentColumnWidth) / columnStarCount : 0;
for(int i = 0; i < columnCount; i++) {
ItemGroup item = this.columns.get(i);
if (item.getIsStar()) {
item.length = item.rowOrColumn.getValue() * this.columnStarValue;
if (this.stretchedHorizontally) {
for (int i = 0; i < columnCount; i++) {
ItemGroup item = this.columns.get(i);
if (item.getIsStar()) {
item.length = item.rowOrColumn.getValue() * this.columnStarValue;
}
}
}
}
@@ -725,12 +727,14 @@ class MeasureHelper {
this.rowStarValue = rowStarCount > 0 ? (this.height - currentRowHeight) / rowStarCount : 0;
for(int i = 0; i < rowCount; i++) {
ItemGroup item = this.rows.get(i);
if (item.getIsStar()) {
item.length = item.rowOrColumn.getValue() * this.rowStarValue;
}
}
if(this.stretchedVertically) {
for (int i = 0; i < rowCount; i++) {
ItemGroup item = this.rows.get(i);
if (item.getIsStar()) {
item.length = item.rowOrColumn.getValue() * this.rowStarValue;
}
}
}
}
private void fakeMeasure() {

View File

@@ -20,7 +20,6 @@ public abstract class LayoutBase extends ViewGroup {
super(context);
}
@Override
protected LayoutParams generateDefaultLayoutParams() {
return new CommonLayoutParams();