Skip to content

Commit

Permalink
Enable full screen mode for 2D browsing
Browse files Browse the repository at this point in the history
  • Loading branch information
haanhvu committed Nov 16, 2024
1 parent 7ba206f commit 6f55ff8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,11 @@ public void onResize() {
enterResizeMode();
}

@Override
public void onFullScreen() {
mAttachedWindow.setIsFullScreen(true);
}

@Override
public void onPassthrough() {
mWidgetManager.togglePassthrough();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public interface MenuDelegate {
void onPageZoomIn();
void onPageZoomOut();
int getCurrentZoomLevel();
void onFullScreen();
}

public static final int SWITCH_ITEM_ID = 0;
Expand Down Expand Up @@ -189,6 +190,18 @@ private void updateItems() {

// In kiosk mode, only resize, find in page and passthrough are available.
if (!mWidgetManager.getFocusedWindow().isKioskMode()) {
mItems.add(new HamburgerMenuAdapter.MenuItem.Builder(
HamburgerMenuAdapter.MenuItem.TYPE_DEFAULT,
(menuItem) -> {
if (mDelegate != null) {
mDelegate.onFullScreen();
}
return null;
})
.withTitle("Fullscreen")
.withIcon(R.drawable.fullscreen_button)
.build());

final Session activeSession = SessionStore.get().getActiveSession();

if (!BuildConfig.FLAVOR_backend.equals("chromium")) {
Expand Down

0 comments on commit 6f55ff8

Please sign in to comment.