Ejemplo n.º 1
0
        // Sets the checked/unchecked state of the FAB.
        public void SetChecked(bool check)
        {
            // If trying to change to the current state, ignore
            if (check == this.check)
            {
                return;
            }
            this.check = check;

            // Create and start the ValueAnimator that shows the new state
            Animator anim = CreateAnimator();

            anim.SetDuration(Resources.GetInteger(Android.Resource.Integer.ConfigShortAnimTime));
            anim.Start();

            // Set the new background color of the View to be revealed
            revealView.SetBackgroundColor(check ? Resources.GetColor(Resource.Color.fab_color_2)
                : Resources.GetColor(Resource.Color.fab_color_1));

            //Show the View to be revealed. Note that the animation has started already.
            revealView.Visibility = ViewStates.Visible;

            if (onCheckedChangeListener != null)
            {
                onCheckedChangeListener.OnCheckedChanged(this, check);
            }
        }
 /// <summary>
 /// Does the on check changed.
 /// </summary>
 public void DoOnCheckChanged()
 {
     if (onCheckedChangeListener != null)
     {
         onCheckedChangeListener.OnCheckedChanged(this, check);
     }
 }