Professional Documents
Culture Documents
professional should be able to: duration. It does not block user from any other
interaction because it disappears on the screen
Use toast, snackbars and dialogs in notifying
depending on the selected duration. There are two
users with their interaction to the application
durations that can be used in toast. These are the
Appreciate the use of dependencies to create
user-friendly interfaces following:
Ex.
Toast.makeText(getApplicationContext,
Mobile applications are made to have an interaction “Welcome to your New Journey”, Toast.LENGTH_LONG)
between the user and the device. It can be a .show();
productivity application or a game. These
applications notify users of their engagement in the
application.
snackbar.setAction("GO",new View.OnClickListener() {
Like the snackbar, we will be using the material
@Override
design. After the implementation of the library, create
public void onClick(View view) {
a button for triggering the dialog. Use the code below
//Add code here for the function
for reference.
}
});
MaterialAlertDialogBuilder builder = new
MaterialAlertDialogBuilder(this);
builder.setTitle("Confirmation");
builder.setMessage
("Do you want to proceed with the changes?");
builder.setIcon(R.drawable.ic_baseline_help_center_2
4);
builder.setPositiveButton("YES", new
DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface
dialogInterface, int i) {
//add function here for OK
}
});
builder.setNegativeButton("NO", new
DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface
dialogInterface, int i) {
//add function here for NO
}
});
builder.show();
• We make use of different tools to notify the user
of the interactions made with the application. It
can be a Toast, Snackbar or an AlertDialog.