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

[tor-commits] [orbot/master] Issue #309: Also disable CAPTCHA solution EditText, as long as there's no CAPTCHA to solve and while letting it check.



commit e1425d3a217ffd5ed8f5d087994f6179a70e0850
Author: Benjamin Erhart <berhart@xxxxxxxxxxxxxxxxxxx>
Date:   Thu Apr 30 15:10:27 2020 +0200

    Issue #309: Also disable CAPTCHA solution EditText, as long as there's no CAPTCHA to solve and while letting it check.
---
 .../main/java/org/torproject/android/ui/onboarding/MoatActivity.java  | 4 ++++
 1 file changed, 4 insertions(+)

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 7dfc4745..697ca032 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
@@ -139,6 +139,7 @@ public class MoatActivity extends AppCompatActivity implements View.OnClickListe
         }
         else {
             mIvCaptcha.setVisibility(View.GONE);
+            mEtSolution.setEnabled(false);
             mBtRequest.setEnabled(false);
 
             mOriginalBridges = Prefs.getBridgesList();
@@ -257,6 +258,7 @@ public class MoatActivity extends AppCompatActivity implements View.OnClickListe
                             mIvCaptcha.setImageBitmap(BitmapFactory.decodeByteArray(mCaptcha, 0, mCaptcha.length));
                             mIvCaptcha.setVisibility(View.VISIBLE);
                             mEtSolution.setText(null);
+                            mEtSolution.setEnabled(true);
                             mBtRequest.setEnabled(true);
 
                         } catch (JSONException e) {
@@ -323,6 +325,7 @@ public class MoatActivity extends AppCompatActivity implements View.OnClickListe
             mRequestInProgress = true;
             invalidateOptionsMenu();
             mProgressBar.setVisibility(View.VISIBLE);
+            mEtSolution.setEnabled(false);
             mBtRequest.setEnabled(false);
 
             mQueue.add(request);
@@ -421,6 +424,7 @@ public class MoatActivity extends AppCompatActivity implements View.OnClickListe
         }
 
         mProgressBar.setVisibility(View.GONE);
+        mEtSolution.setEnabled(mIvCaptcha.getVisibility() == View.VISIBLE);
         mBtRequest.setEnabled(mIvCaptcha.getVisibility() == View.VISIBLE);
 
         if (!isFinishing()) {



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