mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor: Messages navigation to single contactKey argument
This commit is contained in:
parent
1c42bd262f
commit
44d195a4a5
5 changed files with 25 additions and 34 deletions
|
|
@ -327,9 +327,7 @@ class MainActivity : AppCompatActivity(), Logging {
|
|||
MeshServiceNotifications.OPEN_MESSAGE_ACTION -> {
|
||||
val contactKey =
|
||||
intent.getStringExtra(MeshServiceNotifications.OPEN_MESSAGE_EXTRA_CONTACT_KEY)
|
||||
val contactName =
|
||||
intent.getStringExtra(MeshServiceNotifications.OPEN_MESSAGE_EXTRA_CONTACT_NAME)
|
||||
showMessages(contactKey, contactName)
|
||||
showMessages(contactKey)
|
||||
}
|
||||
|
||||
UsbManager.ACTION_USB_DEVICE_ATTACHED -> {
|
||||
|
|
@ -602,10 +600,10 @@ class MainActivity : AppCompatActivity(), Logging {
|
|||
binding.pager.currentItem = 5
|
||||
}
|
||||
|
||||
private fun showMessages(contactKey: String?, contactName: String?) {
|
||||
private fun showMessages(contactKey: String?) {
|
||||
model.setCurrentTab(0)
|
||||
if (contactKey != null && contactName != null) {
|
||||
supportFragmentManager.navigateToMessages(contactKey, contactName)
|
||||
if (contactKey != null) {
|
||||
supportFragmentManager.navigateToMessages(contactKey)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue