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

Bugfix - missing ok button in dialogs #1751

Merged
merged 1 commit into from
Jul 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,10 @@ public static void showMultiChoiceDialogWithSearchFilterUI(final Activity activi
// =========================================================================================

// Ok button only present under these circumstances
if (((dopt.callback != null && dopt.isSearchEnabled) || (dopt.positionCallback != null && dopt.isMultiSelectEnabled))) {
final boolean isSearchOk = dopt.callback != null && dopt.isSearchEnabled;
final boolean isMultiSelOk = dopt.positionCallback != null && dopt.isMultiSelectEnabled;
final boolean isPlainDialog = dopt.callback != null && (dopt.data == null || dopt.data.size() == 0);
Comment on lines +271 to +273
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar to the filemanager button calculations. very good improvement and to understand when reading it

if (isSearchOk || isMultiSelOk || isPlainDialog) {
dialogBuilder.setPositiveButton(dopt.okButtonText, (dialogInterface, i) -> {
final String searchText = dopt.isSearchEnabled ? searchEditText.getText().toString() : null;
if (dopt.positionCallback != null && !listAdapter._selectedItems.isEmpty()) {
Expand Down