fix: data loading glitches (#284)
* fix: the obnoxious loading glitch * chore: some quick build warnings
This commit is contained in:
parent
dc21d28b83
commit
f704e322af
43 changed files with 117 additions and 109 deletions
|
@ -367,6 +367,16 @@ class MediaDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedLi
|
|||
navBar.addTab(infoTab)
|
||||
navBar.addTab(watchTab)
|
||||
navBar.addTab(commentTab)
|
||||
if (model.continueMedia == null && media.cameFromContinue) {
|
||||
model.continueMedia = PrefManager.getVal(PrefName.ContinueMedia)
|
||||
selected = 1
|
||||
}
|
||||
if (intent.getStringExtra("FRAGMENT_TO_LOAD") != null) selected = 2
|
||||
if (viewPager.currentItem != selected) viewPager.post {
|
||||
viewPager.setCurrentItem(selected, false)
|
||||
}
|
||||
binding.commentInputLayout.isVisible = selected == 2
|
||||
navBar.selectTabAt(selected)
|
||||
navBar.setOnTabSelectListener(object : AnimatedBottomBar.OnTabSelectListener {
|
||||
override fun onTabSelected(
|
||||
lastIndex: Int,
|
||||
|
@ -383,18 +393,6 @@ class MediaDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedLi
|
|||
}
|
||||
})
|
||||
|
||||
if (model.continueMedia == null && media.cameFromContinue) {
|
||||
model.continueMedia = PrefManager.getVal(PrefName.ContinueMedia)
|
||||
selected = 1
|
||||
}
|
||||
val frag = intent.getStringExtra("FRAGMENT_TO_LOAD")
|
||||
if (frag != null) {
|
||||
selected = 2
|
||||
}
|
||||
navBar.selectTabAt(selected)
|
||||
binding.commentInputLayout.isVisible = selected == 2
|
||||
viewPager.setCurrentItem(selected, false)
|
||||
|
||||
val live = Refresh.activity.getOrPut(this.hashCode()) { MutableLiveData(true) }
|
||||
live.observe(this) {
|
||||
if (it) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue