fixed scroll to top in offline mode (#149)

* fixed small bugs

* fixed scroll to top in offline mode
This commit is contained in:
aayush262 2024-01-22 02:53:23 +05:30 committed by GitHub
parent efb346d0a8
commit 25372d5251
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 4 additions and 3 deletions

View file

@ -276,7 +276,7 @@ class OfflineAnimeFragment : Fragment(), OfflineAnimeSearchListener {
}
scrollTop.setOnClickListener {
gridView.smoothScrollToPosition(0)
gridView.smoothScrollToPositionFromTop(0, 0)
}
// Assuming 'scrollTop' is a view that you want to hide/show

View file

@ -254,7 +254,7 @@ class OfflineMangaFragment : Fragment(), OfflineMangaSearchListener {
}
scrollTop.setOnClickListener {
gridView.smoothScrollToPosition(0)
gridView.smoothScrollToPositionFromTop(0, 0)
}
// Assuming 'scrollTop' is a view that you want to hide/show

View file

@ -60,7 +60,7 @@ class MediaInfoFragment : Fragment() {
@SuppressLint("SetJavaScriptEnabled")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
val model: MediaDetailsViewModel by activityViewModels()
val offline = requireContext().getSharedPreferences("Dantotsu", Context.MODE_PRIVATE).getBoolean("offlineMode", false)
val offline = requireContext().getSharedPreferences("Dantotsu", Context.MODE_PRIVATE).getBoolean("offlineMode", false) || isOnline(requireContext())
binding.mediaInfoProgressBar.visibility = if (!loaded) View.VISIBLE else View.GONE
binding.mediaInfoContainer.visibility = if (loaded) View.VISIBLE else View.GONE
binding.mediaInfoContainer.updateLayoutParams<ViewGroup.MarginLayoutParams> { bottomMargin += 128f.px + navBarHeight }