[Libreoffice-commits] online.git: android/app

Jan Holesovsky (via logerrit) logerrit at kemper.freedesktop.org
Tue Dec 3 13:53:54 UTC 2019


 android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java |   20 +---------
 android/app/src/main/res/values/strings.xml                                        |    1 
 2 files changed, 2 insertions(+), 19 deletions(-)

New commits:
commit 799cb25c06d123b23a6a2419dcbbdf93e95f6976
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Tue Dec 3 12:55:56 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Dec 3 14:53:35 2019 +0100

    android: When I want to quit, I mean it.
    
    I hate when apps make it hard to exit them.
    
    Change-Id: I31c73a70fff6a87512debc95cbd31ef0ba8c1f62
    Reviewed-on: https://gerrit.libreoffice.org/84354
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java b/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java
index 7dfc677a8..0e2696190 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java
@@ -151,8 +151,6 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings
     TextView noRecentItemsTextView;
     TextView noItemsTextView;
 
-    private boolean canQuit = false;
-
     private Animation fabOpenAnimation;
     private Animation fabCloseAnimation;
     private boolean isFabMenuOpen = false;
@@ -398,22 +396,8 @@ 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);
+            // exit the app
+            super.onBackPressed();
         }
     }
 
diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml
index aa73bec01..f93c59b61 100644
--- a/android/app/src/main/res/values/strings.xml
+++ b/android/app/src/main/res/values/strings.xml
@@ -33,7 +33,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>


More information about the Libreoffice-commits mailing list