Please consider making a Pull Request if you are capable of doing so.
I need to update a lot of code to make the project work properly, but I don't know how to modify it, and the new version is kotin, which is more painful for me.
What module does this apply to?
example
MaterialDialog.Builder builder = new MaterialDialog.Builder(context)
.title(getDialogTitle())
.icon(getDialogIcon())
.dismissListener(this)
.onAny(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick( MaterialDialog dialog, DialogAction which) {
switch (which) {
default:
MaterialListPreferenceX.this.onClick(dialog, DialogInterface.BUTTON_POSITIVE);
break;
case NEUTRAL:
MaterialListPreferenceX.this.onClick(dialog, DialogInterface.BUTTON_NEUTRAL);
break;
case NEGATIVE:
MaterialListPreferenceX.this.onClick(dialog, DialogInterface.BUTTON_NEGATIVE);
break;
}
}
})
.negativeText(getNegativeButtonText())
.items(getEntries())
.autoDismiss(true) // immediately close the dialog after selection
.itemsCallbackSingleChoice(preselect, new MaterialDialog.ListCallbackSingleChoice() {
@Override
public boolean onSelection(MaterialDialog dialog, View itemView, int which, CharSequence text) {
onClick(null, DialogInterface.BUTTON_POSITIVE);
if (which >= 0 && getEntryValues() != null) {
try {
Field clickedIndex = ListPreference.class.getDeclaredField("mClickedDialogEntryIndex");
clickedIndex.setAccessible(true);
clickedIndex.set(MaterialListPreferenceX.this, which);
} catch (Exception e) {
e.printStackTrace();
}
}
return true;
}
});
How to turn into a new version of Java code?
Java isn't supported.
sad
Most helpful comment
sad