gowong / material-sheet-fab

Android library that provides the floating action button to sheet transition from Google's Material Design.
MIT License
1.58k stars 255 forks source link

Disable hiding sheet when touching the overlay #11

Closed MohsenShafiee closed 9 years ago

MohsenShafiee commented 9 years ago

when I touch outside the sheet, it hides the sheet! how to hidesheet(); just forexample by a sheetItem click?

gowong commented 9 years ago

Are you looking to hide the sheet when clicking an item in the sheet? If so, the sample app already does this so you can take a look at that.

MohsenShafiee commented 9 years ago

ok I see that... my problem is something else! how to cancel hidesheet when clicking outside the sheet? I mean I want the fab sheet stay when I click somewhere else in touchscreen...

gowong commented 9 years ago

After creating the MaterialSheetFab:

new MaterialSheetFab<>(fab, sheetView, overlay, sheetColor, fabColor);

You can override the touch listener on the overlay and let the touch event bubble up:

overlay.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View view, MotionEvent motionEvent) {
                return false;
            }
        });

Let me know how that goes!