Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Custom Tab height doesn't change #442

Open
JuancaG05 opened this issue Sep 21, 2023 · 3 comments
Open

[BUG] Custom Tab height doesn't change #442

JuancaG05 opened this issue Sep 21, 2023 · 3 comments

Comments

@JuancaG05
Copy link

JuancaG05 commented Sep 21, 2023

Describe the bug
Related with this issue: #441.
After realising that I need to send as parameter a session or open the Custom tab via startActivityForResult to be able to have it in a bottom sheet (as it says in the docs, thanks @sebastianbenz), I could make it by using registerForActivityResult (which substitutes startActivityForResult, it's deprecated). Now that I have my Custom tab in a bottom sheet, I would like to customize its height, but I'm not able to, it always stays at the 50% of the screen height whatever number I pass as parameter to the setInitialActivityHeight method.
I tried modifying the number in PartialCustomTabActivity.java in the custom-tabs-example-app in this same repo, and the bug seems to be there too, the bottom sheet is always 50% of the screen. I also tried in several different devices.

To Reproduce
Steps to reproduce the behavior:

  1. Construct a new CustomTabsIntent.Builder indicating the desired height with setInitialActivityHeightPx().
  2. Get the CustomTabsIntent from the builder and set the desired Uri as intent.data.
  3. Launch the intent via a launcher created via registerForActivityResult.
  4. Custom tab is launched in a resizable bottom sheet but always with the same height (50% of the screen), no matter which valid number I pass in step 1.

Expected behavior
The Custom tab appears in a bottom sheet with the specified height.

Did this ever used to work
I couldn't make it work, neither in my project nor in the custom-tabs-example-app project of this repo.

Screenshots
No need screenshots here.

Code Snippets

private val customTabsLauncher =
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
    // ...
}

val customTabsBuilder = CustomTabsIntent.Builder().setInitialActivityHeightPx(500)
val customTabsIntent = customTabsBuilder.build()
customTabsIntent.intent.data = Uri.parse("www.example.com")
customTabsLauncher.launch(customTabsIntent.intent)

Smartphone (please complete the following information):

  • Device: Samsung Galaxy S9
  • OS: Android 9
  • Browsers Installed: Google Chrome
  • Browser Versions: 117.0.5938.60
  • android-browser-helper library version: 1.5.0

and

  • Device: Google Pixel 7
  • OS: Android 13
  • Browsers Installed: Google Chrome
  • Browser Versions: 117.0.5938.60
  • android-browser-helper library version: 1.5.0
@JuancaG05
Copy link
Author

Any news here? 👆

@DmitriyZakharich
Copy link

Hi. Have you found a solution?

@JuancaG05
Copy link
Author

Hi @DmitriyZakharich!

Nope, this was ignored since it was opened...

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

No branches or pull requests

2 participants