mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor: simplify passing args to MessagesFragment
This commit is contained in:
parent
6a0d9b523b
commit
5c98936e23
5 changed files with 33 additions and 56 deletions
|
|
@ -31,9 +31,7 @@ import androidx.compose.ui.platform.LocalHapticFeedback
|
|||
import androidx.compose.ui.platform.ViewCompositionStrategy
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.fragment.app.setFragmentResult
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||
import com.geeksville.mesh.BuildConfig
|
||||
|
|
@ -115,13 +113,7 @@ class MapFragment : ScreenFragment("Map Fragment"), Logging {
|
|||
|
||||
private fun openDirectMessage(node: NodeInfo) {
|
||||
val user = node.user ?: return
|
||||
setFragmentResult(
|
||||
"requestKey",
|
||||
bundleOf(
|
||||
"contactKey" to "${node.channel}${user.id}",
|
||||
"contactName" to user.longName
|
||||
)
|
||||
)
|
||||
model.setContactKey("${node.channel}${user.id}")
|
||||
parentFragmentManager.beginTransaction()
|
||||
.replace(R.id.mainActivityLayout, MessagesFragment())
|
||||
.addToBackStack(null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue