资源简介
tagview代码文件
代码片段和文件信息
package view.tagview;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import com.dykj.xiangui.R;
public class FlowLayout extends ViewGroup {
public static final int HORIZONTAL = 0;
public static final int VERTICAL = 1;
private int horizontalSpacing = 0;
private int verticalSpacing = 0;
private int orientation = 0;
private boolean debugDraw = false;
public FlowLayout(Context context) {
super(context);
this.readstyleParameters(context null);
}
public FlowLayout(Context context AttributeSet attributeSet) {
super(context attributeSet);
this.readstyleParameters(context attributeSet);
}
public FlowLayout(Context context AttributeSet attributeSet int defstyle) {
super(context attributeSet defstyle);
this.readstyleParameters(context attributeSet);
}
@Override
protected void onMeasure(int widthMeasureSpec int heightMeasureSpec) {
int sizeWidth = MeasureSpec.getSize(widthMeasureSpec)
- this.getPaddingRight() - this.getPaddingLeft();
int sizeHeight = MeasureSpec.getSize(heightMeasureSpec)
- this.getPaddingTop() - this.getPaddingBottom();
int modeWidth = MeasureSpec.getMode(widthMeasureSpec);
int modeHeight = MeasureSpec.getMode(heightMeasureSpec);
int size;
int mode;
if (orientation == HORIZONTAL) {
size = sizeWidth;
mode = modeWidth;
} else {
size = sizeHeight;
mode = modeHeight;
}
int lineThicknessWithSpacing = 0;
int lineThickness = 0;
int lineLengthWithSpacing = 0;
int lineLength;
int prevLinePosition = 0;
int controlMaxLength = 0;
int controlMaxThickness = 0;
final int count = getChildCount();
for (int i = 0; i < count; i++) {
final View child = getChildAt(i);
if (child.getVisibility() == GONE) {
continue;
}
LayoutParams lp = (LayoutParams) child.getLayoutParams();
child.measure(
getChildMeasureSpec(widthMeasureSpec this.getPaddingLeft()
+ this.getPaddingRight() lp.width)
getChildMeasureSpec(heightMeasureSpec this.getPaddingTop()
+ this.getPaddingBottom() lp.height));
int hSpacing = this.getHorizontalSpacing(lp);
int vSpacing = this.getVerticalSpacing(lp);
int childWidth = child.getMeasuredWidth();
int childHeight = child.getMeasuredHeight();
int childLength;
int childThickness;
int spacingLength;
int spacingThickness;
if (orientation == HORIZONTAL) {
childLength = childWidth;
childThickness = childHeight;
spacingLength = hSpacing;
spacingThickness = vSpacing;
} else {
childLength = childHeight;
childThickness = childWidth;
spacingLength = vSpacing;
spacingThickness = hSpacing;
}
lineLength = lineLengthWithSpacing + childLength;
lineLeng
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-03-28 14:28 tagview代码文件\
文件 706 2017-03-28 14:28 tagview代码文件\attrs.xm
文件 530 2017-03-28 14:22 tagview代码文件\tag.xm
文件 184 2017-03-28 14:16 tagview代码文件\tag_bg.xm
文件 269 2017-03-23 22:44 tagview代码文件\tag_checked_normal.xm
文件 271 2017-03-28 11:08 tagview代码文件\tag_checked_pressed.xm
目录 0 2017-03-28 14:26 tagview代码文件\tagview\
文件 11069 2017-03-28 10:48 tagview代码文件\tagview\FlowLayout.java
文件 1417 2017-03-22 23:00 tagview代码文件\tagview\Tag.java
文件 5385 2017-03-28 14:11 tagview代码文件\tagview\TagListView.java
文件 1306 2017-03-28 11:06 tagview代码文件\tagview\TagView.java
- 上一篇:Jsonob
ject.dll - 下一篇:31条指令CPU
评论
共有 条评论