Skip to content

Commit

Permalink
Enable DialogRows and not TextRows
Browse files Browse the repository at this point in the history
Fixes #2767
  • Loading branch information
simonpoole committed Jan 20, 2025
1 parent f45ddc8 commit 6784279
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public void onDismiss() {
sensorManager.unregisterListener(compassListener, rotation);
}
TagFormFragment caller = (TagFormFragment) getParentFragment();
caller.enableTextRow(key);
caller.enableDialogRow(key);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public void disable() {
@Override
public void onDismiss() {
TagFormFragment caller = (TagFormFragment) getParentFragment();
caller.enableTextRow(key);
caller.enableDialogRow(key);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ private Map<String, String> addTagsToViews(@NonNull EditableLayout editableView,
Map<String, Map<String, String>> checkGroupKeyValues = new HashMap<>();
boolean groupingRequired = false;
LinkedHashMap<String, String> tagList = new LinkedHashMap<>(tags);

if (preset != null) {
Wrapper wrapper = new Wrapper(getContext());
PresetField previous = null;
Expand Down Expand Up @@ -1496,14 +1496,14 @@ void updateSingleValue(@NonNull final String key, @NonNull final String value) {
}

/**
* Enable a specific text row
* Enable a specific dialog row
*
* @param key the key of the row
*/
void enableTextRow(@NonNull final String key) {
void enableDialogRow(@NonNull final String key) {
iterateOverRows((View row) -> {
if (row instanceof TextRow && key.equals(((TextRow) row).getKey())) {
((TextRow) row).getValueView().setEnabled(true);
if (row instanceof DialogRow && key.equals(((DialogRow) row).getKey())) {
((DialogRow) row).getValueView().setEnabled(true);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
caller.updateSingleValue((String) layout.getTag(), ourValue);
});
builder.setNegativeButton(R.string.clear, (d, which) -> caller.updateSingleValue((String) layout.getTag(), ""));
builder.setNeutralButton(R.string.cancel, (d, which) -> caller.enableTextRow((String) layout.getTag()));
builder.setNeutralButton(R.string.cancel, (d, which) -> caller.enableDialogRow((String) layout.getTag()));

final AlertDialog dialog = builder.create();
layout.setTag(key);
Expand Down

0 comments on commit 6784279

Please sign in to comment.