Skip to content

Commit

Permalink
CATROID-1479 Test: testFunctionDeletion fails
Browse files Browse the repository at this point in the history
The test was failing because the back button in the formula editor was
not set active again after exiting the function menu. I fixed this
adding a call to set it active if necessary. Now the behaviour should be
as intended and the test passes.
  • Loading branch information
Robert committed Dec 12, 2022
1 parent fd58d68 commit 7cd6403
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,9 @@ private String updateTextAndCursorFromInternFormula() {
}

highlightSelection();
if (formulaEditorFragment != null) {
formulaEditorFragment.updateButtonsOnKeyboard();
}

return newExternFormulaString;
}
Expand Down Expand Up @@ -426,6 +429,9 @@ public FormulaEditorHistory getHistory() {
}

public boolean isThereSomethingToDelete() {
if (internFormula == null) {
return false;
}
return internFormula.isThereSomethingToDelete();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,10 @@ public void onHiddenChanged(boolean hidden) {

public void updateButtonsOnKeyboardAndInvalidateOptionsMenu() {
getActivity().invalidateOptionsMenu();
updateButtonsOnKeyboard();
}

public void updateButtonsOnKeyboard() {
ImageButton backspaceOnKeyboard = getActivity().findViewById(R.id.formula_editor_keyboard_delete);
if (!formulaEditorEditText.isThereSomethingToDelete()) {
backspaceOnKeyboard.setAlpha(255 / 3);
Expand Down

0 comments on commit 7cd6403

Please sign in to comment.