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

[tor-commits] [snowflake-mobile/master] Add dynamic note change



commit 0fbd7b417c32b597e3b6126990adcca610d69a4b
Author: Hashik Donthineni <HashikDonthineni@xxxxxxxxx>
Date:   Fri Aug 7 01:49:59 2020 +0530

    Add dynamic note change
---
 .../main/java/org/torproject/snowflake/fragments/MainFragment.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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 fdd2afb..d24c891 100644
--- a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
+++ b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
@@ -29,6 +29,7 @@ public class MainFragment extends Fragment {
     private static final String TAG = "MainFragment";
     MainFragmentCallback callback;
     TextView usersServedTV;
+    TextView noteTV;
     ImageView snowflakeLogo;
     Switch startButton;
 
@@ -59,6 +60,7 @@ public class MainFragment extends Fragment {
         Log.d(TAG, "onCreateView: ");
         View rootView = inflater.inflate(R.layout.fragment_main, container, false);
         usersServedTV = rootView.findViewById(R.id.users_served);
+        noteTV = rootView.findViewById(R.id.note_tv);
         startButton = rootView.findViewById(R.id.snowflake_switch);
         snowflakeLogo = rootView.findViewById(R.id.snowflake_logo);
 
@@ -110,13 +112,15 @@ public class MainFragment extends Fragment {
             from = this.getResources().getColor(R.color.snowflakeOff);
             to = this.getResources().getColor(R.color.snowflakeOn);
             startButton.setText(getString(R.string.Snowflake_On));
+            noteTV.setText(getString(R.string.snowflake_ready_note));
         } else { //off
             from = this.getResources().getColor(R.color.snowflakeOn);
             to = this.getResources().getColor(R.color.snowflakeOff);
             startButton.setText(getString(R.string.Snowflake_Off));
+            noteTV.setText(getString(R.string.turn_on_note));
         }
 
-        //Animating the transition
+        //Animating the transition of logo
         ValueAnimator colorAnimation = ValueAnimator.ofObject(new ArgbEvaluator(), from, to);
         colorAnimation.setDuration(300); // milliseconds
         colorAnimation.addUpdateListener(animator -> snowflakeLogo.setColorFilter((int) animator.getAnimatedValue(), PorterDuff.Mode.SRC_ATOP));



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