material-components / material-components/material-components-android

[BottomSheet] Bottomsheet appears at top of screen when transitioning on 1.6

Open
#2,702 7 comments 1 reaction 1 assignee View on GitHub

Nobody has claimed this yet.

bug P2 Widget: BottomSheet
Dominant language
Java
Stars
17.4k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

**Description:**
When upgrading to 1.6 from 1.5 our bottom sheet started to appear at the top of the screen when transitioning to a different fragment inside.

https://user-images.githubusercontent.com/89166418/168380762-a03fc111-83df-48b5-a6dd-48f5e0bcff61.mov

**Expected behavior:**
Bottom sheet should stay at the bottom when transitioning.

**Source code:**
Our logic is fairly complicated so I'll try to link the relevant files. Maybe you can give us suggestions on fixes if it's our issue.

xml: https://github.com/stripe/stripe-android/blob/master/paymentsheet/res/layout/activity_payment_sheet.xml#L9
```

```

controller class: https://github.com/stripe/stripe-android/blob/master/paymentsheet/src/main/java/com/stripe/android/paymentsheet/BottomSheetController.kt

main bottom sheet activity: https://github.com/stripe/stripe-android/blob/master/paymentsheet/src/main/java/com/stripe/android/paymentsheet/ui/BaseSheetActivity.kt

**Minimal sample app repro:**
Our repository has a sample app called `paymentsheet-example`, I'm also happy to try and spend some more time creating a minimal sample repo. but I'm not quite sure what would cause this behavior so any guidance would help.

You'll need to change the value to 1.6 here: https://github.com/stripe/stripe-android/blob/master/build.gradle#L81

Once running you can click
1. Playground
2. Check returning customer
3. Reload paymentsheet
4. click the visa logo next to checkout custom
5. click add

observed the sheet is at the top of the screen. Occasionally I see weird states where it's partially showing like so:

**Android API version:** min api 21, repros on all versions I tried: 28,30,31

**Material Library version:** 1.6

**Device:** Pixel 3a, several emulators.

To help us triage faster, please check to make sure you are using the [latest version](https://github.com/material-components/material-components-android/releases) of the library.

We also happily accept [pull requests](https://github.com/material-components/material-components-android/pulls).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.