Added option to include simple view to MagiskDialog

This commit is contained in:
Viktor De Pasquale 2019-11-19 17:41:09 +01:00
parent fb2c292f35
commit 35475e1d25

View File

@ -7,6 +7,7 @@ import android.graphics.drawable.ColorDrawable
import android.graphics.drawable.Drawable
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
import androidx.appcompat.app.AlertDialog
@ -148,6 +149,11 @@ class MagiskDialog @JvmOverloads constructor(
binding.apply(body)
}
fun applyView(view: View) = apply {
resetView()
this.binding.dialogBaseContainer.addView(view)
}
fun onDismiss(callback: OnDialogButtonClickListener) =
apply { setOnDismissListener(callback) }