public class EditBookmarkFolderDialog extends AppCompatDialogFragment {
// The public interface is used to send information back to the parent activity.
public interface EditBookmarkFolderListener {
public class EditBookmarkFolderDialog extends AppCompatDialogFragment {
// The public interface is used to send information back to the parent activity.
public interface EditBookmarkFolderListener {
@Override
public void onClick(DialogInterface dialog, int which) {
// Return the `DialogFragment` to the parent activity on save.
@Override
public void onClick(DialogInterface dialog, int which) {
// Return the `DialogFragment` to the parent activity on save.
// If the event is a key-down on the "enter" button, select the PositiveButton `Save`.
if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER) && editButton.isEnabled()) { // The enter key was pressed and the edit button is enabled.
// Trigger `editBookmarkListener` and return the DialogFragment to the parent activity.
// If the event is a key-down on the "enter" button, select the PositiveButton `Save`.
if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER) && editButton.isEnabled()) { // The enter key was pressed and the edit button is enabled.
// Trigger `editBookmarkListener` and return the DialogFragment to the parent activity.