mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-04 14:13:47 -04:00
fix: add onDestroyView() to release fragment resources
This commit is contained in:
@@ -363,6 +363,11 @@ class ChannelFragment : ScreenFragment("Channel"), Logging {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
}
|
||||
|
||||
private fun getModemPreset(selectedChannelOptionString: String): ConfigProtos.Config.LoRaConfig.ModemPreset {
|
||||
for (item in ChannelOption.values()) {
|
||||
if (getString(item.configRes) == selectedChannelOptionString)
|
||||
|
||||
@@ -222,6 +222,13 @@ class ContactsFragment : ScreenFragment("Messages"), Logging {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
actionMode?.finish()
|
||||
actionMode = null
|
||||
_binding = null
|
||||
}
|
||||
|
||||
private inner class ActionModeCallback : ActionMode.Callback {
|
||||
override fun onCreateActionMode(mode: ActionMode, menu: Menu): Boolean {
|
||||
mode.menuInflater.inflate(R.menu.menu_messages, menu)
|
||||
|
||||
@@ -51,4 +51,9 @@ class DebugFragment : Fragment() {
|
||||
logs?.let { adapter.setLogs(it) }
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
}
|
||||
}
|
||||
@@ -320,6 +320,13 @@ class MessagesFragment : Fragment(), Logging {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
actionMode?.finish()
|
||||
actionMode = null
|
||||
_binding = null
|
||||
}
|
||||
|
||||
private inner class ActionModeCallback : ActionMode.Callback {
|
||||
override fun onCreateActionMode(mode: ActionMode, menu: Menu): Boolean {
|
||||
mode.menuInflater.inflate(R.menu.menu_messages, menu)
|
||||
|
||||
@@ -109,6 +109,11 @@ class QuickChatSettingsFragment : ScreenFragment("Quick Chat Settings"), Logging
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
}
|
||||
|
||||
data class DialogBuilder(
|
||||
val builder: MaterialAlertDialogBuilder,
|
||||
val nameInput: EditText,
|
||||
|
||||
@@ -618,6 +618,12 @@ class SettingsFragment : ScreenFragment("Settings"), Logging {
|
||||
if (binding.provideLocationCheckbox.isChecked)
|
||||
checkLocationEnabled(getString(R.string.location_disabled))
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val SCAN_PERIOD: Long = 10000 // Stops scanning after 10 seconds
|
||||
}
|
||||
|
||||
@@ -318,4 +318,9 @@ class UsersFragment : ScreenFragment("Users"), Logging {
|
||||
nodesAdapter.onNodesChanged(it.values.toTypedArray())
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user