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

@@ -11,9 +11,9 @@ import android.view.View;
* *
*/ */
public class DockLayout extends LayoutBase { public class DockLayout extends LayoutBase {
private boolean _stretchLastChild = true;
private boolean _stretchLastChild = true;
public DockLayout(Context context) { public DockLayout(Context context) {
super(context); super(context);
} }

View File

@@ -700,10 +700,12 @@ 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) {
ItemGroup item = this.columns.get(i); for (int i = 0; i < columnCount; i++) {
if (item.getIsStar()) { ItemGroup item = this.columns.get(i);
item.length = item.rowOrColumn.getValue() * this.columnStarValue; 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; this.rowStarValue = rowStarCount > 0 ? (this.height - currentRowHeight) / rowStarCount : 0;
for(int i = 0; i < rowCount; i++) { if(this.stretchedVertically) {
ItemGroup item = this.rows.get(i); for (int i = 0; i < rowCount; i++) {
if (item.getIsStar()) { ItemGroup item = this.rows.get(i);
item.length = item.rowOrColumn.getValue() * this.rowStarValue; if (item.getIsStar()) {
} item.length = item.rowOrColumn.getValue() * this.rowStarValue;
} }
}
}
} }
private void fakeMeasure() { private void fakeMeasure() {

View File

@@ -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();

View File

@@ -6,4 +6,4 @@ public class TabItemSpec {
public String title; public String title;
public int iconId; public int iconId;
public Drawable iconDrawable; public Drawable iconDrawable;
} }

View File

@@ -27,7 +27,7 @@ import android.view.View;
import android.widget.LinearLayout; import android.widget.LinearLayout;
class TabStrip extends LinearLayout { class TabStrip extends LinearLayout {
private static final int DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS = 0; private static final int DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS = 0;
private static final byte DEFAULT_BOTTOM_BORDER_COLOR_ALPHA = 0x26; private static final byte DEFAULT_BOTTOM_BORDER_COLOR_ALPHA = 0x26;
private static final int SELECTED_INDICATOR_THICKNESS_DIPS = 3; private static final int SELECTED_INDICATOR_THICKNESS_DIPS = 3;

View File

@@ -21,7 +21,7 @@ public class WrapLayout extends LayoutBase {
public WrapLayout(Context context) { public WrapLayout(Context context) {
super(context); super(context);
} }
public Orientation getOrientation() { public Orientation getOrientation() {
return this._orientation; return this._orientation;
} }