Skip to content

Commit

Permalink
Reword Finish to Exit for read only forms
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham1g5 committed Sep 5, 2024
1 parent 833f92a commit 2c3634b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/assets/locales/android_translatable_strings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ form.entry.incomplete.save.success=Form saved as incomplete
form.entry.save.error=Sorry, form save failed. Please contact CommCare Support to look into the issue.
form.entry.save.invalid.unicode=Could not save '${0}' text in form.
form.entry.finish.button=FINISH
form.entry.exit.button=EXIT
form.entry.restart.after.expiration=You were logged out due to session expiration. The form you were in the middle of has been saved and resumed.

login.attempt.badcred=Username or password are incorrect. Please try again.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public class FormEntryActivityUIController implements CommCareActivityUIControll
private boolean formRelevanciesUpdateInProgress = false;

private static final String KEY_LAST_CHANGED_WIDGET = "index-of-last-changed-widget";
private TextView finishText;

enum AnimationType {
LEFT, RIGHT, FADE
Expand All @@ -103,7 +104,7 @@ public void setupUI() {

View finishButton = activity.findViewById(R.id.nav_btn_finish);

TextView finishText = finishButton.findViewById(R.id.nav_btn_finish_text);
finishText = finishButton.findViewById(R.id.nav_btn_finish_text);
finishText.setText(Localization.get("form.entry.finish.button").toUpperCase());

nextButton.setOnClickListener(v -> {
Expand Down Expand Up @@ -199,6 +200,10 @@ protected void refreshCurrentView(boolean animateLastView) {
QuestionsView current = createView();
showView(current, AnimationType.FADE, animateLastView);
}

if (FormEntryActivity.mFormController.isFormReadOnly()) {
finishText.setText(Localization.get("form.entry.exit.button").toUpperCase());
}
}

/**
Expand Down

0 comments on commit 2c3634b

Please sign in to comment.