Coder Social home page Coder Social logo

hey about bottomsheetmenu HOT 9 CLOSED

kennyc1012 avatar kennyc1012 commented on July 29, 2024
hey

from bottomsheetmenu.

Comments (9)

Kennyc1012 avatar Kennyc1012 commented on July 29, 2024

Add a BottomShretListener to the dialog and use the onSheetItemSelected to handle the different items

from bottomsheetmenu.

tomridder avatar tomridder commented on July 29, 2024
            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.

Kennyc1012 avatar Kennyc1012 commented on July 29, 2024

You'll need to set the listener for every dialog you have created. See the sample app for an example

from bottomsheetmenu.

tomridder avatar tomridder commented on July 29, 2024

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.

tomridder avatar tomridder commented on July 29, 2024

this is my email [email protected]

from bottomsheetmenu.

Kennyc1012 avatar Kennyc1012 commented on July 29, 2024

https://github.com/Kennyc1012/BottomSheet/blob/master/sample/src/main/java/com/kennyc/bottomsheetsample/MainActivity.java

from bottomsheetmenu.

tomridder avatar tomridder commented on July 29, 2024

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.

tomridder avatar tomridder commented on July 29, 2024

my code is right ,thanks for talking with me

from bottomsheetmenu.

Kennyc1012 avatar Kennyc1012 commented on July 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.