mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-09 05:25:08 +01:00
More ui fixes to recents, bottom nav padding
This commit is contained in:
parent
7d9c77f021
commit
dc0435c363
@ -13,6 +13,7 @@ import eu.kanade.tachiyomi.data.download.model.Download
|
||||
import eu.kanade.tachiyomi.databinding.DownloadBottomSheetBinding
|
||||
import eu.kanade.tachiyomi.ui.extension.ExtensionDividerItemDecoration
|
||||
import eu.kanade.tachiyomi.ui.recents.RecentsController
|
||||
import eu.kanade.tachiyomi.util.view.activityBinding
|
||||
import eu.kanade.tachiyomi.util.view.collapse
|
||||
import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets
|
||||
import eu.kanade.tachiyomi.util.view.expand
|
||||
@ -72,7 +73,9 @@ class DownloadBottomSheet @JvmOverloads constructor(
|
||||
array.recycle()
|
||||
binding.recyclerLayout.doOnApplyWindowInsets { v, windowInsets, _ ->
|
||||
v.updateLayoutParams<MarginLayoutParams> {
|
||||
topMargin = windowInsets.systemWindowInsetTop + headerHeight - binding.sheetLayout.height
|
||||
topMargin = windowInsets.systemWindowInsetTop +
|
||||
(controller.activityBinding?.toolbar?.height ?: headerHeight) -
|
||||
binding.sheetLayout.height
|
||||
}
|
||||
}
|
||||
binding.sheetLayout.setOnClickListener {
|
||||
|
@ -806,6 +806,7 @@ class LibraryController(
|
||||
override fun onActivityResumed(activity: Activity) {
|
||||
super.onActivityResumed(activity)
|
||||
if (view == null) return
|
||||
updateFilterSheetY()
|
||||
if (observeLater && ::presenter.isInitialized) {
|
||||
presenter.getLibrary()
|
||||
}
|
||||
|
@ -109,6 +109,7 @@ open class MainActivity : BaseActivity<MainActivityBinding>(), DownloadServiceLi
|
||||
|
||||
private val updateChecker by lazy { UpdateChecker.getUpdateChecker() }
|
||||
private val isUpdaterEnabled = BuildConfig.INCLUDE_UPDATER
|
||||
var tabAnimation: ValueAnimator? = null
|
||||
|
||||
fun setUndoSnackBar(snackBar: Snackbar?, extraViewToCheck: View? = null) {
|
||||
this.snackBar = snackBar
|
||||
@ -669,19 +670,20 @@ open class MainActivity : BaseActivity<MainActivityBinding>(), DownloadServiceLi
|
||||
}
|
||||
|
||||
fun showTabBar(show: Boolean, animate: Boolean = true) {
|
||||
tabAnimation?.cancel()
|
||||
if (animate) {
|
||||
if (show && !binding.tabsFrameLayout.isVisible) {
|
||||
binding.tabsFrameLayout.alpha = 0f
|
||||
binding.tabsFrameLayout.isVisible = true
|
||||
}
|
||||
val alphaAnimation = ValueAnimator.ofFloat(
|
||||
tabAnimation = ValueAnimator.ofFloat(
|
||||
binding.tabsFrameLayout.alpha,
|
||||
if (show) 1f else 0f
|
||||
)
|
||||
alphaAnimation.addUpdateListener { valueAnimator ->
|
||||
tabAnimation?.addUpdateListener { valueAnimator ->
|
||||
binding.tabsFrameLayout.alpha = valueAnimator.animatedValue as Float
|
||||
}
|
||||
alphaAnimation.addListener(
|
||||
tabAnimation?.addListener(
|
||||
EndAnimatorListener {
|
||||
binding.tabsFrameLayout.isVisible = show
|
||||
if (!show) {
|
||||
@ -690,8 +692,8 @@ open class MainActivity : BaseActivity<MainActivityBinding>(), DownloadServiceLi
|
||||
}
|
||||
}
|
||||
)
|
||||
alphaAnimation.duration = 200
|
||||
alphaAnimation.start()
|
||||
tabAnimation?.duration = 200
|
||||
tabAnimation?.start()
|
||||
} else {
|
||||
binding.tabsFrameLayout.isVisible = show
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ class RecentsController(bundle: Bundle? = null) :
|
||||
afterInsets = {
|
||||
headerHeight = it.systemWindowInsetTop + appBarHeight + 48.dpToPx
|
||||
binding.fakeAppBar.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||
height = it.systemWindowInsetTop + appBarHeight
|
||||
height = it.systemWindowInsetTop + (activityBinding?.toolbar?.height ?: appBarHeight)
|
||||
}
|
||||
binding.recycler.updatePaddingRelative(
|
||||
bottom = activityBinding?.bottomNav?.height ?: 0
|
||||
@ -168,8 +168,13 @@ class RecentsController(bundle: Bundle? = null) :
|
||||
binding.downloadBottomSheet.dlRecycler.updatePaddingRelative(
|
||||
bottom = activityBinding?.bottomNav?.height ?: 0
|
||||
)
|
||||
activityBinding?.tabsFrameLayout?.isVisible =
|
||||
!binding.downloadBottomSheet.root.sheetBehavior.isExpanded()
|
||||
val isExpanded = binding.downloadBottomSheet.root.sheetBehavior.isExpanded()
|
||||
activityBinding?.tabsFrameLayout?.isVisible = !isExpanded
|
||||
if (isExpanded) {
|
||||
(activity as? MainActivity)?.showTabBar(show = false, animate = false)
|
||||
}
|
||||
binding.shadow2.alpha = if (!isExpanded) 0.25f else 0f
|
||||
binding.shadow.alpha = if (!isExpanded) 0.5f else 0f
|
||||
binding.fakeAppBar.alpha =
|
||||
if (binding.downloadBottomSheet.root.sheetBehavior.isExpanded()) 1f else 0f
|
||||
}
|
||||
@ -340,6 +345,7 @@ class RecentsController(bundle: Bundle? = null) :
|
||||
super.onActivityResumed(activity)
|
||||
if (view != null) {
|
||||
refresh()
|
||||
setBottomPadding()
|
||||
binding.downloadBottomSheet.dlBottomSheet.update()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user