/*
 * Copyright 2019 Louis Cognault Ayeva Derman. Use of this source code is governed by the Apache 2.0 license.
 */

package com.example.splitties.preferences.ui

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import kotlinx.coroutines.launch
import splitties.lifecycle.coroutines.lifecycleScope

class PreferencesBottomSheetDialogFragment : BottomSheetDialogFragment() {

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? = SamplePreferencesUi(requireContext()).apply {
        viewLifecycleOwner.lifecycleScope.launch { run() }
    }.root
}

/*
 * Copyright 2019 Louis Cognault Ayeva Derman. Use of this source code is governed by the Apache 2.0 license.
 */

package com.example.splitties.preferences.ui

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import kotlinx.coroutines.launch
import splitties.lifecycle.coroutines.lifecycleScope

class PreferencesBottomSheetDialogFragment : BottomSheetDialogFragment() {

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? = SamplePreferencesUi(inflater.context).apply {
        viewLifecycleOwner.lifecycleScope.launch { run() }
    }.root
}

Use LayoutInflater context in DialogFragment
Use LayoutInflater context in DialogFragment

LouisCAD/Splitties,LouisCAD/Splitties,LouisCAD/Splitties