mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
create ChannelSet datastore
This commit is contained in:
parent
382535da47
commit
2ed5548abb
11 changed files with 154 additions and 69 deletions
|
|
@ -10,6 +10,7 @@ import androidx.core.content.ContextCompat
|
|||
import androidx.core.os.bundleOf
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.fragment.app.setFragmentResult
|
||||
import androidx.lifecycle.asLiveData
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.geeksville.mesh.android.Logging
|
||||
|
|
@ -89,7 +90,7 @@ class ContactsFragment : ScreenFragment("Messages"), Logging {
|
|||
|
||||
//grab channel names from DeviceConfig
|
||||
val channels = model.channels.value
|
||||
val primaryChannel = channels?.primaryChannel
|
||||
val primaryChannel = channels.primaryChannel
|
||||
|
||||
val shortName = node?.user?.shortName ?: "???"
|
||||
val longName =
|
||||
|
|
@ -200,7 +201,7 @@ class ContactsFragment : ScreenFragment("Messages"), Logging {
|
|||
binding.contactsView.adapter = contactsAdapter
|
||||
binding.contactsView.layoutManager = LinearLayoutManager(requireContext())
|
||||
|
||||
model.channels.observe(viewLifecycleOwner) {
|
||||
model.channels.asLiveData().observe(viewLifecycleOwner) {
|
||||
contactsAdapter.onChannelsChanged()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue