Spacepublic final class Space extends android.view.View Space is a lightweight View subclass that may be used to create gaps between components
in general purpose layouts. |
Constructors Summary |
---|
public Space(android.content.Context context, android.util.AttributeSet attrs, int defStyleAttr, int defStyleRes){@inheritDoc}
super(context, attrs, defStyleAttr, defStyleRes);
if (getVisibility() == VISIBLE) {
setVisibility(INVISIBLE);
}
| public Space(android.content.Context context, android.util.AttributeSet attrs, int defStyleAttr){@inheritDoc}
this(context, attrs, defStyleAttr, 0);
| public Space(android.content.Context context, android.util.AttributeSet attrs){@inheritDoc}
this(context, attrs, 0);
| public Space(android.content.Context context){@inheritDoc}
//noinspection NullableProblems
this(context, null);
|
Methods Summary |
---|
public void | draw(android.graphics.Canvas canvas)Draw nothing.
| private static int | getDefaultSize2(int size, int measureSpec)Compare to: {@link View#getDefaultSize(int, int)}
If mode is AT_MOST, return the child size instead of the parent size
(unless it is too big).
int result = size;
int specMode = MeasureSpec.getMode(measureSpec);
int specSize = MeasureSpec.getSize(measureSpec);
switch (specMode) {
case MeasureSpec.UNSPECIFIED:
result = size;
break;
case MeasureSpec.AT_MOST:
result = Math.min(size, specSize);
break;
case MeasureSpec.EXACTLY:
result = specSize;
break;
}
return result;
| protected void | onMeasure(int widthMeasureSpec, int heightMeasureSpec)
setMeasuredDimension(
getDefaultSize2(getSuggestedMinimumWidth(), widthMeasureSpec),
getDefaultSize2(getSuggestedMinimumHeight(), heightMeasureSpec));
|
|