Comments (9)
Add a BottomShretListener to the dialog and use the onSheetItemSelected to handle the different items
from bottomsheetmenu.
BottomSheetListener bsl=new BottomSheetListener()
{
@Override
public void onSheetShown(@NonNull BottomSheet bottomSheet, @Nullable Object o)
{
}
@Override
public void onSheetItemSelected(@NonNull BottomSheet bottomSheet, MenuItem menuItem, @Nullable Object o)
{
Toast.makeText(ShowNote.this,"onSheetItemSelected",Toast.LENGTH_SHORT).show();
if(menuItem.getTitle().equals("wechat"))
{
Toast.makeText(ShowNote.this,"wechat",Toast.LENGTH_SHORT).show();
}
if(menuItem.getTitle().equals("qq"))
{
Toast.makeText(ShowNote.this,"qq",Toast.LENGTH_SHORT).show();
}
if(menuItem.getTitle().equals("friendCycle"))
{
Toast.makeText(ShowNote.this,"friendCycle",Toast.LENGTH_SHORT).show();
}
}
that's what i am doing right now,is that correct to setListener for each Item??
from bottomsheetmenu.
You'll need to set the listener for every dialog you have created. See the sample app for an example
from bottomsheetmenu.
well ,can u copy this part of code for me ?i have seen your source code,but i didn't find that part...
from bottomsheetmenu.
this is my email [email protected]
from bottomsheetmenu.
from bottomsheetmenu.
well,there's only two lines of code for that
@OverRide
public void onSheetItemSelected(@nonnull BottomSheet bottomSheet, MenuItem item, @nullable Object object) {
Toast.makeText(getApplicationContext(), item.getTitle() + " Clicked", Toast.LENGTH_SHORT).show();
}
but i want to see the detail of setListener for each Item
from bottomsheetmenu.
my code is right ,thanks for talking with me
from bottomsheetmenu.
I'm not sure what you are asking or trying to achieve. If you want to receive a call back when an item is selected from the sheet you set a listener and handle the MenuItem in the onSheetItemSelected callback
from bottomsheetmenu.
Related Issues (20)
- Set click listener for customview buttons HOT 2
- Bottom sheet with lot of content will cover whole screen? HOT 2
- Unable to set background for custom view HOT 2
- The exit animation often blocked when press the back button. HOT 2
- Open keyboard on custom layout with edittext HOT 1
- BottomSheet not anchoring to bottom of screen HOT 2
- Failed to resolve HOT 1
- There is a problem HOT 1
- how to show menu in State_Expanded when bottom sheet is shown in landscape mode? HOT 2
- Error when building project "bottom_sheet_list_item_color_dark not found HOT 1
- Impossible to change font size? HOT 1
- MinSdk 19 is required HOT 1
- Crash on rotation
- More than one file was found with OS independent path 'META-INF/library_release.kotlin_module'.
- Crash On Rotation
- QUERY_ALL_PACKAGES permission HOT 4
- Crash when app goes to background HOT 1
- How to hide item menu
- Top padding remains visible after we define empty title HOT 1
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 bottomsheetmenu.