自定义列表弹窗,简化构建弹窗步骤,方便快捷使用!A simple way to use dialog with item list
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.moo611:DesongDialog-Android:1.0.2'
}
String[]datas = new String{"aaa","bbb","ccccc"};
CustomDialog basedialog = new CustomDialog(this);
basedialog.init(datas, new DialogListener() {
@Override
public void onItemClick(int pos) {
//your logic
}
});
String[]datas = new String{"aaa","bbb","ccccc"};
CustomDialog titledialog = new CustomDialog(this,R.style.customdialog);
titledialog.init(datas, "请选择", new DialogListener() {
@Override
public void onItemClick(int pos) {
//your logic
}
});
String[]datas = new String{"aaa","bbb","ccccc"};
CustomDialog customDialog = new CustomDialog(this);
customDialog.init(datas, R.layout.item_header, new DialogListener() {
@Override
public void onItemClick(int pos) {
//your logic
}
});
customDialog.setPosition(Gravity.CENTER);
customDialog.setAnim(R.style.MyDialogAnim);