Skip to content

Commit

Permalink
Fix error fragment not being shown
Browse files Browse the repository at this point in the history
Signed-off-by: enricocid <enrico2588@gmail.com>
  • Loading branch information
enricocid committed Mar 2, 2021
1 parent 5fffd14 commit d3b4e94
Showing 1 changed file with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,23 @@ class MainActivity : AppCompatActivity(), UIControlInterface, MediaControlInterf
}

private fun notifyError(errorType: String) {
mPlayerControlsPanelBinding.playerView.handleViewVisibility(false)
mMainActivityBinding.loadingProgressBar.handleViewVisibility(false)
mMainActivityBinding.viewPager2.handleViewVisibility(false)
if (sAllowCommit) {
supportFragmentManager.addFragment(
ErrorFragment.newInstance(errorType),
GoConstants.ERROR_FRAGMENT_TAG
)

mMainActivityBinding.mainView.animate().apply {
withStartAction {
mPlayerControlsPanelBinding.playerView.handleViewVisibility(false)
mMainActivityBinding.loadingProgressBar.handleViewVisibility(false)
mMainActivityBinding.viewPager2.handleViewVisibility(false)
}
duration = 250
alpha(1.0F)
withEndAction {
if (sAllowCommit) {
supportFragmentManager.addFragment(
ErrorFragment.newInstance(errorType),
GoConstants.ERROR_FRAGMENT_TAG
)
}
}
}
}

Expand Down

0 comments on commit d3b4e94

Please sign in to comment.