Don't fade in media preview controls if hidden.

This commit is contained in:
Nicholas 2022-11-15 11:07:13 -05:00 committed by Alex Hart
parent eb921f3103
commit fd37613f2f
2 changed files with 7 additions and 3 deletions

View file

@ -310,7 +310,7 @@ class MediaPreviewV2Fragment : Fragment(R.layout.fragment_media_preview_v2), Med
}
private fun crossfadeViewIn(view: View, duration: Long = 200) {
if (!view.isVisible) {
if (!view.isVisible && !fullscreenHelper.isSystemUiVisible) {
val viewPropertyAnimator = view.animate()
.alpha(1f)
.setDuration(duration)

View file

@ -143,14 +143,18 @@ public final class FullscreenHelper {
}
public void toggleUiVisibility() {
int systemUiVisibility = activity.getWindow().getDecorView().getSystemUiVisibility();
if ((systemUiVisibility & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0) {
if (isSystemUiVisible()) {
showSystemUI();
} else {
hideSystemUI();
}
}
public boolean isSystemUiVisible() {
int systemUiVisibility = activity.getWindow().getDecorView().getSystemUiVisibility();
return (systemUiVisibility & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0;
}
public void hideSystemUI() {
activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_IMMERSIVE |
View.SYSTEM_UI_FLAG_LAYOUT_STABLE |