2019-4-27 277 0
代码教学

java(弹窗对象,弹窗对象,"android.app.AlertDialog$Builder.*")java(null,弹窗对象,"android.app.Dialog.show")java(win,弹窗对象,"android.app.Dialog.getWindow")java(don,win,"android.view.Window.getDecorView")sa=5sb=50sc="#255779|#3e7492|#a6c0cd"sd="#333333"se="trbl"ngde(a,b,c,d,e,f)//背景us(don,"background",f)图标:javanew(弹窗对象,"android.app.AlertDialog$Builder","android.content.Context",activity)/.sbp("@icon.png",图标)java(图标,弹窗对象,"android.app.AlertDialog$Builder.setIcon","android.graphics.drawable.Drawable",图标)标题:java(null,弹窗对象,"android.app.AlertDialog$Builder.setTitle","CharSequence","标题")按钮事件:javacb(事件,事件类){}javacb(事件2,事件类){}按钮文字:javax(null,弹窗对象,"android.app.AlertDialog$Builder","setPositiveButton","CharSequence","加群",事件类,事件)javax(null,弹窗对象,"android.app.AlertDialog$Builder","setNegativeButton","CharSequence","按钮2",事件类,事件2)javax(null,弹窗对象,"android.app.AlertDialog$Builder","setNeutralButton","CharSequence","按钮3",事件类,事件2)触碰弹窗外是否可关闭:java(null,弹窗对象,"android.app.AlertDialog$Builder.setCancelable","boolean",false)按钮颜色:javags(标识,null,"android.content.DialogInterface","BUTTON_POSITIVE")javax(按钮1,弹窗对象,"android.app.AlertDialog","getButton","int",标识)javags(标识,null,"android.content.DialogInterface","BUTTON_NEGATIVE")javax(按钮2,弹窗对象,"android.app.AlertDialog","getButton","int",标识)javags(标识,null,"android.content.DialogInterface","BUTTON_NEUTRAL")javax(按钮3,弹窗对象,"android.app.AlertDialog","getButton","int",标识)us(按钮1,"textcolor","#ffff00")us(按钮2,"textcolor","#0000ff")us(按钮3,"textcolor","#00ff00")内容颜色:javags(对话框,弹窗对象,"android.app.AlertDialog","mAlert")javags(消息,对话框,"com.android.internal.app.AlertController","mMessageView")us(消息,"textcolor","#ff0000")标题颜色:javags(对话框,弹窗对象,"android.app.AlertDialog","mAlert")javags(标题,对话框,"com.android.internal.app.AlertController","mTitleView")us(标题,"textcolor","#00ffff")

2019-3-2 531 0
代码教学

mian.iyu样1:cls("android.content.DialogInterface$OnclickListener",事件类)javacb(事件,事件类){squn="726651507"ss("mqqapi://card/show_pslcard?src_type=internal&version=1&uin="+qun+"&card_type=group&source=qrcode",joinqq)sit(a,"action","android.intent.action.VIEW")sit(a,"data",joinqq)uit(a,"chooser","选择QQ")}javacb(事件2,事件类){tw("wee")}fn弹窗.构建(null,"AlertDialog","这是一个AlertDialog!",true)fn弹窗.设置按钮(sss.弹窗对象,"按钮1","确定",事件)fn弹窗.设置按钮(sss.弹窗对象,"按钮2","关闭",事件2)fn弹窗.设置按钮(sss.弹窗对象,"按钮3","我只是凑个数",null)fn弹窗.显示(sss.弹窗对象)样2:cls("android.content.DialogInterface$OnclickListener",事件类)javacb(事件,事件类){squn="726651507"ss("mqqapi://card/show_pslcard?src_type=internal&version=1&uin="+qun+"&card_type=group&source=qrcode",joinqq)sit(a,"action","android.intent.action.VIEW")sit(a,"data",joinqq)uit(a,"chooser","选择QQ")}fn弹窗.构建(null,"AlertDialog","界面.iyu",null)fn弹窗.设置按钮(sss.弹窗对象,"按钮1","确定",事件)fn弹窗.设置按钮(sss.弹窗对象,"按钮2","关闭",null)fn弹窗.设置按钮(sss.弹窗对象,"按钮3","我只是凑个数",null)fn弹窗.显示(sss.弹窗对象)gvs(sss.弹窗布局,界面.3,文本)//gvs用法请看手册//获取弹窗中的控件3us(文本,"text","测试OK")fn弹窗.设置位置(sss.弹窗对象,"BOTTOM")zdp(220,高度)zdp(330,宽度)fn弹窗.设置样式(sss.弹窗对象,宽度,高度,50,150)fn弹窗.取标题(sss.弹窗对象)us(sss.标题,"textcolor","#E91E63")fn弹窗.取消息(sss.弹窗对象)us(sss.消息,"textcolor","#E91E63")fn弹窗.取按钮(sss.弹窗对象,"BUTTON_POSITIVE")us(sss.按钮,"textcolor","#E91E63")fn弹窗.取按钮(sss.弹窗对象,"BUTTON_NEGATIVE")us(sss.按钮,"textcolor","#E91E63")fn弹窗.取按钮(sss.弹窗对象,"BUTTON_NEUTRAL")us(sss.按钮,"textcolor","#E91E63")样3:cls("android.content.DialogInterface$OnclickListener",事件类)javacb(事件,事件类){squn="726651507"ss("mqqapi://card/show_pslcard?src_type=internal&version=1&uin="+qun+"&card_type=group&source=qrcode",joinqq)sit(a,"action","android.intent.action.VIEW")sit(a,"data",joinqq)uit(a,"chooser","选择QQ")}javacb(事件2,事件类){squn="726651507"ss("mqqapi://card/show_pslcard?src_type=internal&version=1&uin="+qun+"&card_type=group&source=qrcode",joinqq)sit(a,"action","android.intent.action.VIEW")sit(a,"data",joinqq)uit(a,"chooser","选择QQ")}fn弹窗.构建(null,"AlertDialog","这是一个AlertDialog!",null)fn弹窗.设置按钮(sss.弹窗对象,"按钮1","确定",事件)fn弹窗.设置按钮(sss.弹窗对象,"按钮2","关闭",事件2)fn弹窗.设置按钮(sss.弹窗对象,"按钮3","我只是凑个数",null)fn弹窗.显示(sss.弹窗对象)fn弹窗.设置位置(sss.弹窗对象,"BOTTOM")zdp(180,高度)zdp(300,宽度)fn弹窗.设置样式(sss.弹窗对象,宽度,高度,50,150)fn弹窗.取标题(sss.弹窗对象)us(sss.标题,"textcolor","#E91E63")fn弹窗.取消息(sss.弹窗对象)us(sss.消息,"textcolor","#E91E63")fn弹窗.取按钮(sss.弹窗对象,"BUTTON_POSITIVE")us(sss.按钮,"textcolor","#E91E63")fn弹窗.取按钮(sss.弹窗对象,"BUTTON_NEGATIVE")us(sss.按钮,"textcolor","#E91E63")fn弹窗.取按钮(sss.弹窗对象,"BUTTON_NEUTRAL")us(sss.按钮,"textcolor","#E91E63")样4(动态加控件):nvw(null,null,"线性布局","width=-1\nheight=-1",linear)nvw(null,linear,"编辑框","width=-1\nheight=-1\ntext=??????\nlayout_marginleft=20dp\nlayout_marginright=20dp",textid)fn着色.控件着色(textid,"#35f2b5")cls("android.content.DialogInterface$OnclickListener",事件类)javacb(事件,事件类){squn="726651507"ss("mqqapi://card/show_pslcard?src_type=internal&version=1&uin="+qun+"&card_type=group&source=qrcode",joinqq)sit(a,"action","android.intent.action.VIEW")sit(a,"data",joinqq)uit(a,"chooser","选择QQ")}javacb(事件2,事件类){ug(textid,"text",a)tw(a)}fn弹窗.构建(null,"AlertDialog",linear,null)fn弹窗.设置按钮(sss.弹窗对象,"按钮1","确定",事件)fn弹窗.设置按钮(sss.弹窗对象,"按钮2","关闭",事件2)fn弹窗.设置按钮(sss.弹窗对象,"按钮3","我只是凑个数",null)fn弹窗.显示(sss.弹窗对象)fn弹窗.取标题(sss.弹窗对象)us(sss.标题,"textcolor","#E91E63")fn弹窗.取消息(sss.弹窗对象)us(sss.消息,"textcolor","#E91E63")fn弹窗.取按钮(sss.弹窗对象,"BUTTON_POSITIVE")us(sss.按钮,"textcolor","#E91E63")fn弹窗.取按钮(sss.弹窗对象,"BUTTON_NEGATIVE")us(sss.按钮,"textcolor","#E91E63")fn弹窗.取按钮(sss.弹窗对象,"BUTTON_NEUTRAL")us(sss.按钮,"textcolor","#E91E63")样5(动态加控件并给事件):cls("android.content.DialogInterface$OnclickListener",事件类)javacb(事件,事件类){squn="726651507"ss("mqqapi://card/show_pslcard?src_type=internal&version=1&uin="+qun+"&card_type=group&source=qrcode",joinqq)sit(a,"action","android.intent.action.VIEW")sit(a,"data",joinqq)uit(a,"chooser","选择QQ")}javacb(事件2,事件类){squn="726651507"ss("mqqapi://card/show_pslcard?src_type=internal&version=1&uin="+qun+"&card_type=group&source=qrcode",joinqq)sit(a,"action","android.intent.action.VIEW")sit(a,"data",joinqq)uit(a,"chooser","选择QQ")}//nvw(null,null,"线性布局","",linear)//nvw(null,null,"编辑框","width=-1\nheight=-2\ntext=??????\nlayout_marginleft=20dp\nlayout_marginright=20dp",textid)nvw(null,null,"线性布局","width=-1\nheight=-1\norientation=vertical",linear)nvw(null,linear,"按钮","width=-1\nheight=-1\ntext=www\nbackground=through\npaddingleft=30dp\ngravity=left|center_vertical",b1)nvw(null,linear,"按钮","width=-1\nheight=-1\ntext=www\nlayout_marginleft=20dp\nlayout_marginright=20dp",b2)nvw(null,linear,"按钮","width=-1\nheight=-1\ntext=www\nlayout_marginleft=20dp\nlayout_marginright=20dp",b3)ssj(b1,"clicki"){fn弹窗.关闭(sss.弹窗对象)}fn弹窗.构建(null,"AlertDialog",linear,null)fn弹窗.设置按钮(sss.弹窗对象,"按钮1","确定",事件)fn弹窗.设置按钮(sss.弹窗对象,"按钮2","关闭",事件2)fn弹窗.设置按钮(sss.弹窗对象,"按钮3","我只是凑个数",null)fn弹窗.显示(sss.弹窗对象)fn弹窗.取标题(sss.弹窗对象)us(sss.标题,"textcolor","#E91E63")fn弹窗.取消息(sss.弹窗对象)us(sss.消息,"textcolor","#E91E63")fn弹窗.取按钮(sss.弹窗对象,"BUTTON_POSITIVE")us(sss.按钮,"textcolor","#E91E63")fn弹窗.取按钮(sss.弹窗对象,"BUTTON_NEGATIVE")us(sss.按钮,"textcolor","#E91E63")fn弹窗.取按钮(sss.弹窗对象,"BUTTON_NEUTRAL")us(sss.按钮,"textcolor","#E91E63")//--关闭弹窗:fn弹窗.关闭(sss.弹窗对象)弹窗.myu/.传入数据弹窗图标位置,弹窗标题,弹窗内容,返回键是否可以关闭注意:弹窗内容可以写界面名!直接以这个界面做为界面内容调用此方法后,会生成一个全局变量弹窗对象为弹窗的Builder对象当界面内容为界面名时,还会生成一个全局变量弹窗布局为弹窗里的View对象通过gvs可以获取里面的控件./fn构建(图标,标题,内容,关闭)syso(内容)javanew(弹窗对象,"android.app.AlertDialog$Builder","android.content.Context",activity)f(图标!=null){sbp(图标,图标)java(null,弹窗对象,"android.app.AlertDialog$Builder.setIcon","android.graphics.drawable.Drawable",图标)}f(标题!=null){java(null,弹窗对象,"android.app.AlertDialog$Builder.setTitle","CharSequence",标题)}f(内容*?".iyu"||内容*?"ijs"||内容*?"ijava"){javanew(布局参数,"android.widget.LinearLayout$LayoutParams","int",-1,"int",-1)javanew(线性布局,"android.widget.LinearLayout","Context",activity)java(null,线性布局,"android.view.View.setLayoutParams","android.view.ViewGroup$LayoutParams",布局参数)java(null,线性布局,"android.widget.LinearLayout.setOrientation","int",1)addv(线性布局,内容)java(null,弹窗对象,"android.app.AlertDialog$Builder.setView","android.view.View",线性布局)sss弹窗布局=线性布局}f(内容?"android.widget"){javanew(布局参数,"android.widget.LinearLayout$LayoutParams","int",-1,"int",-1)javanew(线性布局,"android.widget.LinearLayout","Context",activity)java(null,线性布局,"android.view.View.setLayoutParams","android.view.ViewGroup$LayoutParams",布局参数)java(null,线性布局,"android.widget.LinearLayout.setOrientation","int",1)//nvw(null,null,"线性布局","width=-1\nheight=-1",线性布局)//nvw(null,null,"编辑框","width=-1\nheight=-2\ntext=??????\nlayout_marginleft=20dp\nlayout_marginright=20dp",textid)nvw(内容,线性布局)java(null,弹窗对象,"android.app.AlertDialog$Builder.setView","android.view.View",线性布局)sss弹窗布局=线性布局}else{java(null,弹窗对象,"android.app.AlertDialog$Builder.setMessage","CharSequence",内容)}f(关闭){java(null,弹窗对象,"android.app.AlertDialog$Builder.setCancelable","boolean",false)}sss弹窗对象=弹窗对象endfn/.传入数据弹窗对象,按钮位置,按钮文字,按钮点击事件注意,按钮位置按从右到左分别为按钮1,按钮2,按钮3按钮的点击事件可以传null./fn设置按钮(弹窗对象,按钮,文字,事件)cls("android.content.DialogInterface$OnclickListener",事件类)f(按钮=="按钮1"){javax(null,弹窗对象,"android.app.AlertDialog$Builder","setPositiveButton","CharSequence",文字,事件类,事件)}elsef(按钮=="按钮2"){javax(null,弹窗对象,"android.app.AlertDialog$Builder","setNegativeButton","CharSequence",文字,事件类,事件)}elsef(按钮=="按钮3"){javax(null,弹窗对象,"android.app.AlertDialog$Builder","setNeutralButton","CharSequence",文字,事件类,事件)}endfn/.传入弹窗对象即可调用此方法后,会生成一个全局变量为弹窗的对象.//..注意!,.此方法之后的所有方法必须在调用了此方法之后在调用.否则报错!./fn显示(弹窗对象)java(弹窗对象,弹窗对象,"android.app.AlertDialog$Builder.*")java(null,弹窗对象,"android.app.Dialog.show")sss弹窗对象=弹窗对象endfn//传入弹窗对象即可关闭弹窗fn关闭(弹窗对象)java(null,弹窗对象,"android.app.Dialog.dismiss")endfn//传入弹窗对象//生成一个全局变量标题//可以使用us对其进行各种设置fn取标题(弹窗对象)javags(对话框,弹窗对象,"android.app.AlertDialog","mAlert")javags(sss.标题,对话框,"com.android.internal.app.AlertController","mTitleView")endfn//传入弹窗对象//生成一个全局变量消息//可以使用us对其进行各种设置fn取消息(弹窗对象)javags(对话框,弹窗对象,"android.app.AlertDialog","mAlert")javags(sss.消息,对话框,"com.android.internal.app.AlertController","mMessageView")endfn//传入弹窗对象,标识//标识数据如下//左边按钮BUTTON_NEUTRAL//中间按钮BUTTON_NEGATIVE//右边按钮BUTTON_POSITIVE//生成一个全局变量按钮//可以使用us对其进行各种设置fn取按钮(弹窗对象,标识)javags(标识,null,"android.content.DialogInterface",标识)javax(sss.按钮,弹窗对象,"android.app.AlertDialog","getButton","int",标识)endfn//传入数据弹窗对象,弹窗位置//弹窗位置数据如下//CENTER中间//BOTTOM底部//LEFT左边//RIGHT右边//TOP顶部fn设置位置(弹窗对象,位置)java(window,弹窗对象,"android.app.Dialog.getWindow")javags(位置,null,"android.view.Gravity",位置)java(null,window,"android.view.Window.setGravity","int",位置)endfn//传入弹窗对象,弹窗的宽度,弹窗的高度,弹窗在x上的偏移量,弹窗在y上的偏移量//宽度和高度的单位为px//可以使用zdp把dp转换为px后再传入fn设置样式(弹窗对象,宽度,高度,x,y)java(window,弹窗对象,"android.app.Dialog.getWindow")cls("android.view.WindowManager$LayoutParams",cls_lp)java(lp,window,"android.view.Window.getAttributes")javass(null,lp,"android.view.ViewGroup$LayoutParams","width",宽度)javass(null,lp,"android.view.ViewGroup$LayoutParams","height",高度)javass(null,lp,"android.view.WindowManager$LayoutParams","y",y)javass(null,lp,"android.view.WindowManager$LayoutParams","x",x)java(null,window,"android.view.Window.setAttributes",cls_lp,lp)endfn

2019-3-2 567 0
2019-2-28 347 0
2019-2-28 440 0