Posts

Showing posts with the label Sketchware

Material Bottom Nevigetion Bar

Image
Linear Name fragment_frame Library com.google.android.material:material:1.5.0-beta01 Load Fragment Fragment fragment = new HomeFragmentActivity(); getSupportFragmentManager() .beginTransaction() .replace( R.id .fragment_frame, fragment) .commit();   styles.xml <?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppTheme" parent="Theme.Material3.DayNight.NoActionBar"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> <item name="colorControlHighlight">@color/colorControlHighlight</item> <item name="colorControlNormal">@color/colorControlNormal</item> </style> <style name="AppTheme.FullScreen" parent="AppTheme"> <item name="...

ShutCut Menu

Image
In order to Show ShutCut Menu When App Icon Long Pressed in your Sketchware project, use the codes provided below. Step 1 :- Take A Add Source Directly Block And Put The Following Code In It. android.content.pm.ShortcutManager shortcutManager = null; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) { shortcutManager = getSystemService(android.content.pm.ShortcutManager.class); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (shortcutManager != null) { This Code Will Give Promisson For Creating ShutCut Menu. Step 2 :- Again Take A Add Source Directly Block And Put The Following Code In It. android.content.pm.ShortcutInfo shutcut1 = new android.content.pm.ShortcutInfo.Builder(MainActivity.this, " Home" ) .setShortLabel(" Home ") .setLongLabel(" Home ") .setRank( 0 ) .setIntent(new android.content.Intent(android.content.Intent.ACTION_VIEW, null, MainActivity .this, MainActivity.class)...

Custom Pop-Up Menu

Image
Preview :- Download

Custom Swipe Icon

Image
In order to Change Swipe Loyaurt Icon in your Sketchware project, use the codes provided below. Change Swipe Icon Important Setting From Change Icon Of Swipe Are :- 1) Enble App Compat And Design 2) Enble Import Event 3) Create A String Variable Step-1  To Change Icon Take A Image From URL Block And Take A String Block. In String Block Paste Image URL. Step-2 Take A Add Source Directly Block And Paste The Following Code Given Below.

Dark Pop-Up Menu

Image
 In order to display a pop-up menu on button click or on ListView item click in your Sketchware project, use the codes provided below. PopupMenu on button click 1. To display a PopupMenu when a Button is clicked, in onButtonClick event, use add source directly block, and put following code in it: PopupMenu popup = new PopupMenu(getActionBar().getThemedContext(), button1); Menu menu = popup.getMenu(); menu.add("Delete"); menu.add("Show"); This code creates a PopupMenu for button1, with two options Delete and Show. The same code can be used for creating PopupMenu for ImageView, TextView or or any other widget by using their id in place of button1. 2.After This Add another add source directly block and put following code in it: popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener(){ @Override public boolean onMenuItemClick(MenuItem item){ switch (item.getTitle().toString()){ case "Delete": This code sets OnMenuItemClickListener f...

Pop-Up Menu

Image
In order to display a pop-up menu on button click or on ListView item click in your Sketchware project, use the codes provided below. PopupMenu on button click 1. To display a PopupMenu when a Button is clicked, in onButtonClick event, use add source directly block, and put following code in it: PopupMenu popup = new PopupMenu(MainActivity.this, button1); Menu menu = popup.getMenu(); menu.add("Delete"); menu.add("Show"); This code creates a PopupMenu for button1, with two options Delete and Show. The same code can be used for creating PopupMenu for ImageView, TextView or or any other widget by using their id in place of button1. 2.After This Add another add source directly block and put following code in it: popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener(){ @Override public boolean onMenuItemClick(MenuItem item){ switch (item.getTitle().toString()){ case "Delete": This code sets OnMenuItemClickListener for the PopupMenu....