[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit 54f5f31173fb7d0d557e74897e149be1ed01e0ec
Author: Benjamin Erhart <berhart@xxxxxxxxxxxxxxxxxxx>
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);



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits