From dab82e0d571d1596a79e88edb8497584fa4d8db1 Mon Sep 17 00:00:00 2001 From: Bo-Rong Chen Date: Thu, 31 Oct 2024 09:40:57 -0700 Subject: [PATCH] [android] Support full-screen on Cobalt.apk (#4327) This CL sets URL field to GONE to support full-screen video on ATV, as the layout of ContentShell.apk has a URL field. b/362837382 b/372324497 --- .../app/src/main/java/dev/cobalt/coat/CobaltActivity.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java index 40c07a13e2a..70e55cef175 100644 --- a/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java +++ b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java @@ -32,6 +32,7 @@ import android.view.ViewGroup.LayoutParams; import android.view.ViewParent; import android.widget.FrameLayout; +import android.widget.LinearLayout; import dev.cobalt.media.MediaCodecCapabilitiesLogger; import dev.cobalt.media.VideoSurfaceView; import dev.cobalt.util.DisplayUtil; @@ -185,6 +186,8 @@ private void finishInitialization(Bundle savedInstanceState) { shellUrl = savedInstanceState.getString(ACTIVE_SHELL_URL_KEY); } mShellManager.launchShell(shellUrl); + + toggleFullscreenMode(true); } // Initially copied from ContentShellActiviy.java @@ -245,6 +248,11 @@ protected void setStartupUrl(String url) { mStartupUrl = url; } + protected void toggleFullscreenMode(boolean enterFullscreen) { + LinearLayout toolBar = (LinearLayout) findViewById(R.id.toolbar); + toolBar.setVisibility(enterFullscreen ? View.GONE : View.VISIBLE); + } + // Initially copied from ContentShellActiviy.java @Override public void onActivityResult(int requestCode, int resultCode, Intent data) {