mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-28 01:24:03 +03:00
initialize viewModel in onCreate
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
cd3f8af24a
commit
ca0c045e8d
1 changed files with 2 additions and 6 deletions
|
@ -47,8 +47,6 @@ import javax.inject.Inject
|
|||
@AutoInjector(NextcloudTalkApplication::class)
|
||||
class PollCreateDialogFragment : DialogFragment(), PollCreateOptionsItemListener {
|
||||
|
||||
lateinit var roomToken: String
|
||||
|
||||
@Inject
|
||||
lateinit var viewModelFactory: ViewModelProvider.Factory
|
||||
|
||||
|
@ -62,8 +60,8 @@ class PollCreateDialogFragment : DialogFragment(), PollCreateOptionsItemListener
|
|||
NextcloudTalkApplication.sharedApplication!!.componentApplication.inject(this)
|
||||
|
||||
viewModel = ViewModelProvider(this, viewModelFactory)[PollCreateViewModel::class.java]
|
||||
|
||||
roomToken = arguments?.getString(KEY_ROOM_TOKEN)!!
|
||||
val roomToken = arguments?.getString(KEY_ROOM_TOKEN)!!
|
||||
viewModel.initialize(roomToken)
|
||||
}
|
||||
|
||||
@SuppressLint("InflateParams")
|
||||
|
@ -89,8 +87,6 @@ class PollCreateDialogFragment : DialogFragment(), PollCreateOptionsItemListener
|
|||
adapter = PollCreateOptionsAdapter(this)
|
||||
binding.pollCreateOptionsList.adapter = adapter
|
||||
|
||||
viewModel.initialize(roomToken)
|
||||
|
||||
setupListeners()
|
||||
setupStateObserver()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue