MaterialArcMenu icon indicating copy to clipboard operation
MaterialArcMenu copied to clipboard

Close Menu

Open tellfa opened this issue 9 years ago • 11 comments
trafficstars

Hi, thanks for this library i want close menu with touch to another sides. how to work it?

tellfa avatar Dec 23 '15 08:12 tellfa

Hi.

You mean when you click outside the menu area? You can hook up a OnClickListener on your layout and use the isMenuOpened() API to check the state of the menu. If the menu is opened, you can use the toggleMenu() API to close it. Should work for your case if I understand it correctly?

saurabharora90 avatar Dec 23 '15 09:12 saurabharora90

Thank you very much for your quick response <3 can you send me code? please, i really need this library and code. i'm Amateur :( . please help . thanks you my dear firend

tellfa avatar Dec 23 '15 09:12 tellfa

Can you post your layout (xml file), where you are using the library? I should be able to expand on that and help you out

saurabharora90 avatar Dec 23 '15 09:12 saurabharora90

thank you man <3 attached xml file in .txt file ArcMenu.txt

tellfa avatar Dec 23 '15 09:12 tellfa

can you send me code my friend?

tellfa avatar Dec 23 '15 09:12 tellfa

i'm sorry that your time. i use this code :

    RelativeLayout r = (RelativeLayout) view.findViewById(R.id.r1);
    r.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            ArcMenu te = (ArcMenu) view.findViewById(R.id.arcMenu);
            if (te.isMenuOpened()== true){
                te.toggleMenu();
            }
        }
    });

but it Does not work me! how to fix it?

tellfa avatar Dec 23 '15 09:12 tellfa

change to this : public void onClick(View view) { ArcMenu te = (ArcMenu) view.findViewById(R.id.arcMenu); if (te.isMenuOpened()){ te.toggleMenu(); }

but dose not work :(

tellfa avatar Dec 23 '15 09:12 tellfa

I am still confused. You have a recycler view. Is that populated with data? And do you have some Click events attached to it, coz the the click event won't be bubbled to the parent if the child is handling it.

saurabharora90 avatar Dec 23 '15 10:12 saurabharora90

i added this code to my adapter (RecyclerView Adapter) but show me FC error :cry: my code in adapter : v.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent motionEvent) {

                if (arcMenu.isMenuOpened()){
                    arcMenu.toggleMenu();
                }

                return true;
            }
        });

FC error : error

please help me :cry: please

tellfa avatar Dec 28 '15 06:12 tellfa

hay @saurabharora90 , can you help me?

tellfa avatar Dec 30 '15 06:12 tellfa

This looks the arcMenu variable wasn't initialized. It isn't being thrown by the library. Really difficult to comment without actual code.

saurabharora90 avatar Dec 30 '15 06:12 saurabharora90