|
@@ -209,7 +209,7 @@ public class MaterialDialog extends DialogBase implements
|
|
|
}
|
|
|
} else if (listType == ListType.SINGLE) {
|
|
|
boolean allowSelection = true;
|
|
|
- final MaterialDialogAdapter adapter = (MaterialDialogAdapter) mBuilder.adapter;
|
|
|
+ final DefaultAdapter adapter = (DefaultAdapter) mBuilder.adapter;
|
|
|
final RadioButton radio = (RadioButton) view.findViewById(R.id.control);
|
|
|
|
|
|
if (mBuilder.autoDismiss && mBuilder.positiveText == null) {
|
|
@@ -1203,14 +1203,14 @@ public class MaterialDialog extends DialogBase implements
|
|
|
* @param which The action button of which to get the view for.
|
|
|
* @return The view from the dialog's layout representing this action button.
|
|
|
*/
|
|
|
- public final View getActionButton(@NonNull DialogAction which) {
|
|
|
+ public final MDButton getActionButton(@NonNull DialogAction which) {
|
|
|
switch (which) {
|
|
|
default:
|
|
|
- return view.findViewById(R.id.buttonDefaultPositive);
|
|
|
+ return positiveButton;
|
|
|
case NEUTRAL:
|
|
|
- return view.findViewById(R.id.buttonDefaultNeutral);
|
|
|
+ return neutralButton;
|
|
|
case NEGATIVE:
|
|
|
- return view.findViewById(R.id.buttonDefaultNegative);
|
|
|
+ return negativeButton;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1385,8 +1385,8 @@ public class MaterialDialog extends DialogBase implements
|
|
|
if (mBuilder.adapter == null)
|
|
|
throw new IllegalStateException("This MaterialDialog instance does not yet have an adapter set to it. You cannot use setItems().");
|
|
|
mBuilder.items = items;
|
|
|
- if (mBuilder.adapter instanceof MaterialDialogAdapter) {
|
|
|
- mBuilder.adapter = new MaterialDialogAdapter(this, ListType.getLayoutForType(listType));
|
|
|
+ if (mBuilder.adapter instanceof DefaultAdapter) {
|
|
|
+ mBuilder.adapter = new DefaultAdapter(this, ListType.getLayoutForType(listType));
|
|
|
} else {
|
|
|
throw new IllegalStateException("When using a custom adapter, setItems() cannot be used. Set items through the adapter instead.");
|
|
|
}
|
|
@@ -1502,8 +1502,8 @@ public class MaterialDialog extends DialogBase implements
|
|
|
@UiThread
|
|
|
public void setSelectedIndex(int index) {
|
|
|
mBuilder.selectedIndex = index;
|
|
|
- if (mBuilder.adapter != null && mBuilder.adapter instanceof MaterialDialogAdapter) {
|
|
|
- ((MaterialDialogAdapter) mBuilder.adapter).notifyDataSetChanged();
|
|
|
+ if (mBuilder.adapter != null && mBuilder.adapter instanceof DefaultAdapter) {
|
|
|
+ ((DefaultAdapter) mBuilder.adapter).notifyDataSetChanged();
|
|
|
} else {
|
|
|
throw new IllegalStateException("You can only use setSelectedIndex() with the default adapter implementation.");
|
|
|
}
|
|
@@ -1520,8 +1520,8 @@ public class MaterialDialog extends DialogBase implements
|
|
|
public void setSelectedIndices(@NonNull Integer[] indices) {
|
|
|
mBuilder.selectedIndices = indices;
|
|
|
selectedIndicesList = new ArrayList<>(Arrays.asList(indices));
|
|
|
- if (mBuilder.adapter != null && mBuilder.adapter instanceof MaterialDialogAdapter) {
|
|
|
- ((MaterialDialogAdapter) mBuilder.adapter).notifyDataSetChanged();
|
|
|
+ if (mBuilder.adapter != null && mBuilder.adapter instanceof DefaultAdapter) {
|
|
|
+ ((DefaultAdapter) mBuilder.adapter).notifyDataSetChanged();
|
|
|
} else {
|
|
|
throw new IllegalStateException("You can only use setSelectedIndices() with the default adapter implementation.");
|
|
|
}
|
|
@@ -1535,8 +1535,8 @@ public class MaterialDialog extends DialogBase implements
|
|
|
throw new IllegalStateException("You can only use clearSelectedIndicies() with multi choice list dialogs.");
|
|
|
mBuilder.selectedIndices = null;
|
|
|
selectedIndicesList.clear();
|
|
|
- if (mBuilder.adapter != null && mBuilder.adapter instanceof MaterialDialogAdapter) {
|
|
|
- ((MaterialDialogAdapter) mBuilder.adapter).notifyDataSetChanged();
|
|
|
+ if (mBuilder.adapter != null && mBuilder.adapter instanceof DefaultAdapter) {
|
|
|
+ ((DefaultAdapter) mBuilder.adapter).notifyDataSetChanged();
|
|
|
} else {
|
|
|
throw new IllegalStateException("You can only use clearSelectedIndicies() with the default adapter implementation.");
|
|
|
}
|