Merging stuff. Cleaning up code. The usual (#297)

* chore: merge core extension view

* fix: clean up a sloppy fix

* chore: merge name adapters

* fix: offset the indentation of example
This commit is contained in:
TwistedUmbrellaX 2024-03-27 18:45:01 -04:00 committed by GitHub
parent ff72f9dbdf
commit 7bcc01b94e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 259 additions and 272 deletions

View file

@ -50,22 +50,21 @@ class FeedFragment : Fragment() {
super.onViewCreated(view, savedInstanceState)
activity = requireActivity()
binding.listRecyclerView.adapter = adapter
binding.listRecyclerView.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
binding.listProgressBar.visibility = ViewGroup.VISIBLE
userId = arguments?.getInt("userId", -1)
activityId = arguments?.getInt("activityId", -1) ?: -1
if (userId == -1) userId = null
global = arguments?.getBoolean("global", false) ?: false
if (userId != null) {
binding.listRecyclerView.setBaseline((activity as ProfileActivity).navBar)
}else{
binding.listRecyclerView.setBaseline((activity as FeedActivity).navBar)
}
val navBar = if (userId != null)
(activity as ProfileActivity).navBar
else
(activity as FeedActivity).navBar
binding.listRecyclerView.setBaseline(navBar)
binding.listRecyclerView.adapter = adapter
binding.listRecyclerView.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
binding.listProgressBar.visibility = ViewGroup.VISIBLE
}
@SuppressLint("ClickableViewAccessibility")
@ -73,11 +72,11 @@ class FeedFragment : Fragment() {
super.onResume()
if (this::binding.isInitialized) {
binding.root.requestLayout()
if (userId != null) {
binding.listRecyclerView.setBaseline((activity as ProfileActivity).navBar)
}else{
binding.listRecyclerView.setBaseline((activity as FeedActivity).navBar)
}
val navBar = if (userId != null)
(activity as ProfileActivity).navBar
else
(activity as FeedActivity).navBar
binding.listRecyclerView.setBaseline(navBar)
if (!loadedFirstTime) {
activity.lifecycleScope.launch(Dispatchers.IO) {
val nulledId = if (activityId == -1) null else activityId