mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
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:
@@ -700,13 +700,15 @@ class MeasureHelper {
|
|||||||
|
|
||||||
this.columnStarValue = columnStarCount > 0 ? (this.width - currentColumnWidth) / columnStarCount : 0;
|
this.columnStarValue = columnStarCount > 0 ? (this.width - currentColumnWidth) / columnStarCount : 0;
|
||||||
|
|
||||||
for(int i = 0; i < columnCount; i++) {
|
if (this.stretchedHorizontally) {
|
||||||
|
for (int i = 0; i < columnCount; i++) {
|
||||||
ItemGroup item = this.columns.get(i);
|
ItemGroup item = this.columns.get(i);
|
||||||
if (item.getIsStar()) {
|
if (item.getIsStar()) {
|
||||||
item.length = item.rowOrColumn.getValue() * this.columnStarValue;
|
item.length = item.rowOrColumn.getValue() * this.columnStarValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void fixRows() {
|
private void fixRows() {
|
||||||
float currentRowHeight = 0;
|
float currentRowHeight = 0;
|
||||||
@@ -725,13 +727,15 @@ class MeasureHelper {
|
|||||||
|
|
||||||
this.rowStarValue = rowStarCount > 0 ? (this.height - currentRowHeight) / rowStarCount : 0;
|
this.rowStarValue = rowStarCount > 0 ? (this.height - currentRowHeight) / rowStarCount : 0;
|
||||||
|
|
||||||
for(int i = 0; i < rowCount; i++) {
|
if(this.stretchedVertically) {
|
||||||
|
for (int i = 0; i < rowCount; i++) {
|
||||||
ItemGroup item = this.rows.get(i);
|
ItemGroup item = this.rows.get(i);
|
||||||
if (item.getIsStar()) {
|
if (item.getIsStar()) {
|
||||||
item.length = item.rowOrColumn.getValue() * this.rowStarValue;
|
item.length = item.rowOrColumn.getValue() * this.rowStarValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void fakeMeasure() {
|
private void fakeMeasure() {
|
||||||
// Fake measure - measure all elements that have star rows and auto columns - with infinity Width and infinity Height
|
// Fake measure - measure all elements that have star rows and auto columns - with infinity Width and infinity Height
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ public abstract class LayoutBase extends ViewGroup {
|
|||||||
super(context);
|
super(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected LayoutParams generateDefaultLayoutParams() {
|
protected LayoutParams generateDefaultLayoutParams() {
|
||||||
return new CommonLayoutParams();
|
return new CommonLayoutParams();
|
||||||
|
|||||||
Reference in New Issue
Block a user