mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-18 14:03:58 +00:00
fixed scroll to top in offline mode (#149)
* fixed small bugs * fixed scroll to top in offline mode
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 }
|
||||
|
||||
@@ -283,6 +283,7 @@
|
||||
android:layout_gravity="start"
|
||||
android:layout_margin="16dp"
|
||||
android:translationZ="7dp"
|
||||
android:visibility="gone"
|
||||
app:cardBackgroundColor="@color/nav_bg"
|
||||
app:cardCornerRadius="16dp">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user