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:
@@ -11,9 +11,9 @@ import android.view.View;
|
||||
*
|
||||
*/
|
||||
public class DockLayout extends LayoutBase {
|
||||
|
||||
private boolean _stretchLastChild = true;
|
||||
|
||||
private boolean _stretchLastChild = true;
|
||||
|
||||
public DockLayout(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -20,7 +20,6 @@ public abstract class LayoutBase extends ViewGroup {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected LayoutParams generateDefaultLayoutParams() {
|
||||
return new CommonLayoutParams();
|
||||
|
||||
@@ -6,4 +6,4 @@ public class TabItemSpec {
|
||||
public String title;
|
||||
public int iconId;
|
||||
public Drawable iconDrawable;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
class TabStrip extends LinearLayout {
|
||||
|
||||
|
||||
private static final int DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS = 0;
|
||||
private static final byte DEFAULT_BOTTOM_BORDER_COLOR_ALPHA = 0x26;
|
||||
private static final int SELECTED_INDICATOR_THICKNESS_DIPS = 3;
|
||||
|
||||
@@ -21,7 +21,7 @@ public class WrapLayout extends LayoutBase {
|
||||
public WrapLayout(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
||||
public Orientation getOrientation() {
|
||||
return this._orientation;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user