Skip to content

Commit

Permalink
Document window: Back arrow finish activity, closes #1165, by @gsantner
Browse files Browse the repository at this point in the history
  • Loading branch information
gsantner committed Feb 28, 2021
1 parent e844d77 commit d7b2a13
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ protected int getLayoutResId() {
return R.layout.document__fragment__edit;
}

@SuppressLint("SetJavaScriptEnabled")
@SuppressLint({"SetJavaScriptEnabled", "WrongConstant"})
@Override
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
Expand Down Expand Up @@ -205,7 +205,9 @@ public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
}

// Do not need to send contents to accessibility
_hlEditor.setImportantForAccessibility(View.IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
_hlEditor.setImportantForAccessibility(View.IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS);
}
}

@Override
Expand Down Expand Up @@ -415,6 +417,12 @@ public boolean onOptionsItemSelected(final MenuItem item) {
}
return true;
}
case android.R.id.home: {
if (saveDocument() && getActivity() != null) {
getActivity().onBackPressed();
}
return true;
}
case R.id.action_share_image:
case R.id.action_share_pdf: {
if (saveDocument()) {
Expand Down

0 comments on commit d7b2a13

Please sign in to comment.