mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
add option to request remote nodes position
This commit is contained in:
parent
8a03603ef8
commit
6894883362
6 changed files with 43 additions and 13 deletions
|
|
@ -59,7 +59,7 @@ class UsersFragment : ScreenFragment("Users"), Logging {
|
|||
val showAdmin = position == 0 || model.adminChannelIndex > 0
|
||||
val popup = PopupMenu(requireContext(), view)
|
||||
popup.inflate(R.menu.menu_nodes)
|
||||
popup.menu.findItem(R.id.direct_message).isVisible = position > 0
|
||||
popup.menu.setGroupVisible(R.id.group_remote, position > 0)
|
||||
popup.menu.setGroupVisible(R.id.group_admin, showAdmin)
|
||||
popup.setOnMenuItemClickListener { item: MenuItem ->
|
||||
when (item.itemId) {
|
||||
|
|
@ -79,6 +79,12 @@ class UsersFragment : ScreenFragment("Users"), Logging {
|
|||
.commit()
|
||||
}
|
||||
}
|
||||
R.id.request_position -> {
|
||||
if (position > 0 && user != null) {
|
||||
debug("requesting position for ${user.longName}")
|
||||
model.requestPosition(node.num)
|
||||
}
|
||||
}
|
||||
R.id.reboot -> {
|
||||
MaterialAlertDialogBuilder(requireContext())
|
||||
.setTitle("${getString(R.string.reboot)}\n${user?.longName}?")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue