Comments (3)
I solved it now like this:
bottomSheet.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_UP) {
bottomSheet.dismissSheet();
}
return false;
}
});
Works great for me and I'm still able to drag the Botttomsheet. I think the event is already handled somewhere in your onTouch/onDrag implementation and so the onClick doesn't receive anything.
from bottomsheet.
Can you provide more info? I'm not sure why you'd want to set an onClickListener on the sheet itself, it's meant to be a container with views in it. That could easily have unpredictable behavior by interfering with touches/dragging/etc. A sample I could try that exhibits this would help a lot.
from bottomsheet.
I'm just showing a single gif in the bottom sheet and want to dismiss it, as soon as a user taps anywhere on the screen.
from bottomsheet.
Related Issues (20)
- find crash
- BottomSheet appears in center of page
- Access Buttons in the Bottomsheet
- how to set different style for different status menu item in MenuSheet
- FloatingActionButton overlaps bottomsheet
- There is no way of knowing if the BottomSheet is dismissing HOT 2
- Efficiency vs Google's standard bottom? HOT 1
- Adding All Social Media
- Any scroll-down-picker won't work with bottom sheet
- Have problems with UnityPlayerActivity
- Rounded Corners HOT 1
- MenuSheetView icon
- Bug in height size after expanded list
- BottomSheetFragment expands by himself when I remove elements from the view.
- The width of the bottomsheet on the flat panel device can not occupy the pan
- Can't build project
- Bug: bottom sheet looks almost non-existing when on landscape HOT 1
- Dialog shadow is not appearing in front of status bar.
- java.lang.NullPointerException RecycyclerView
- XPopup is better! https://github.com/li-xiaojun/XPopup
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bottomsheet.