Skip to content

feat(android): present pageSheet/formSheet as a partial custom tab (bottom sheet)#166

Open
puckey wants to merge 1 commit into
patrickkabwe:mainfrom
puckey:android-partial-custom-tab
Open

feat(android): present pageSheet/formSheet as a partial custom tab (bottom sheet)#166
puckey wants to merge 1 commit into
patrickkabwe:mainfrom
puckey:android-partial-custom-tab

Conversation

@puckey

@puckey puckey commented Jun 17, 2026

Copy link
Copy Markdown

On Android, presentationStyle was ignored — the in-app browser always opened full-screen. This maps pageSheet/formSheet to a partial custom tab (bottom sheet), matching iOS. fullScreen/unset stay full-screen.

In NitroInAppBrowserImpl.kt:

  • Read presentationStyle and set the sheet height via setInitialActivityHeightPx (display height minus a fixed top gap), with a rounded toolbar; draggable to full.
  • Launch via startActivityForResult — Chrome ignores partial-tab sizing when launched with launchUrl().

Summary by CodeRabbit

  • New Features

    • Added support for sheet presentation styles (PAGESHEET/FORMSHEET) in the in-app browser with configurable initial height and toolbar corner radius settings.
  • Enhancements

    • Improved activity result handling for in-app browser launches.

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@puckey, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 53 minutes and 54 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 073379f2-103d-46ef-9fe5-97c7410cb4a5

📥 Commits

Reviewing files that changed from the base of the PR and between 8e12b52 and 829360c.

📒 Files selected for processing (1)
  • android/src/main/java/com/nitroinappbrowser/NitroInAppBrowserImpl.kt
📝 Walkthrough

Walkthrough

NitroInAppBrowserImpl.kt is updated to support PAGESHEET and FORMSHEET presentation styles on Android. The open() method now branches on presentationStyle to configure CustomTabsIntent with a calculated sheet height and toolbar corner radius, and the Chrome launch mechanism switches from intent.launchUrl(...) to currentActivity.startActivityForResult(...). Three companion-object constants are added for the geometry and request code values.

Changes

Android Sheet Presentation Style and Launch Rework

Layer / File(s) Summary
Import and companion-object constants
android/src/main/java/com/nitroinappbrowser/NitroInAppBrowserImpl.kt
Adds the NitroInAppBrowserPresentationStyle import and three companion-object constants (TOP_GAP_DP, IN_APP_BROWSER_REQUEST_CODE, TOOLBAR_CORNER_RADIUS_DP) used by the sheet sizing and startActivityForResult call.
open() presentation-style branching and launch rework
android/src/main/java/com/nitroinappbrowser/NitroInAppBrowserImpl.kt
open() resolves currentActivity up front, branches on PAGESHEET/FORMSHEET to set adjustable sheet height and toolbar corner radius via CustomTabsIntent, then replaces intent.launchUrl(...) with startActivityForResult(intent, IN_APP_BROWSER_REQUEST_CODE); conditional Chrome package selection is retained.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 A rabbit hops to open tabs with flair,
Sheets and forms now float high in the air,
startActivityForResult takes the lead,
Top-gap and corner radius—just what we need,
Chrome opens smoothly with constants in tow,
The in-app browser puts on quite a show! 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding support for pageSheet/formSheet presentation styles as partial custom tabs (bottom sheets) on Android.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…ottom sheet)

Android ignored presentationStyle and always opened full-screen. Map pageSheet/formSheet to a partial custom tab via setInitialActivityHeightPx (display height minus a fixed top gap), with a rounded toolbar, draggable to full; fullScreen and unset stay full-screen.

Launch via startActivityForResult: Chrome only honors the partial-tab height when launched this way (or with a bound CustomTabsSession); launchUrl() silently opens full-screen regardless of the requested height.
@puckey puckey force-pushed the android-partial-custom-tab branch from 8e12b52 to 829360c Compare June 17, 2026 12:45
@patrickkabwe

Copy link
Copy Markdown
Owner

hey @puckey thanks for the opening this PR could you please attach a before and after screen shot of this implementation

@puckey

puckey commented Jun 18, 2026

Copy link
Copy Markdown
Author

Before:
screenshot-20260618-114425

After:
screenshot-20260618-114116

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants