require
"import"
import
"android.app.*"
import
"android.os.*"
import
"android.widget.*"
import
"android.view.*"
mygpub=
{
LinearLayout;
layout_width=
'match_parent'
;
layout_height=
'match_parent'
;
background=
'#388E3C'
;
{
ScrollView,
layout_width=
"match_parent"
;
layout_height=
"match_parent"
;
VerticalScrollBarEnabled=false;
{
LinearLayout;
Orientation=
'horizontal'
;
layout_width=
'match_parent'
;
layout_height=
'match_parent'
;
background=
'#5D4037'
;
{
LinearLayout;
orientation=
"vertical"
;
layout_width=
"49%w"
;
layout_height=
"match_parent"
;
layout_marginLeft=
"1%w"
;
{
CardView;
layout_margin=
'10dp'
;
layout_gravity=
'center'
;
Elevation=
'6dp'
;
layout_width=
'45%w'
;
layout_height=
'45%h'
;
radius=
'8dp'
;
CardBackgroundColor=
'#616161'
;
{
LinearLayout;
id=
"l1"
;
Orientation=
'horizontal'
;
layout_gravity=
'right'
;
layout_width=
'match_parent'
;
layout_height=
'match_parent'
;
{
LinearLayout;
layout_width=
'9%h'
;
layout_height=
'11%h'
;
{
CircleImageView;
layout_marginLeft=
'3%w'
;
src=
'https://p4.a.yximgs.com/ufile/atlas/NTIwNTU5ODI5NzY5MDQxMjAxMF8xNjU3ODkwNTk5OTIz_4.jpg'
;
layout_width=
'12%w'
;
layout_height=
'12%w'
;
layout_gravity=
'left|center'
;
};
};
{
LinearLayout;
Orientation=
'vertical'
;
layout_gravity=
'right'
;
layout_width=
'match_parent'
;
layout_height=
'match_parent'
;
{
LinearLayout;
layout_width=
'match_parent'
;
layout_height=
'5%h'
;
{
TextView;
layout_marginTop=
'2%h'
;
layout_width=
'match_parent'
;
layout_height=
'match_parent'
;
Gravity=
'left|center'
;
textColor=
'#FF000000'
;
text=
'KS分享服务'
;
textSize=
'16sp'
;
};
};
{
LinearLayout;
layout_width=
'match_parent'
;
layout_height=
'6.1%h'
;
{
TextView;
layout_width=
'match_parent'
;
layout_height=
'match_parent'
;
Gravity=
'left'
;
textColor=
'#69000000'
;
text=
'快手分享服务,支持图片/视频/音频等外链,永久有效'
;
textSize=
'12sp'
;
};
};
};
};
{
CardView;
layout_margin=
'0dp'
;
layout_gravity=
'bottom'
;
Elevation=
'0dp'
;
layout_width=
'match_parent'
;
layout_height=
'2%h'
;
radius=
'0dp'
;
CardBackgroundColor=
'#9E9E9E'
;
};
};
{
CardView;
layout_margin=
'10dp'
;
layout_gravity=
'center'
;
Elevation=
'6dp'
;
layout_width=
'45%w'
;
layout_height=
'45%h'
;
radius=
'8dp'
;
CardBackgroundColor=
'#FF6E40'
;
{
LinearLayout;
id=
"l2"
;
Orientation=
'horizontal'
;
layout_gravity=
'right'
;
layout_width=
'match_parent'
;
layout_height=
'match_parent'
;
{
LinearLayout;
layout_width=
'9%h'
;
layout_height=
'11%h'
;
{
CircleImageView;
layout_marginLeft=
'3%w'
;
src=
'https://p4.a.yximgs.com/ufile/atlas/NTIwNTU5ODI5NzY5MDQxMjAxMF8xNjU3ODkwNTk5OTIz_5.jpg'
;
layout_width=
'12%w'
;
layout_height=
'12%w'
;
layout_gravity=
'left|center'
;
};
};
{
LinearLayout;
Orientation=
'vertical'
;
layout_gravity=
'right'
;
layout_width=
'match_parent'
;
layout_height=
'match_parent'
;
{
LinearLayout;
layout_width=
'match_parent'
;
layout_height=
'5%h'
;
{
TextView;
layout_marginTop=
'2%h'
;
layout_width=
'match_parent'
;
layout_height=
'match_parent'
;
Gravity=
'left|center'
;
textColor=
'#FF000000'
;
text=
'分享该应用'
;
textSize=
'16sp'
;
};
};
{
LinearLayout;
layout_width=
'match_parent'
;
layout_height=
'6.1%h'
;
{
TextView;
layout_width=
'match_parent'
;
layout_height=
'match_parent'
;
Gravity=
'left'
;
textColor=
'#69000000'
;
text=
'把好东西分享给大家,快乐加倍'
;
textSize=
'12sp'
;
};
};
};
};
{
CardView;
layout_margin=
'0dp'
;
layout_gravity=
'bottom'
;
Elevation=
'0dp'
;
layout_width=
'match_parent'
;
layout_height=
'2%h'
;
radius=
'0dp'
;
CardBackgroundColor=
'#FFFF2F00'
;
};
};
};
{
LinearLayout;
orientation=
"vertical"
;
layout_width=
"49%w"
;
layout_height=
"match_parent"
;
layout_marginRight=
"1%w"
;
{
CardView;
layout_margin=
'10dp'
;
layout_gravity=
'center'
;
Elevation=
'6dp'
;
layout_width=
'45%w'
;
layout_height=
'45%h'
;
radius=
'8dp'
;
CardBackgroundColor=
'#303F9F'
;
{
LinearLayout;
id=
"r1"
;
Orientation=
'horizontal'
;
layout_gravity=
'right'
;
layout_width=
'match_parent'
;
layout_height=
'match_parent'
;
{
LinearLayout;
layout_width=
'9%h'
;
layout_height=
'11%h'
;
{
CircleImageView;
layout_marginLeft=
'3%w'
;
src=
'https://p4.a.yximgs.com/ufile/atlas/NTIwNTU5ODI5NzY5MDQxMjAxMF8xNjU3ODkwNTk5OTIz_3.jpg'
;
layout_width=
'12%w'
;
layout_height=
'12%w'
;
layout_gravity=
'left|center'
;
};
};
{
LinearLayout;
Orientation=
'vertical'
;
layout_gravity=
'right'
;
layout_width=
'match_parent'
;
layout_height=
'match_parent'
;
{
LinearLayout;
layout_width=
'match_parent'
;
layout_height=
'5%h'
;
{
TextView;
layout_marginTop=
'2%h'
;
layout_width=
'match_parent'
;
layout_height=
'match_parent'
;
Gravity=
'left|center'
;
textColor=
'#FF000000'
;
text=
'法律声明'
;
textSize=
'16sp'
;
};
};
{
LinearLayout;
layout_width=
'match_parent'
;
layout_height=
'6.1%h'
;
{
TextView;
layout_width=
'match_parent'
;
layout_height=
'match_parent'
;
Gravity=
'left'
;
textColor=
'#69000000'
;
text=
'做应用慢原因:写应用花一天,读法规花一年。'
;
textSize=
'12sp'
;
};
};
};
};
{
CardView;
layout_margin=
'0dp'
;
layout_gravity=
'bottom'
;
Elevation=
'0dp'
;
layout_width=
'match_parent'
;
layout_height=
'2%h'
;
radius=
'0dp'
;
CardBackgroundColor=
'#FF0088C2'
;
};
};
{
CardView;
layout_margin=
'10dp'
;
layout_gravity=
'center'
;
Elevation=
'6dp'
;
layout_width=
'45%w'
;
layout_height=
'45%h'
;
radius=
'8dp'
;
CardBackgroundColor=
'#FFF59D'
;
{
LinearLayout;
id=
"r2"
;
Orientation=
'horizontal'
;
layout_gravity=
'right'
;
layout_width=
'match_parent'
;
layout_height=
'match_parent'
;
{
LinearLayout;
layout_width=
'9%h'
;
layout_height=
'11%h'
;
{
CircleImageView;
layout_marginLeft=
'3%w'
;
src=
'https://p4.a.yximgs.com/ufile/atlas/NTIwNTU5ODI5NzY5MDQxMjAxMF8xNjU3ODkwNTk5OTIz_2.jpg'
;
layout_width=
'12%w'
;
layout_height=
'12%w'
;
layout_gravity=
'left|center'
;
};
};
{
LinearLayout;
Orientation=
'vertical'
;
layout_gravity=
'right'
;
layout_width=
'match_parent'
;
layout_height=
'match_parent'
;
{
LinearLayout;
layout_width=
'match_parent'
;
layout_height=
'5%h'
;
{
TextView;
layout_marginTop=
'2%h'
;
layout_width=
'match_parent'
;
layout_height=
'match_parent'
;
Gravity=
'left|center'
;
textColor=
'#FF000000'
;
text=
'作者有些话'
;
textSize=
'16sp'
;
};
};
{
LinearLayout;
layout_width=
'match_parent'
;
layout_height=
'6.1%h'
;
{
TextView;
layout_width=
'match_parent'
;
layout_height=
'match_parent'
;
Gravity=
'left'
;
textColor=
'#69000000'
;
text=
'作者的一些话'
;
textSize=
'12sp'
;
};
};
};
};
{
CardView;
layout_margin=
'0dp'
;
layout_gravity=
'bottom'
;
Elevation=
'0dp'
;
layout_width=
'match_parent'
;
layout_height=
'2%h'
;
radius=
'0dp'
;
CardBackgroundColor=
'#FFFFE001'
;
};
};
};
};
};
};
activity.setContentView(loadlayout(mygpub))
function
波纹(id,颜色)
import
"android.content.res.ColorStateList"
local
attrsArray = {android.R.attr.selectableItemBackgroundBorderless}
local
typedArray =activity.obtainStyledAttributes(attrsArray)
ripple=typedArray.getResourceId(
0
,
0
)
Pretend=activity.Resources.getDrawable(ripple)
Pretend.setColor(ColorStateList(int[
0
].class{int{}},int{颜色}))
id.setBackground(Pretend.setColor(ColorStateList(int[
0
].class{int{}},int{颜色})))
end