[tor-commits] [orbot/master] Issue #309: Hide refresh option menu item instead of disable, because Android doesn't visualize that adequately.

n8fr8 at torproject.org n8fr8 at torproject.org
Mon Aug 24 21:02:51 UTC 2020


commit 54f5f31173fb7d0d557e74897e149be1ed01e0ec
Author: Benjamin Erhart <berhart at netzarchitekten.com>
Date:   Thu Apr 30 14:59:39 2020 +0200

    Issue #309: Hide refresh option menu item instead of disable, because Android doesn't visualize that adequately.
    Additionally: Fix issue where you couldn't refresh after a network error.
---
 .../java/org/torproject/android/ui/onboarding/MoatActivity.java     | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/app/src/main/java/org/torproject/android/ui/onboarding/MoatActivity.java b/app/src/main/java/org/torproject/android/ui/onboarding/MoatActivity.java
index 0565c164..a98b4c65 100644
--- a/app/src/main/java/org/torproject/android/ui/onboarding/MoatActivity.java
+++ b/app/src/main/java/org/torproject/android/ui/onboarding/MoatActivity.java
@@ -160,7 +160,7 @@ public class MoatActivity extends AppCompatActivity implements View.OnClickListe
 
     @Override
     public boolean onPrepareOptionsMenu(Menu menu) {
-        menu.findItem(R.id.menu_refresh).setEnabled(!mRequestInProgress);
+        menu.findItem(R.id.menu_refresh).setVisible(!mRequestInProgress);
 
         return super.onPrepareOptionsMenu(menu);
     }
@@ -348,6 +348,10 @@ public class MoatActivity extends AppCompatActivity implements View.OnClickListe
                 new Response.ErrorListener() {
                     @Override
                     public void onErrorResponse(VolleyError error) {
+                        mRequestInProgress = false;
+                        invalidateOptionsMenu();
+                        mProgressBar.setVisibility(View.GONE);
+
                         Log.d(MoatActivity.class.getSimpleName(), "Error response.");
 
                         displayError(error, null);





More information about the tor-commits mailing list