Verified Commit 0d118d55 authored by HashikD's avatar HashikD
Browse files

Add animations to note TextView

parent 0fbd7b41
...@@ -9,6 +9,8 @@ import android.util.Log; ...@@ -9,6 +9,8 @@ import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.Switch; import android.widget.Switch;
import android.widget.TextView; import android.widget.TextView;
...@@ -30,6 +32,7 @@ public class MainFragment extends Fragment { ...@@ -30,6 +32,7 @@ public class MainFragment extends Fragment {
MainFragmentCallback callback; MainFragmentCallback callback;
TextView usersServedTV; TextView usersServedTV;
TextView noteTV; TextView noteTV;
Animation textViewFade;
ImageView snowflakeLogo; ImageView snowflakeLogo;
Switch startButton; Switch startButton;
...@@ -63,6 +66,7 @@ public class MainFragment extends Fragment { ...@@ -63,6 +66,7 @@ public class MainFragment extends Fragment {
noteTV = rootView.findViewById(R.id.note_tv); noteTV = rootView.findViewById(R.id.note_tv);
startButton = rootView.findViewById(R.id.snowflake_switch); startButton = rootView.findViewById(R.id.snowflake_switch);
snowflakeLogo = rootView.findViewById(R.id.snowflake_logo); snowflakeLogo = rootView.findViewById(R.id.snowflake_logo);
textViewFade = AnimationUtils.loadAnimation(getActivity(), R.anim.fade);
//If the service is running, set the button to on //If the service is running, set the button to on
if (callback.isServiceRunning()) { if (callback.isServiceRunning()) {
...@@ -108,6 +112,8 @@ public class MainFragment extends Fragment { ...@@ -108,6 +112,8 @@ public class MainFragment extends Fragment {
*/ */
private void setSnowflakeStatus(boolean status) { private void setSnowflakeStatus(boolean status) {
int from, to; int from, to;
noteTV.startAnimation(textViewFade);
if (status) { //Status on if (status) { //Status on
from = this.getResources().getColor(R.color.snowflakeOff); from = this.getResources().getColor(R.color.snowflakeOff);
to = this.getResources().getColor(R.color.snowflakeOn); to = this.getResources().getColor(R.color.snowflakeOn);
......
<?xml version="1.0" encoding="UTF-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha
android:duration="300"
android:fromAlpha="0.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:repeatCount="0"
android:toAlpha="1.0" />
</set>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment