|
@@ -41,11 +41,12 @@ import com.afollestad.materialdialogs.utils.setDefaults
|
|
import com.afollestad.materialdialogs.utils.setWindowConstraints
|
|
import com.afollestad.materialdialogs.utils.setWindowConstraints
|
|
|
|
|
|
internal fun assertOneSet(
|
|
internal fun assertOneSet(
|
|
- a: Int?,
|
|
|
|
- b: Any?
|
|
|
|
|
|
+ method: String,
|
|
|
|
+ b: Any?,
|
|
|
|
+ a: Int?
|
|
) {
|
|
) {
|
|
if ((a == null || a == 0) && b == null) {
|
|
if ((a == null || a == 0) && b == null) {
|
|
- throw IllegalArgumentException("You must specify a resource ID or literal value.")
|
|
|
|
|
|
+ throw IllegalArgumentException("$method: You must specify a resource ID or literal value")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -110,7 +111,7 @@ class MaterialDialog(
|
|
@DrawableRes res: Int? = null,
|
|
@DrawableRes res: Int? = null,
|
|
drawable: Drawable? = null
|
|
drawable: Drawable? = null
|
|
): MaterialDialog {
|
|
): MaterialDialog {
|
|
- assertOneSet(res, drawable)
|
|
|
|
|
|
+ assertOneSet("icon", drawable, res)
|
|
populateIcon(
|
|
populateIcon(
|
|
view.titleLayout.iconView,
|
|
view.titleLayout.iconView,
|
|
iconRes = res,
|
|
iconRes = res,
|
|
@@ -130,7 +131,7 @@ class MaterialDialog(
|
|
@StringRes res: Int? = null,
|
|
@StringRes res: Int? = null,
|
|
text: String? = null
|
|
text: String? = null
|
|
): MaterialDialog {
|
|
): MaterialDialog {
|
|
- assertOneSet(res, text)
|
|
|
|
|
|
+ assertOneSet("title", text, res)
|
|
populateText(
|
|
populateText(
|
|
view.titleLayout.titleView,
|
|
view.titleLayout.titleView,
|
|
textRes = res,
|
|
textRes = res,
|