From 35475e1d25d777d74bf611d7e8d8499b1f37881c Mon Sep 17 00:00:00 2001 From: Viktor De Pasquale Date: Tue, 19 Nov 2019 17:41:09 +0100 Subject: [PATCH] Added option to include simple view to MagiskDialog --- app/src/main/java/com/topjohnwu/magisk/view/MagiskDialog.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/com/topjohnwu/magisk/view/MagiskDialog.kt b/app/src/main/java/com/topjohnwu/magisk/view/MagiskDialog.kt index 105ec7c23..f4b698340 100644 --- a/app/src/main/java/com/topjohnwu/magisk/view/MagiskDialog.kt +++ b/app/src/main/java/com/topjohnwu/magisk/view/MagiskDialog.kt @@ -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) }