Prepared and tested with Android Studio and Java (2018-04-03)
Table of contents
Project description
With this application we can practise very basic modal dialogs.
Requirements:
- There are five buttons on the main screen
- Simple
- Simple list
- List with radio
- List with checkboxes
- Custom
- When Simple is pressed a simple modal dialog, with
- a title,
- a message,
- three buttons: Yes, No and Cancel
should be displayed. When Yes, No or Cancel is pressed a Toast with message identifying the pressed button should be displayed.
- When Simple list is pressed a modal dialog with a simple list should be displayed.
- When List with radio is pressed a modal dialog with a radio button elements should be displayed.
- When List with checkboxes is pressed a modal dialog with a checkbox elements should be displayed.
- When Custom is pressed a custom modal dialog with a custom layout should be displayed.
All the information needed to complete this project can be found in Materials section.
How it should work
- When started a main view (activity) should be visible with a set of buttons defined in requirements (Project description section)
- Press Simple button. A simple modal dialog, with a title, a message, three buttons should be displayed
- When Yes, No or Cancel is pressed a dialog should be closed and a Toast with message identifying the pressed button should be displayed.
- Press Simple list button. A modal dialog with a simple list should be displayed
- When list item is selcted a dialog should be closed and a Toast with message identifying the list item should be displayed.
- Press List with radio button. A modal dialog with a radio button elements should be displayed
- When a modal dialog with a radio button elements is displeyed, some buttons should be selected by default.
- Every time we check/uncheck a radio button a Toast should be displayed (see List with checkboxes description below).
- Press List with checkboxes button. A modal dialog with a checkbox elements should be displayed
- When a modal dialog with a checkbox elements is displeyed, some buttons should be selected by default.
- Every time we check/uncheck a checkbox a Toast should be displayed.
- Press Custom button. A custom modal dialog with a custom layout should be displayed
- When an accept button (Yes) is pressed a Toast should be displayed
Source code
For this project the following files were created Complete project
Materials