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

[tor-commits] [snowflake-mobile/master] Add comments



commit 2a7a3ea779ed0188a217bbc1c0760d48ae06c751
Author: Hashik Donthineni <HashikDonthineni@xxxxxxxxx>
Date:   Wed Nov 11 15:06:22 2020 +0530

    Add comments
---
 app/src/main/java/org/torproject/snowflake/MainActivity.java     | 9 ++++++++-
 .../java/org/torproject/snowflake/fragments/MainFragment.java    | 5 +++++
 .../java/org/torproject/snowflake/models/MainActivityModel.java  | 3 +++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/app/src/main/java/org/torproject/snowflake/MainActivity.java b/app/src/main/java/org/torproject/snowflake/MainActivity.java
index 5fb3fb4..6ec0804 100644
--- a/app/src/main/java/org/torproject/snowflake/MainActivity.java
+++ b/app/src/main/java/org/torproject/snowflake/MainActivity.java
@@ -198,7 +198,11 @@ public class MainActivity extends AppCompatActivity implements MainFragmentCallb
         return super.onOptionsItemSelected(item);
     }
 
-
+    /**
+     * Relay failed. Reset Snowflake status in MainFragment.
+     *
+     * @param message Cause of failure.
+     */
     @Override
     public void relayFailed(String message) {
         runOnUiThread(() -> {
@@ -209,6 +213,9 @@ public class MainActivity extends AppCompatActivity implements MainFragmentCallb
         });
     }
 
+    /**
+     * Relay test success. Start Snowflake.
+     */
     @Override
     public void relaySuccess() {
         runOnUiThread(() -> {
diff --git a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
index 152e794..1e438fb 100644
--- a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
+++ b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
@@ -150,6 +150,11 @@ public class MainFragment extends Fragment {
         colorAnimation.start();
     }
 
+    /**
+     * Relay failed. Callback from MainActivity. Reset everything and show the message of failure.
+     *
+     * @param message Cause of failure.
+     */
     public void relayFailed(String message) {
         startButton.setEnabled(true);
         startButton.setClickable(true);
diff --git a/app/src/main/java/org/torproject/snowflake/models/MainActivityModel.java b/app/src/main/java/org/torproject/snowflake/models/MainActivityModel.java
index cc42599..330118b 100644
--- a/app/src/main/java/org/torproject/snowflake/models/MainActivityModel.java
+++ b/app/src/main/java/org/torproject/snowflake/models/MainActivityModel.java
@@ -158,6 +158,9 @@ public class MainActivityModel implements MainActivityMVPContract.Model {
         }
     }
 
+    /**
+     * Checks the relay URL availability.
+     */
     @Override
     public void relayCheck() {
         Request req;

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