Commit 6c434a5b authored by Christophe Deschamps's avatar Christophe Deschamps
Browse files

Parfois bug d'affichage au clic sur le bouton +: avant de passer à la vue...

Parfois bug d'affichage au clic sur le bouton +: avant de passer à la vue suivante le bouton se décale parfois vers le bas, mais c'est aléatoire.


Former-commit-id: cca66852d8248683996b5db1a2629eb591bfed86
parent 0185e75b
......@@ -20,14 +20,14 @@ import org.lindoor.entities.Device
class DevicesFragment : GenericFragment() {
private lateinit var devicesViewModel: DevicesViewModel
private lateinit var binding: FragmentDevicesBinding
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val binding = FragmentDevicesBinding.inflate(inflater, container, false)
binding = FragmentDevicesBinding.inflate(inflater, container, false)
devicesViewModel = ViewModelProvider(this).get(DevicesViewModel::class.java)
devicesViewModel.selectedDevice =
MutableLiveData<Device>() // Android bug - onCreateView called on navigateUp()
......@@ -35,6 +35,7 @@ class DevicesFragment : GenericFragment() {
binding.model = devicesViewModel
binding.root.new_device.setOnClickListener {
binding.root.new_device.visibility = View.INVISIBLE
val actionDetail = DevicesFragmentDirections.deviceNew()
mainactivity.navController.navigate(actionDetail)
}
......@@ -67,4 +68,9 @@ class DevicesFragment : GenericFragment() {
return binding.root
}
override fun onResume() {
super.onResume()
binding.root.new_device.visibility = View.VISIBLE
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment