How to avoid the new in-app purchase bottom sheet from pushing up entire app
Asked Answered
G

1

6

In recent Android update, Google has changed their in-app purchase UI.

We use

// BillingClient mBillingClient;
mBillingClient.launchBillingFlow

to launch in-app purchase flow.

Previously, when we launch their in-app purchase flow, a dialog is displayed at the center of screen.

Now, for recent Android update, Google has changed the in-app purchase flow, to show a bottom sheet.

However, this creates and undesired behavior. When bottom sheet is shown,

  1. Top status bar will be hide
  2. Since top status bar is hide, there will be an extra space. As a result, my app is being pushed up. This creates an unpleasant user experience.

Please see the screenshots.

Before showing in-app purchase bottom sheet

enter image description here


After showing in-app purchase bottom sheet. The app is "pushed up". Status bar is gone

enter image description here


Any idea how we can avoid the new in-app purchase bottom sheet from pushing up entire app?

Goldthread answered 24/9, 2018 at 20:19 Comment(1)
GooglePlay app does this somehow. So it must be possible.Spalato
G
0

Here's my solution for the above issues.

<style name="Theme.JStock.FitSystemWindows.Light" parent="@style/Theme.JStock.Base.Light">
    <item name="android:fitsSystemWindows">true</item>
</style>

The key is to apply android:fitsSystemWindows as true.

Goldthread answered 29/10, 2018 at 21:18 Comment(2)
This did not help. For one, it left the status bar intact but still hid all its icons, leaving the bar empty. And second, it pushed the app's layout upwards by a few pixels, by default, even without having opened the in-app bottom sheet yet.Temikatemp
where to apply this style ??Bureaucrat

© 2022 - 2024 — McMap. All rights reserved.