91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 628KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-05-19
  • 語言: 其他
  • 標(biāo)簽: weixin??tag??

資源簡介

微信 自定義標(biāo)簽代碼,采用了flowlayout布局

資源截圖

代碼片段和文件信息

package?com.zhd.tag;

import?java.util.ArrayList;
import?java.util.List;

import?android.content.Context;
import?android.util.AttributeSet;
import?android.view.View;
import?android.view.ViewGroup;

public?class?FlowLayout?extends?ViewGroup
{

private?static?final?String?TAG?=?“FlowLayout“;


public?FlowLayout(Context?context?AttributeSet?attrs)
{
super(context?attrs);
}

@Override
protected?ViewGroup.LayoutParams?generateLayoutParams(
ViewGroup.LayoutParams?p)
{
return?new?MarginLayoutParams(p);
}

@Override
public?ViewGroup.LayoutParams?generateLayoutParams(AttributeSet?attrs)
{
return?new?MarginLayoutParams(getContext()?attrs);
}

@Override
protected?ViewGroup.LayoutParams?generateDefaultLayoutParams()
{
return?new?MarginLayoutParams(LayoutParams.MATCH_PARENT
LayoutParams.MATCH_PARENT);
}

/**
?*?負(fù)責(zé)設(shè)置子控件的測量模式和大小?根據(jù)所有子控件設(shè)置自己的寬和高
?*/
@Override
protected?void?onMeasure(int?widthMeasureSpec?int?heightMeasureSpec)
{
super.onMeasure(widthMeasureSpec?heightMeasureSpec);
//?獲得它的父容器為它設(shè)置的測量模式和大小
int?sizeWidth?=?MeasureSpec.getSize(widthMeasureSpec);
int?sizeHeight?=?MeasureSpec.getSize(heightMeasureSpec);
int?modeWidth?=?MeasureSpec.getMode(widthMeasureSpec);
int?modeHeight?=?MeasureSpec.getMode(heightMeasureSpec);

// Log.e(TAG?sizeWidth?+?““?+?sizeHeight);

//?如果是warp_content情況下,記錄寬和高
int?width?=?0;
int?height?=?0;
/**
?*?記錄每一行的寬度,width不斷取最大寬度
?*/
int?lineWidth?=?0;
/**
?*?每一行的高度,累加至height
?*/
int?lineHeight?=?0;

int?cCount?=?getChildCount();

//?遍歷每個(gè)子元素
for?(int?i?=?0;?i? {
View?child?=?getChildAt(i);
//?測量每一個(gè)child的寬和高
measureChild(child?widthMeasureSpec?heightMeasureSpec);
//?得到child的lp
MarginLayoutParams?lp?=?(MarginLayoutParams)?child
.getLayoutParams();
//?當(dāng)前子空間實(shí)際占據(jù)的寬度
int?childWidth?=?child.getMeasuredWidth()?+?lp.leftMargin
+?lp.rightMargin;
//?當(dāng)前子空間實(shí)際占據(jù)的高度
int?childHeight?=?child.getMeasuredHeight()?+?lp.topMargin
+?lp.bottomMargin;
/**
?*?如果加入當(dāng)前child,則超出最大寬度,則的到目前最大寬度給width,類加height?然后開啟新行
?*/
if?(lineWidth?+?childWidth?>?sizeWidth)
{
width?=?Math.max(lineWidth?childWidth);//?取最大的
lineWidth?=?childWidth;?//?重新開啟新行,開始記錄
//?疊加當(dāng)前高度,
height?+=?lineHeight;
//?開啟記錄下一行的高度
lineHeight?=?childHeight;
}?else
//?否則累加值lineWidthlineHeight取最大高度
{
lineWidth?+=?childWidth;
lineHeight?=?Math.max(lineHeight?childHeight);
}
//?如果是最后一個(gè),則將當(dāng)前記錄的最大寬度和當(dāng)前l(fā)ineWidth做比較
if?(i?==?cCount?-?1)
{
width?=?Math.max(width?lineWidth);
height?+=?lineHeight;
}

}
setMeasuredDimension((modeWidth?==?MeasureSpec.EXACTLY)???sizeWidth
:?width?(modeHeight?==?MeasureSpec.EXACTLY)???sizeHeight
:?height);

}
/**
?*?存儲(chǔ)所有的View,按行記錄
?*/
private?List>?mAllViews?=?new?ArrayList>();
/**
?*?記錄每一行的最大高度
?*/
pri

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----

?????文件????????475??2015-01-13?10:10??weixin_tags\.classpath

?????文件????????852??2014-07-30?09:53??weixin_tags\.project

?????文件?????????57??2015-01-13?10:10??weixin_tags\.settings\org.eclipse.core.resources.prefs

?????文件????????177??2015-01-14?18:41??weixin_tags\.settings\org.eclipse.jdt.core.prefs

?????文件????????865??2015-01-24?22:42??weixin_tags\AndroidManifest.xml

?????文件??????51394??2014-07-26?10:06??weixin_tags\ic_launcher-web.png

?????文件?????621451??2014-07-26?10:06??weixin_tags\libs\android-support-v4.jar

?????文件????????781??2014-07-26?10:06??weixin_tags\proguard-project.txt

?????文件????????563??2015-01-13?20:37??weixin_tags\project.properties

?????文件????????311??2015-01-13?22:24??weixin_tags\res\drawable\addtag_text_bg.xml

?????文件????????315??2015-01-13?22:24??weixin_tags\res\drawable\addtag_text_color.xml

?????文件????????373??2015-01-13?22:26??weixin_tags\res\drawable\bg_addtag_activated.xml

?????文件????????453??2015-01-13?22:25??weixin_tags\res\drawable\bg_addtag_normal.xml

?????文件????????453??2015-01-13?22:23??weixin_tags\res\drawable\bg_tag_activated.xml

?????文件????????429??2015-01-13?22:23??weixin_tags\res\drawable\bg_tag_normal.xml

?????文件????????345??2014-07-26?13:36??weixin_tags\res\drawable\flag_01.xml

?????文件????????411??2014-08-02?17:57??weixin_tags\res\drawable\flag_02.xml

?????文件????????352??2014-08-02?17:57??weixin_tags\res\drawable\flag_03.xml

?????文件????????352??2015-01-13?10:51??weixin_tags\res\drawable\flag_03_checked.xml

?????文件????????364??2015-01-13?10:33??weixin_tags\res\drawable\flag_04.xml

?????文件????????519??2015-01-13?22:28??weixin_tags\res\drawable\flag_edit.xml

?????文件????????305??2015-01-13?22:22??weixin_tags\res\drawable\tag_text_bg.xml

?????文件????????309??2015-01-13?22:24??weixin_tags\res\drawable\tag_text_color.xml

?????文件???????7658??2014-07-26?10:06??weixin_tags\res\drawable-hdpi\ic_launcher.png

?????文件???????3777??2014-07-26?10:06??weixin_tags\res\drawable-mdpi\ic_launcher.png

?????文件??????12516??2014-07-26?10:06??weixin_tags\res\drawable-xhdpi\ic_launcher.png

?????文件??????24777??2014-07-26?10:06??weixin_tags\res\drawable-xxhdpi\ic_launcher.png

?????文件???????5425??2015-01-24?22:43??weixin_tags\res\layout\activity_main.xml

?????文件????????390??2015-01-13?22:29??weixin_tags\res\layout\addtag_text.xml

?????文件????????384??2015-01-13?22:21??weixin_tags\res\layout\tag_text.xml

............此處省略38個(gè)文件信息

評(píng)論

共有 條評(píng)論