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
|
2023-03-02 21:59:22 -03:00
|
|
|
import androidx.compose.ui.platform.ComposeView
|
2022-11-08 23:11:18 -03:00
|
|
|
import androidx.compose.ui.platform.ViewCompositionStrategy
|
2023-03-02 21:59:22 -03:00
|
|
|
import androidx.core.content.ContextCompat
|
2021-02-13 21:35:57 -08:00
|
|
|
import androidx.fragment.app.activityViewModels
|
2023-03-02 21:59:22 -03:00
|
|
|
import com.geeksville.mesh.R
|
2022-09-04 22:52:40 -03:00
|
|
|
import com.geeksville.mesh.android.Logging
|
2021-02-13 21:35:57 -08:00
|
|
|
import com.geeksville.mesh.model.UIViewModel
|
2023-03-12 12:41:05 -03:00
|
|
|
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
|
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
|
|
|
|
|
|
|
|
private val model: UIViewModel by activityViewModels()
|
|
|
|
|
|
|
|
|
|
override fun onCreateView(
|
2023-03-02 21:59:22 -03:00
|
|
|
inflater: LayoutInflater,
|
|
|
|
|
container: ViewGroup?,
|
2021-02-13 21:35:57 -08:00
|
|
|
savedInstanceState: Bundle?
|
2022-01-26 02:35:37 -03:00
|
|
|
): View {
|
2023-03-02 21:59:22 -03:00
|
|
|
return ComposeView(requireContext()).apply {
|
|
|
|
|
setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
|
|
|
|
|
setBackgroundColor(ContextCompat.getColor(context, R.color.colorAdvancedBackground))
|
|
|
|
|
setContent {
|
2023-03-12 12:41:05 -03:00
|
|
|
AppCompatTheme {
|
2023-03-02 21:59:22 -03:00
|
|
|
ModuleSettingsItemList(model)
|
2021-02-14 16:07:49 +08:00
|
|
|
}
|
2021-02-13 21:35:57 -08:00
|
|
|
}
|
2023-03-02 21:59:22 -03:00
|
|
|
}
|
2021-02-13 21:35:57 -08:00
|
|
|
}
|
2022-11-08 23:11:18 -03:00
|
|
|
}
|