Skip to content

Commit

Permalink
Reset preferredDisplayModeId back to zero when closing video player f…
Browse files Browse the repository at this point in the history
…ragment
  • Loading branch information
nielsvanvelzen committed Oct 13, 2023
1 parent f6a4560 commit 3f911f1
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.LinearLayout;
Expand Down Expand Up @@ -70,6 +71,7 @@
import org.jellyfin.androidtv.ui.presentation.PositionableListRowPresenter;
import org.jellyfin.androidtv.ui.shared.PaddedLineBackgroundSpan;
import org.jellyfin.androidtv.util.CoroutineUtils;
import org.jellyfin.androidtv.util.DeviceUtils;
import org.jellyfin.androidtv.util.ImageUtils;
import org.jellyfin.androidtv.util.InfoLayoutHelper;
import org.jellyfin.androidtv.util.TextUtilsKt;
Expand Down Expand Up @@ -765,6 +767,13 @@ public void onStop() {
Timber.d("this fragment belongs to the current session, ending it");
mPlaybackController.endPlayback();
}

// Reset display mode back to "no preference"
if (DeviceUtils.is60()) {
WindowManager.LayoutParams params = requireActivity().getWindow().getAttributes();
params.preferredDisplayModeId = 0;
requireActivity().getWindow().setAttributes(params);
}
}

public void show() {
Expand Down

0 comments on commit 3f911f1

Please sign in to comment.