Skip to content

Commit 53aafad

Browse files
author
CodingForAndroid
committed
changepic
1 parent 456bfd8 commit 53aafad

File tree

6 files changed

+7
-4
lines changed

6 files changed

+7
-4
lines changed

app/src/main/java/com/jorge/flowlayoutdemo/MainActivity.java

+7-4
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ public void prepareData(){
6464
mDatas.add("开启免费WIFI");
6565
mDatas.add("Github");
6666
mDatas.add("回收站");
67-
mDatas.add("Ip.Man.3.2015.BD720P.X264.AAC.Cantonese&Mandarin.CHS.Mp4Ba.torrent");
6867
mDatas.add("支付宝钱包");
6968
mDatas.add("360安全卫士");
7069
mDatas.add("本地磁盘");
@@ -79,7 +78,7 @@ public void prepareData(){
7978
mDatas.add("View自定义");
8079
mDatas.add("...................");
8180
mDatas.add("八达岭长城");
82-
81+
mDatas.add("Ip.Man.3.2015.BD720P.X264.AAC.Cantonese&Mandarin.CHS.Mp4Ba.torrent");
8382
}
8483

8584
public View createLoadedView() {
@@ -88,8 +87,11 @@ public View createLoadedView() {
8887
mScrollView.setFillViewport(true);// 设置可以填充父窗体
8988
// 初始化布局,该布局可以自动分配子View位置,保持每一行都能对齐
9089
mLayout = new FlowLayout(this);
90+
//是否填充
91+
mLayout.setFillLine(true);
9192
mLayout.setBackgroundResource(R.drawable.grid_item_bg_normal);
92-
int layoutPadding = dip2px(0);
93+
// 子view 之间的间距
94+
int layoutPadding = dip2px(10);
9395
mLayout.setPadding(layoutPadding, layoutPadding, layoutPadding,
9496
layoutPadding);
9597
mLayout.setHorizontalSpacing(layoutPadding);
@@ -98,7 +100,8 @@ public View createLoadedView() {
98100
int textPaddingV = dip2px(4);
99101
int textPaddingH = dip2px(7);
100102
int backColor = 0xffcecece;
101-
int radius = dip2px(0);
103+
// 设置弧度
104+
int radius = dip2px(5);
102105
// 代码动态创建一个图片
103106
GradientDrawable pressDrawable = createDrawable(
104107
backColor, backColor, radius);

screenshot/QQ图片20160311121456.png

-42.5 KB
Binary file not shown.

screenshot/QQ图片20160311155011.png

-54.3 KB
Binary file not shown.

screenshot/QQ图片20160311160623.png

-51.4 KB
Binary file not shown.

screenshot/QQ图片20160311160948.png

-50.7 KB
Binary file not shown.

screenshot/QQ图片20160311161249.png

-55.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)