Пример #1
0
        private void FlyImages_Click(object sender, EventArgs e)
        {
            bool isSelected  = FListView.IsSelectedItem(Position);
            var  setRightOut = (AnimatorSet)AnimatorInflater.LoadAnimator(Context, Resource.Animator.right_out);
            var  setLeftIn   = (AnimatorSet)AnimatorInflater.LoadAnimator(Context, Resource.Animator.left_in);

            if (!isSelected)
            {
                setRightOut.SetTarget(ImgUser);
                setLeftIn.SetTarget(ImgBack);
                setRightOut.Start();
                setLeftIn.Start();
                //this.SetBackgroundColor(Android.Graphics.Color.AliceBlue);
                FListView.MarkItemAsSelected(Position, true);
            }
            else
            {
                setRightOut.SetTarget(ImgBack);
                setLeftIn.SetTarget(ImgUser);
                setRightOut.Start();
                setLeftIn.Start();
                //this.SetBackgroundColor(Android.Graphics.Color.White);
                FListView.MarkItemAsSelected(Position, false);
            }

            FListView.UpdateActionModeDroid();
        }
Пример #2
0
        public void UpdateCell(XFNotificationViewCell cell)
        {
            Person person = cell.Person;

            TxtName.Text = person.Name;
            TxtAge.Text  = person.Age.ToString();

            // Dispose of the old image
            if (ImgUser.Drawable != null)
            {
                using (var image = ImgUser.Drawable as BitmapDrawable)
                {
                    if (image != null)
                    {
                        if (image.Bitmap != null)
                        {
                            image.Bitmap.Dispose();
                        }
                    }
                }
            }

            if (FListView.IsSelectedItem(Position))
            {
                ImgUser.Alpha = 0;
                ImgBack.Alpha = 1;
                //this.SetBackgroundColor(Android.Graphics.Color.AliceBlue);
                //FlyImages_Click(FlyImages, EventArgs.Empty);
            }
            else
            {
                ImgUser.Alpha = 1;
                ImgBack.Alpha = 0;
                //this.SetBackgroundColor(Android.Graphics.Color.White);
                //FlyImages_Click(FlyImages, EventArgs.Empty);
            }

            SetImage(person.ImageUrl);
        }