fix: Collect the server capabilities in SFragment subclasses (#252)
Not all subclasses were calling `super.onViewCreated()` so collecting the server capability wasn't happening consistently. Fix this, and add a `@CallSuper` annotation to prevent the problem from recurring.
This commit is contained in:
parent
1c6c8a7455
commit
09dc830c86
|
@ -99,6 +99,7 @@ class ConversationsFragment :
|
|||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
requireActivity().addMenuProvider(this, viewLifecycleOwner, Lifecycle.State.RESUMED)
|
||||
|
||||
viewLifecycleOwner.lifecycleScope.launch {
|
||||
|
|
|
@ -178,6 +178,7 @@ class TimelineFragment :
|
|||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
requireActivity().addMenuProvider(this, viewLifecycleOwner, Lifecycle.State.RESUMED)
|
||||
|
||||
layoutManager = LinearLayoutManager(context)
|
||||
|
|
|
@ -103,6 +103,7 @@ class ViewThreadFragment :
|
|||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
requireActivity().addMenuProvider(this, viewLifecycleOwner, Lifecycle.State.RESUMED)
|
||||
|
||||
binding.swipeRefreshLayout.setOnRefreshListener(this)
|
||||
|
|
|
@ -30,6 +30,7 @@ import android.os.Environment
|
|||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.annotation.CallSuper
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.appcompat.widget.PopupMenu
|
||||
import androidx.core.app.ActivityOptionsCompat
|
||||
|
@ -109,6 +110,7 @@ abstract class SFragment : Fragment() {
|
|||
}
|
||||
}
|
||||
|
||||
@CallSuper
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
|
|
Loading…
Reference in New Issue