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

[tor-commits] [orbot/master] add UI feedback when Snowflake Proxy mode is enabled



commit 055900d9d27d1f3d933a40dd26ad1d88f594b758
Author: n8fr8 <nathan@xxxxxxxxxxxxxxxxxxxx>
Date:   Tue Jul 13 12:11:50 2021 -0400

    add UI feedback when Snowflake Proxy mode is enabled
---
 app/build.gradle                                   |  4 +++-
 .../org/torproject/android/OrbotMainActivity.java  | 16 +++++++++++++++-
 app/src/main/res/layout/layout_main.xml            | 22 +++++++++++++++++++---
 app/src/main/res/values/strings.xml                |  1 +
 4 files changed, 38 insertions(+), 5 deletions(-)

diff --git a/app/build.gradle b/app/build.gradle
index 9b8997bd..1d365f24 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -127,7 +127,7 @@ repositories {
 
 dependencies {
     implementation project(':orbotservice')
-    implementation 'com.google.android.material:material:1.3.0'
+    implementation 'com.google.android.material:material:1.4.0'
     implementation 'pl.bclogic:pulsator4droid:1.0.3'
     implementation 'com.github.apl-devs:appintro:v4.2.2'
     implementation project(path: ':appcore')
@@ -136,6 +136,8 @@ dependencies {
     implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
     implementation 'com.android.volley:volley:1.2.0'
     implementation 'com.github.tladesignz:IPtProxy:1.0.0'
+
+    implementation 'com.github.jetradarmobile:android-snowfall:1.2.1'
 }
 
 // Map for the version code that gives each ABI a value.
diff --git a/app/src/main/java/org/torproject/android/OrbotMainActivity.java b/app/src/main/java/org/torproject/android/OrbotMainActivity.java
index 4f0143d3..df899d70 100644
--- a/app/src/main/java/org/torproject/android/OrbotMainActivity.java
+++ b/app/src/main/java/org/torproject/android/OrbotMainActivity.java
@@ -51,6 +51,8 @@ import androidx.core.view.GravityCompat;
 import androidx.drawerlayout.widget.DrawerLayout;
 import androidx.localbroadcastmanager.content.LocalBroadcastManager;
 
+import com.jetradarmobile.snowfall.SnowfallView;
+
 import org.torproject.android.core.Languages;
 import org.torproject.android.core.LocaleHelper;
 import org.torproject.android.core.ui.Rotate3dAnimation;
@@ -283,6 +285,10 @@ public class OrbotMainActivity extends AppCompatActivity implements OrbotConstan
 
         sendIntentToService(ACTION_STOP);
 
+        SnowfallView sv = findViewById(R.id.snowflake_view);
+        sv.setVisibility(View.GONE);
+        sv.stopFalling();
+
     }
 
     private void doLayout() {
@@ -945,12 +951,20 @@ public class OrbotMainActivity extends AppCompatActivity implements OrbotConstan
                 if (Prefs.beSnowflakeProxy())
                 {
                     lblStatus.setText(getString(R.string.status_activated)+"\n"
-                    + "â??â??You are a snowflakeâ??â??");
+                    + getString(R.string.snowflake_proxy_enabled));
+
+                    SnowfallView sv = findViewById(R.id.snowflake_view);
+                    sv.setVisibility(View.VISIBLE);
+                    sv.restartFalling();
 
                 }
                 else
                 {
                     lblStatus.setText(getString(R.string.status_activated));
+                    SnowfallView sv = findViewById(R.id.snowflake_view);
+                    sv.setVisibility(View.GONE);
+                    sv.stopFalling();
+
 
                 }
 
diff --git a/app/src/main/res/layout/layout_main.xml b/app/src/main/res/layout/layout_main.xml
index e8eba5eb..5cba751e 100644
--- a/app/src/main/res/layout/layout_main.xml
+++ b/app/src/main/res/layout/layout_main.xml
@@ -15,19 +15,33 @@
         android:layout_height="wrap_content"
         android:minHeight="?attr/actionBarSize" />
 
+
+            <FrameLayout
+                android:layout_width="match_parent"
+                android:layout_height="match_parent">
+
+            <com.jetradarmobile.snowfall.SnowfallView
+                android:id="@+id/snowflake_view"
+                android:visibility="gone"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"/>
+
     <androidx.drawerlayout.widget.DrawerLayout
         android:id="@+id/drawer_layout"
         android:layout_width="match_parent"
         android:layout_height="match_parent">
 
         <ScrollView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content">
+
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            >
 
             <RelativeLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content">
 
+
                 <FrameLayout
                     android:id="@+id/frameMain"
                     android:layout_width="match_parent"
@@ -274,11 +288,13 @@
                         android:layout_height="wrap_content"
                         android:gravity="center"
                         android:orientation="horizontal"
+                        android:minHeight="200dp"
                         android:padding="3dp" />
                 </LinearLayout>
 
 
             </RelativeLayout>
+
         </ScrollView>
 
 
@@ -308,7 +324,7 @@
         </LinearLayout>
 
     </androidx.drawerlayout.widget.DrawerLayout>
-
+            </FrameLayout>
 </LinearLayout>
 
 
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 94cfc800..e4ccff7d 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -268,6 +268,7 @@
 
     <string name="be_a_snowflake_title_limit">Snowflake Proxy Limits</string>
     <string name="be_a_snowflake_desc_limit">Only when device is plugged in and on wifi</string>
+    <string name="snowflake_proxy_enabled">SNOWFLAKE PROXY MODE ENABLED</string>
 
 
 </resources>



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