wip: wiring network client
This commit is contained in:
@@ -9,7 +9,6 @@ import androidx.compose.foundation.layout.wrapContentSize
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.livedata.observeAsState
|
||||
import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.ui.ExperimentalComposeUiApi
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.ComposeView
|
||||
@@ -24,7 +23,6 @@ import xyz.magicalbits.smsremote.components.JetchatAppBar
|
||||
import xyz.magicalbits.smsremote.theme.JetchatTheme
|
||||
import kotlin.getValue
|
||||
import androidx.navigation.findNavController
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
class DeviceFragment : Fragment() {
|
||||
private val viewModel: DeviceViewModel by viewModels()
|
||||
@@ -33,8 +31,10 @@ class DeviceFragment : Fragment() {
|
||||
override fun onAttach(context: Context) {
|
||||
super.onAttach(context)
|
||||
// Consider using safe args plugin
|
||||
val deviceName = arguments?.getString("deviceName")
|
||||
viewModel.setDeviceId(deviceName)
|
||||
val deviceId = arguments?.getString("deviceId")
|
||||
val name = arguments?.getString("name")
|
||||
val type = arguments?.getString("type")
|
||||
viewModel.setDeviceData(deviceId, name, type)
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalComposeUiApi::class, ExperimentalMaterial3Api::class)
|
||||
@@ -65,6 +65,7 @@ class DeviceFragment : Fragment() {
|
||||
|
||||
JetchatTheme {
|
||||
if (deviceData == null) {
|
||||
println("calling device error")
|
||||
DeviceError()
|
||||
} else {
|
||||
val navController: NavController = rootView.findNavController()
|
||||
|
||||
Reference in New Issue
Block a user