kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
refactor(messages): persist contact variables
rodzic
3188706776
commit
c26b6dd7ac
|
@ -233,6 +233,12 @@ class MessagesFragment : Fragment(), Logging {
|
||||||
return binding.root
|
return binding.root
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onSaveInstanceState(outState: Bundle) {
|
||||||
|
super.onSaveInstanceState(outState)
|
||||||
|
outState.putString("contactKey", contactKey)
|
||||||
|
outState.putString("contactName", contactName)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
|
@ -243,6 +249,11 @@ class MessagesFragment : Fragment(), Logging {
|
||||||
model.setContactKey(contactKey)
|
model.setContactKey(contactKey)
|
||||||
binding.messageTitle.text = contactName
|
binding.messageTitle.text = contactName
|
||||||
}
|
}
|
||||||
|
if (savedInstanceState != null) {
|
||||||
|
contactKey = savedInstanceState.getString("contactKey").toString()
|
||||||
|
contactName = savedInstanceState.getString("contactName").toString()
|
||||||
|
binding.messageTitle.text = contactName
|
||||||
|
}
|
||||||
|
|
||||||
binding.sendButton.setOnClickListener {
|
binding.sendButton.setOnClickListener {
|
||||||
debug("User clicked sendButton")
|
debug("User clicked sendButton")
|
||||||
|
|
Ładowanie…
Reference in New Issue