fix: Stop crash in FollowedTagsActivity when view is not created (#586)

This commit is contained in:
Nik Clayton 2024-04-02 17:51:46 +02:00 committed by GitHub
parent 4ea42f4a2c
commit 0829d91989
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 2 deletions

View File

@ -45,8 +45,6 @@ class FollowedTagsActivity :
private val binding by viewBinding(ActivityFollowedTagsBinding::inflate) private val binding by viewBinding(ActivityFollowedTagsBinding::inflate)
private val viewModel: FollowedTagsViewModel by viewModels() private val viewModel: FollowedTagsViewModel by viewModels()
private val actionButtonScrollListener = ActionButtonScrollListener(binding.fab)
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
@ -76,6 +74,7 @@ class FollowedTagsActivity :
binding.includedToolbar.appbar.setLiftOnScrollTargetView(binding.followedTagsView) binding.includedToolbar.appbar.setLiftOnScrollTargetView(binding.followedTagsView)
val actionButtonScrollListener = ActionButtonScrollListener(binding.fab)
binding.followedTagsView.addOnScrollListener(actionButtonScrollListener) binding.followedTagsView.addOnScrollListener(actionButtonScrollListener)
lifecycleScope.launch { lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.RESUMED) { repeatOnLifecycle(Lifecycle.State.RESUMED) {