summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2021-03-31 14:32:32 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2021-03-31 20:08:18 +0200
commit1477401805e2a88cddb1df259456359398fa2b7d (patch)
tree08c57162dbe736166391512ebaff55a3c0aeba46 /android
parent4b8540911bc8fabee0729b31780a1ba8b4663121 (diff)
android: Don't require that user presses 'Back' twice to exit
Drop the "Press back again to quit" info shown when pressing "Back" in the file selection dialog in Android Viewer and just quit the app right away. It was originally added in commit d1f671e053864d0bf54d04a855761b43a7f5a9c4 Date: Wed Jun 10 19:04:22 2015 +0200 tdf#87434: android: system back key to go one level up Added an additional check so back has to be pressed twice on the root folder to actually leave the application. It's a check seen in many other apps. but I don't really see any need to bother the user about pressing "Back" again. Nothing is lost at this stage when quitting the app, and I haven't seen anything similar in many current apps myself (but have rather seen some extra confirmation dialogs disappear from desktop applications over the last years). The original request in tdf#87434 to go one level up in the directory hierarchy is unaffected by this, though this only applies for the custom widgets to browse the file system, which will potentially be dropped in the future anyway, now that support for the system file picker has been added in commit d678ee309b02b4cc8af29a097bf5053b8b1b4e06 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Fri Mar 19 14:29:36 2021 +0100 tdf#129833 android: Allow opening files using system file picker Change-Id: Ib324b7f0b82427b04c7708665ff7492a758eec9b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113413 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'android')
-rw-r--r--android/source/res/values-de/strings.xml1
-rw-r--r--android/source/res/values-tr/strings.xml1
-rw-r--r--android/source/res/values/strings.xml1
-rw-r--r--android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java19
4 files changed, 1 insertions, 21 deletions
diff --git a/android/source/res/values-de/strings.xml b/android/source/res/values-de/strings.xml
index 6828066524c9..53854e94929d 100644
--- a/android/source/res/values-de/strings.xml
+++ b/android/source/res/values-de/strings.xml
@@ -14,7 +14,6 @@
<string name="about_license">Lizenz anzeigen</string>
<string name="about_notice">Hinweise anzeigen</string>
<string name="about_moreinfo">Weitere Informationen</string>
- <string name="back_again_to_quit">Zum Beenden noch einmal \'zurück\' drücken</string>
<string name="new_textdocument">Neues Textdokument</string>
<string name="new_presentation">Neue Präsentation</string>
diff --git a/android/source/res/values-tr/strings.xml b/android/source/res/values-tr/strings.xml
index 357f441a8e86..494e0575d0d1 100644
--- a/android/source/res/values-tr/strings.xml
+++ b/android/source/res/values-tr/strings.xml
@@ -14,7 +14,6 @@
<string name="about_license">Lisansı Görüntüle</string>
<string name="about_notice">Bildiriyi Görüntüle</string>
<string name="about_moreinfo">Daha Fazla Bilgi</string>
- <string name="back_again_to_quit">Çıkış için geri tuşuna tekrar basınız.</string>
<string name="new_textdocument">Yeni Kelime İşlemci</string>
<string name="new_presentation">Yeni Sunum</string>
diff --git a/android/source/res/values/strings.xml b/android/source/res/values/strings.xml
index 5cd2c978cef5..ddb396555dfc 100644
--- a/android/source/res/values/strings.xml
+++ b/android/source/res/values/strings.xml
@@ -14,7 +14,6 @@
<string name="about_license">Show License</string>
<string name="about_notice">Show Notice</string>
<string name="about_moreinfo">More Info</string>
- <string name="back_again_to_quit">Press back again to quit</string>
<string name="new_textdocument">New Text Document</string>
<string name="new_presentation">New Presentation</string>
diff --git a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
index 517aa158035d..f05bcae58a49 100644
--- a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
+++ b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
@@ -191,8 +191,6 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings
private RecyclerView fileRecyclerView;
private RecyclerView recentRecyclerView;
- private boolean canQuit = false;
-
private Animation fabOpenAnimation;
private Animation fabCloseAnimation;
private boolean isFabMenuOpen = false;
@@ -440,22 +438,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings
} else if (isFabMenuOpen) {
collapseFabMenu();
} else {
- // only exit if warning has been shown
- if (canQuit) {
- super.onBackPressed();
- return;
- }
-
- // show warning about leaving the app and set a timer
- Toast.makeText(this, R.string.back_again_to_quit,
- Toast.LENGTH_SHORT).show();
- canQuit = true;
- new Handler().postDelayed(new Runnable() {
- @Override
- public void run() {
- canQuit = false;
- }
- }, 3000);
+ super.onBackPressed();
}
}