dagger injection init moved to onCreate

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2022-08-11 15:29:50 +02:00
parent 2332c3568c
commit 5f1f34bdfa
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
7 changed files with 14 additions and 28 deletions

View file

@ -45,12 +45,10 @@ class AttachmentDialog(val activity: Activity, var chatController: ChatControlle
private lateinit var dialogAttachmentBinding: DialogAttachmentBinding private lateinit var dialogAttachmentBinding: DialogAttachmentBinding
init {
NextcloudTalkApplication.sharedApplication?.componentApplication?.inject(this)
}
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
NextcloudTalkApplication.sharedApplication?.componentApplication?.inject(this)
dialogAttachmentBinding = DialogAttachmentBinding.inflate(layoutInflater) dialogAttachmentBinding = DialogAttachmentBinding.inflate(layoutInflater)
setContentView(dialogAttachmentBinding.root) setContentView(dialogAttachmentBinding.root)
window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)

View file

@ -47,12 +47,10 @@ class AudioOutputDialog(val callActivity: CallActivity) : BottomSheetDialog(call
private lateinit var dialogAudioOutputBinding: DialogAudioOutputBinding private lateinit var dialogAudioOutputBinding: DialogAudioOutputBinding
init {
NextcloudTalkApplication.sharedApplication?.componentApplication?.inject(this)
}
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
NextcloudTalkApplication.sharedApplication?.componentApplication?.inject(this)
dialogAudioOutputBinding = DialogAudioOutputBinding.inflate(layoutInflater) dialogAudioOutputBinding = DialogAudioOutputBinding.inflate(layoutInflater)
setContentView(dialogAudioOutputBinding.root) setContentView(dialogAudioOutputBinding.root)
window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)

View file

@ -51,12 +51,10 @@ class ContactsBottomDialog(
private lateinit var binding: DialogBottomContactsBinding private lateinit var binding: DialogBottomContactsBinding
init {
NextcloudTalkApplication.sharedApplication?.componentApplication?.inject(this)
}
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
NextcloudTalkApplication.sharedApplication?.componentApplication?.inject(this)
binding = DialogBottomContactsBinding.inflate(layoutInflater) binding = DialogBottomContactsBinding.inflate(layoutInflater)
setContentView(binding.root) setContentView(binding.root)
window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)

View file

@ -89,12 +89,10 @@ class ConversationsListBottomDialog(
@Inject @Inject
lateinit var userManager: UserManager lateinit var userManager: UserManager
init {
NextcloudTalkApplication.sharedApplication?.componentApplication?.inject(this)
}
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
NextcloudTalkApplication.sharedApplication?.componentApplication?.inject(this)
binding = DialogConversationOperationsBinding.inflate(layoutInflater) binding = DialogConversationOperationsBinding.inflate(layoutInflater)
setContentView(binding.root) setContentView(binding.root)
window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)

View file

@ -75,12 +75,10 @@ class MessageActionsDialog(
private lateinit var popup: EmojiPopup private lateinit var popup: EmojiPopup
init {
NextcloudTalkApplication.sharedApplication?.componentApplication?.inject(this)
}
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
NextcloudTalkApplication.sharedApplication?.componentApplication?.inject(this)
dialogMessageActionsBinding = DialogMessageActionsBinding.inflate(layoutInflater) dialogMessageActionsBinding = DialogMessageActionsBinding.inflate(layoutInflater)
setContentView(dialogMessageActionsBinding.root) setContentView(dialogMessageActionsBinding.root)
window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)

View file

@ -50,12 +50,10 @@ class ScopeDialog(
private lateinit var dialogScopeBinding: DialogScopeBinding private lateinit var dialogScopeBinding: DialogScopeBinding
init {
NextcloudTalkApplication.sharedApplication?.componentApplication?.inject(this)
}
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
NextcloudTalkApplication.sharedApplication?.componentApplication?.inject(this)
dialogScopeBinding = DialogScopeBinding.inflate(layoutInflater) dialogScopeBinding = DialogScopeBinding.inflate(layoutInflater)
setContentView(dialogScopeBinding.root) setContentView(dialogScopeBinding.root)

View file

@ -81,12 +81,10 @@ class ShowReactionsDialog(
private val tagAll: String? = null private val tagAll: String? = null
init {
NextcloudTalkApplication.sharedApplication?.componentApplication?.inject(this)
}
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
NextcloudTalkApplication.sharedApplication?.componentApplication?.inject(this)
binding = DialogMessageReactionsBinding.inflate(layoutInflater) binding = DialogMessageReactionsBinding.inflate(layoutInflater)
setContentView(binding.root) setContentView(binding.root)
window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)