Custom dialog box in Sketchware using CustomView
The CustomView can be used to create a custom dialog box in Sketchware, by using simple codes. Follow the steps below to create a custom dialog pop-up. 1. In VIEW area of your project add a new CustomView . In the image above I have added a new CustomView 'cust.xml'. 2. Design the CustomView the way you want your custom dialog box to look like. In the image above, I have added an ImageView, two TextViews, and two Buttons (namely 'button1' and 'button2'). 3. Choose the event on which you want to show the dialog. It can be onBackPressed or onButtonClick, etc. 4. On the event when dialog is to be shown, use add source directly block to create and show the dialog box. In the image above I have added the code to onBackPressed event. The code used is explained below. a) First use the code to create a dialog. final AlertDialog dialog2 = new AlertDialog.Builder( MainActivity .this).create(); Note that here 'MainActivity' is the nam