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

[Slider] Slider does not follow bottom sheet #4342

Open
michael-winkler opened this issue Oct 15, 2024 · 1 comment · May be fixed by #4346
Open

[Slider] Slider does not follow bottom sheet #4342

michael-winkler opened this issue Oct 15, 2024 · 1 comment · May be fixed by #4346

Comments

@michael-winkler
Copy link
Contributor

Description: If we place a Slider with visible Label, the label does not move up or down inside a bottom sheet dialog.

Expected behavior: It should follow the dialog.

Source code:
image

After bottom sheet goes down:
image

The label position is not following the sheet.

Minimal sample app repro: -

Android API version: All

Material Library version: 1.13.0-alpha06

Device: -

@manabu-nakamura
Copy link
Contributor

manabu-nakamura commented Oct 15, 2024

Workaround:

bottomSheetDialog.getBehavior().addBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
    @Override
    public void onStateChanged(@NonNull View bottomSheet, int newState) {
// lightweight
//        bottomSheet.setVisibility(View.GONE);
//        bottomSheet.setVisibility(View.VISIBLE);
//        or
//        slider.invalidate();
    }

    @Override
    public void onSlide(@NonNull View bottomSheet, float slideOffset) {
// smoother
        bottomSheet.setVisibility(View.GONE);
        bottomSheet.setVisibility(View.VISIBLE);
//        or
//        slider.invalidate();
    }
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants