2021-02-13 21:35:57 -08:00
|
|
|
package com.geeksville.mesh.ui
|
|
|
|
|
|
|
|
|
|
import android.os.Bundle
|
|
|
|
|
import android.view.LayoutInflater
|
|
|
|
|
import android.view.View
|
|
|
|
|
import android.view.ViewGroup
|
2022-11-08 23:11:18 -03:00
|
|
|
import androidx.compose.ui.platform.ViewCompositionStrategy
|
2021-02-13 21:35:57 -08:00
|
|
|
import androidx.fragment.app.activityViewModels
|
2022-09-04 22:52:40 -03:00
|
|
|
import com.geeksville.mesh.android.Logging
|
2022-11-22 22:01:37 -03:00
|
|
|
import com.geeksville.mesh.databinding.ComposeViewBinding
|
2021-02-13 21:35:57 -08:00
|
|
|
import com.geeksville.mesh.model.UIViewModel
|
2023-02-08 09:39:47 -03:00
|
|
|
import com.google.accompanist.themeadapter.material.MdcTheme
|
2022-02-08 13:50:21 -08:00
|
|
|
import dagger.hilt.android.AndroidEntryPoint
|
2021-02-13 21:35:57 -08:00
|
|
|
|
2022-02-08 13:50:21 -08:00
|
|
|
@AndroidEntryPoint
|
2022-11-22 22:01:37 -03:00
|
|
|
class ModuleSettingsFragment : ScreenFragment("Module Settings"), Logging {
|
2021-02-13 21:35:57 -08:00
|
|
|
|
2022-11-22 22:01:37 -03:00
|
|
|
private var _binding: ComposeViewBinding? = null
|
2021-02-13 21:35:57 -08:00
|
|
|
private val binding get() = _binding!!
|
|
|
|
|
private val model: UIViewModel by activityViewModels()
|
|
|
|
|
|
|
|
|
|
override fun onCreateView(
|
|
|
|
|
inflater: LayoutInflater, container: ViewGroup?,
|
|
|
|
|
savedInstanceState: Bundle?
|
2022-01-26 02:35:37 -03:00
|
|
|
): View {
|
2022-11-22 22:01:37 -03:00
|
|
|
_binding = ComposeViewBinding.inflate(inflater, container, false)
|
2022-11-08 23:11:18 -03:00
|
|
|
.apply {
|
2022-11-22 22:01:37 -03:00
|
|
|
composeView.apply {
|
2022-11-08 23:11:18 -03:00
|
|
|
setViewCompositionStrategy(
|
|
|
|
|
ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed
|
|
|
|
|
)
|
|
|
|
|
setContent {
|
|
|
|
|
MdcTheme {
|
2022-11-22 22:01:37 -03:00
|
|
|
ModuleSettingsItemList(model)
|
2022-11-08 23:11:18 -03:00
|
|
|
}
|
|
|
|
|
}
|
2021-02-14 16:07:49 +08:00
|
|
|
}
|
2021-02-13 21:35:57 -08:00
|
|
|
}
|
2022-11-08 23:11:18 -03:00
|
|
|
return binding.root
|
2021-02-13 21:35:57 -08:00
|
|
|
}
|
2022-11-08 23:11:18 -03:00
|
|
|
}
|