是不是為彈窗順序而煩惱扇调,導(dǎo)致寫太多彈窗順序邏輯蹦掐,有了它媽媽再也不用擔(dān)心復(fù)雜的彈窗順序邏輯問(wèn)題了
哥們點(diǎn)個(gè)贊再走呀
制作不容易丐怯,條件允許情況下蟀伸,打賞一下蚀同,謝謝
項(xiàng)目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);
//下一個(gè)對(duì)話框延時(shí)多長(zhǎng)時(shí)間再顯示啊掏,默認(rèn)是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("我是對(duì)話框1");
}
});
//帶參數(shù)
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()+"歲");
}
});
}
}
- 制作不容易蠢络,條件允許情況下,打賞一下迟蜜,謝謝