Skip to content

Commit

Permalink
[android] Support full-screen on Cobalt.apk (#4327)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
borongc authored Oct 31, 2024
1 parent 37e466f commit dab82e0
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit dab82e0

Please sign in to comment.