Custom Pop Up Menu in Tool Bar | In Sketchware || Add SourceDirectly

Hello guys welcome back to the blog.
So today in this blog I am going to show you how to make a Custom Pop Up Menu in Tool Bar | In Sketchware || Add SourceDirectly

So guys for making this Pop Up Menu we are going to use "Add SourceDirectly" block & the code is also given below. It's very easy simple just follow my step which are given in this blog & you can also prefer to my YouTube video also๐Ÿ‘‡


Let's get started:-

Step 1:- Open the "Sketchware" application & then add your project in it.


Step 2:- Now move to "Event" & then click on "on Create" option. And from "Operator" Drag the "Add Source Directly" block.

Step 3:- Now paste the code in it.

Download Project:-
http://sketchware.io/import.jsp?id=Gpr6

Code:-
}

@Override
public boolean onCreateOptionsMenu(Menu menu){

menu.add("About").setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);

menu.add("Privacy Policy").setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);

menu.add("Settings").setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);

menu.add("Exit").setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);

return true;
}

@Override 
public boolean onOptionsItemSelected(final MenuItem item) {
switch (item.getTitle().toString()) {

case "About":
_aboutClicked();
return true;

case "Privacy Policy":
_privacyClicked();
return true;

case "Settings":
_settimgsClicked();
return true;

case "Exit":
_exitClicked();
return true;

default:
return super.onOptionsItemSelected(item);
}


Step 4:- Then copy the following from the code. ( Shown in the image ๐Ÿ‘‡)

Step 5:- Now move to "More Block" & then add the more block by pasting the following which you have copied from the code one by one. (As shown in the image ๐Ÿ‘‡)


And after creating the more block add the work which you want to do with it.

And then "Run" you project.(It will lock like this๐Ÿ‘‡)

Thanks for visiting our Blog.

SHARE

Milan Tomic

Hi. I’m Designer of Blog Magic. I’m CEO/Founder of ThemeXpose. I’m Creative Art Director, Web Designer, UI/UX Designer, Interaction Designer, Industrial Designer, Web Developer, Business Enthusiast, StartUp Enthusiast, Speaker, Writer and Photographer. Inspired to make things looks better.

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment