Describe the bug
Related with this issue: https://github.com/GoogleChrome/android-browser-helper/issues/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:
Construct a new CustomTabsIntent.Builder indicating the desired height with setInitialActivityHeightPx().
Get the CustomTabsIntent from the builder and set the desired Uri as intent.data.
Launch the intent via a launcher created via registerForActivityResult.
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):
Describe the bug Related with this issue: https://github.com/GoogleChrome/android-browser-helper/issues/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 usingregisterForActivityResult
(which substitutesstartActivityForResult
, 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 thesetInitialActivityHeight
method. I tried modifying the number inPartialCustomTabActivity.java
in thecustom-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:
CustomTabsIntent.Builder
indicating the desired height withsetInitialActivityHeightPx()
.CustomTabsIntent
from the builder and set the desired Uri asintent.data
.registerForActivityResult
.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
Smartphone (please complete the following information):
and