public NotificationViewCellDroid(Context context, XFNotificationViewCell cell, FListView fListView, AListView listView) : base(context) { XFNotificationCell = cell; FListView = fListView; AListView = listView; var view = (context as Activity).LayoutInflater.Inflate(Resource.Layout.NotificationItem, null); //Get views to each control ItemTemplate TxtName = view.FindViewById <TextView>(Resource.Id.txtName); TxtAge = view.FindViewById <TextView>(Resource.Id.txtAge); ImgUser = view.FindViewById <ImageView>(Resource.Id.imgUser); ImgBack = view.FindViewById <ImageView>(Resource.Id.imgBack); FlyImages = view.FindViewById <FrameLayout>(Resource.Id.flyImages); FlyImages.Click += FlyImages_Click; float scale = (context as Activity).Resources.DisplayMetrics.Density; FlyImages.SetCameraDistance(8000 * scale); AddView(view); }
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); }