New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 872833 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 26
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Feature



Sign in to add a comment

70% height for payment handler window on Android.

Project Member Reported by rouslan@chromium.org, Aug 9

Issue description

70% height for payment handler window on Android.
 
Here's what I've achieved thus far using the code in https://crrev.com/c/1169636.

Ted, Bernhard: Do you have suggestions on how to make the window translucent? Nothing I've tried so far worked for some reason.
Screenshot_20180809-143041.png
109 KB View Download
Cc: gogerald@chromium.org
You probably have to change the Activity theme to be translucent to start.
Thank you all for your help! Was able to achieve translucent activity, but probably should disable scrolling of the toolbar, because it does not look right. Hope it's possible!
Screenshot_20180823-184719.png
133 KB View Download
Screenshot_20180823-184746.png
148 KB View Download
Cc: peconn@chromium.org
Description: Show this description
For custom tabs, I think you just need to tweak the intent:
https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java?l=393

It supports disabling the controls being hidden.
Nice! Thank you.
Does anyone know why the FLAG_DIM_BEHIND dims only behind the activity in Android Pie, but also dims inside of the activity on Android Nougat?

This is chrome_public_apk in both cases.
pie.png
195 KB View Download
nougat.png
175 KB View Download
So it looks like it's dimming the web contents only of the CustomTabActivity. I'm not sure why this is happening - my guess would be because that part is put together by the compositor, and maybe the compositor gets dimmed in the background Activity?

That is unfortunate though. Can you do something like set the CustomTabActivity's background to something semi-transparent? That would achieve a similar effect (though maybe check the performance, I'm not sure if partially transparent takes more effort than fully transparent).
Dimming the background using a fullscreen semi-transparent dialog. Reuses the code in PaymentRequestUI.java, which is a fullscreen semi-transparent dialog with opaque content at the bottom of the dialog.
bottom-sheet-dimmed-bg.mp4
5.1 MB View Download
Project Member

Comment 12 by bugdroid1@chromium.org, Sep 26

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/548b91aebddb226d31ddf909b221dd29b803e0c9

commit 548b91aebddb226d31ddf909b221dd29b803e0c9
Author: Rouslan Solomakhin <rouslan@chromium.org>
Date: Wed Sep 26 19:23:31 2018

[Payment Handler][CCT] 70% height payment handler window.

Before this patch, Chrome Custom Tab would always be 100% height in all
cases, including for showing a Payment Handler page. This hid the shop
page from the user and increased the chance of the shop page renderer
being killed.

This patch adds a PaymentHandlerActivity that extends CustomTabActivity
with a custom theme that has transparent background. The
PaymentHandler-specific functionality is moved from CustomTabActivity
into the PaymentHandlerActivity. This activity is 70% of the display
height ("bottom sheet"), unless that's less than 500dp, in which case
the height is 500dp. If a device rotates, the window is either in bottom
sheet or fullscreen mode, depending on the amount of available vertical
space.

The underlying activity is dimmed by DimmingDialog, which is a
fullscreen semi-transparent dialog. This was refactored out of
PaymentRequestUI, which now uses the DimmingDialog and optionally adds
opaque content at the bottom.

After this patch, payment handlers are displayed in a bottom sheet with
dimmed background.

Bug:  872833 
Change-Id: I4c104373f3e44130d1217cbf2c6923be3b63d1a1
Reviewed-on: https://chromium-review.googlesource.com/1169636
Commit-Queue: Rouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: Peter Conn <peconn@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594424}
[modify] https://crrev.com/548b91aebddb226d31ddf909b221dd29b803e0c9/chrome/android/java/AndroidManifest.xml
[modify] https://crrev.com/548b91aebddb226d31ddf909b221dd29b803e0c9/chrome/android/java/res/values-v17/styles.xml
[modify] https://crrev.com/548b91aebddb226d31ddf909b221dd29b803e0c9/chrome/android/java/res/values/dimens.xml
[modify] https://crrev.com/548b91aebddb226d31ddf909b221dd29b803e0c9/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
[modify] https://crrev.com/548b91aebddb226d31ddf909b221dd29b803e0c9/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
[modify] https://crrev.com/548b91aebddb226d31ddf909b221dd29b803e0c9/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
[add] https://crrev.com/548b91aebddb226d31ddf909b221dd29b803e0c9/chrome/android/java/src/org/chromium/chrome/browser/customtabs/PaymentHandlerActivity.java
[modify] https://crrev.com/548b91aebddb226d31ddf909b221dd29b803e0c9/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
[add] https://crrev.com/548b91aebddb226d31ddf909b221dd29b803e0c9/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/DimmingDialog.java
[modify] https://crrev.com/548b91aebddb226d31ddf909b221dd29b803e0c9/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java
[modify] https://crrev.com/548b91aebddb226d31ddf909b221dd29b803e0c9/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUiErrorView.java
[modify] https://crrev.com/548b91aebddb226d31ddf909b221dd29b803e0c9/chrome/android/java_sources.gni

Status: Fixed (was: Assigned)
Summary: 70% height for payment handler window on Android. (was: 60% height for payment handler window on Android.)

Sign in to add a comment