Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MaterialTimePicker] Does not respect isCancelable / setCancelable #2245

Closed
tinacious opened this issue Jun 10, 2021 · 0 comments
Closed

[MaterialTimePicker] Does not respect isCancelable / setCancelable #2245

tinacious opened this issue Jun 10, 2021 · 0 comments
Assignees
Labels

Comments

@tinacious
Copy link

Description: The MaterialTimePicker component does not respect the isCancelable property (setCancelable) in the following ways:

  • the cancel button is still visible
  • the dialog gets dismissed after pressing Cancel

Expected behavior: It is expected that the Cancel button not be visible so that cancel listeners would not be called and the dialog would not be dismissed.

Working around this bug adds complexity at the implementation side.

Source code:

Button cancelButton = root.findViewById(R.id.material_timepicker_cancel_button);
cancelButton.setOnClickListener(
new OnClickListener() {
@Override
public void onClick(View v) {
for (OnClickListener listener : negativeButtonListeners) {
listener.onClick(v);
}
dismiss();
}
});

Android API version: 8.1.0, 11

Material Library version: 1.3.0 (latest stable release)

Device: Nexus 5X, Pixel 4a

Thank you!

@tinacious tinacious added the bug label Jun 10, 2021
@drchen drchen self-assigned this Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants