Inject permission utils

This commit is contained in:
Johannes Marbach 2022-05-25 16:22:16 +02:00
parent 6ec6d41aa9
commit 9e084ec372
2 changed files with 5 additions and 3 deletions

View File

@ -64,7 +64,9 @@ data class WidgetArgs(
val urlParams: Map<String, String> = emptyMap()
) : Parcelable
class WidgetFragment @Inject constructor() :
class WidgetFragment @Inject constructor(
private val permissionUtils: WebviewPermissionUtils
) :
VectorBaseFragment<FragmentRoomWidgetBinding>(),
WebViewEventListener,
WebChromeEventListener,
@ -72,7 +74,6 @@ class WidgetFragment @Inject constructor() :
private val fragmentArgs: WidgetArgs by args()
private val viewModel: WidgetViewModel by activityViewModel()
private val permissionUtils = WebviewPermissionUtils()
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentRoomWidgetBinding {
return FragmentRoomWidgetBinding.inflate(inflater, container, false)

View File

@ -26,8 +26,9 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
import im.vector.app.R
import im.vector.app.core.utils.checkPermissions
import java.lang.NullPointerException
import javax.inject.Inject
class WebviewPermissionUtils {
class WebviewPermissionUtils @Inject constructor() {
private var permissionRequest: PermissionRequest? = null
private var selectedPermissions = listOf<String>()