Customise context menu like pinterest menu

后端 未结 4 1420
说谎
说谎 2021-02-02 03:15

I\'ve been looking for something like Pinterest menu whenever item in GridView is pressed. I know it\'s too broad question. But little strike on question will provi

4条回答
  •  名媛妹妹
    2021-02-02 03:44

    You can check out this library which I created:

    https://github.com/reyanshmishra/PinMenu

    You can clone it and import it as a module to your app and do something like this:

    In your XML layout:

    
    
    
    
    
        
    
    
    
        
    
    
        
    
    
    
    

    Now in Java:

    PinDialog mPinDialog = new PinDialog(this);
            mPinDialog.setContentView(R.layout.layout_pin_menu);
               mPinDialog.setPinSelectListener(new PinSelectListener() {
                        @Override
                        public void pinSelected(PinMenu pinMenu) {
                            Toast.makeText(mContext, "" + pinMenu.getPinName(), Toast.LENGTH_SHORT).show();
                        }
                    });
    
            mPinDialog.addToRecyclerView(mRecyclerView);
    

    It's still under development so it just supports recyclerview. For depth of the implementation, you can just skim through the classes of the library. I don't think I can put all the code here.

    The result it something like this:

提交回复
热议问题