是不是为弹窗顺序而烦恼,导致写太多弹窗顺序逻辑,有了它妈妈再也不用担心复杂的弹窗顺序逻辑问题了
哥们点个赞再走呀
制作不容易,条件允许情况下,打赏一下,谢谢
项目build.gradle
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
加入作者的依赖,其中用户名就是作者的微信
implementation 'com.github.nihaoxj123:rCode:1.1.4'
使用方法
public class MainActivity extends AppCompatActivity {
private NoRepeatDialog dialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
dialog = new NoRepeatDialog(this);
//下一个对话框延时多长时间再显示,默认是0 单位毫秒
dialog.setShowNextDialogDelay(500);
}
public void showDialog(View view){
dialog.show(R.layout.dialog_layout, new NoRepeatDialog.OnDialogListener() {
@Override
public void onClose() {
}
@Override
public void onShow() {
TextView tv = findViewById(R.id.tv);
tv.setText("我是对话框1");
}
});
//带参数
Student st = new Student();
st.setAge(18);
st.setName("小明");
dialog.show(R.layout.dialog_student_layout, new NoRepeatDialog.OnDialogListener(st) {
@Override
public void onClose() {
}
@Override
public void onShow() {
Student st = (Student) getData();
TextView name = findViewById(R.id.name);
TextView age = findViewById(R.id.age);
name.setText("我叫" +st.getName());
age.setText("今年"+ st.getAge()+"岁");
}
});
}
}
- 制作不容易,条件允许情况下,打赏一下,谢谢
网友评论