public FormsRecyclerViewAdapter(IList items, RecyclerView recyclerView, FormsRecyclerView gridView)
 {
     this.Items          = items;
     this.recyclerView   = recyclerView;
     this.Element        = gridView;
     this.displayMetrics = Android.App.Application.Context.Resources.DisplayMetrics;
     this.screenDpWidth  = (int)(this.displayMetrics.WidthPixels / this.displayMetrics.Density);
 }
Beispiel #2
0
        public FormsRecyclerViewCellContainer(Context context, FormsRecyclerCell fastCell, View parent, double width,
                                              FormsRecyclerView formsRecyclerView)
            : base(context)
        {
            this.fastCell     = fastCell;
            this.parent       = parent;
            this.initialWidth = width;

            using (var handler = new Handler(Looper.MainLooper))
            {
                handler.Post(() =>
                {
                    this.fastCell.PrepareCell();
                    this.view = Platform.CreateRenderer(fastCell.View);
                    Platform.SetRenderer(fastCell.View, view);
                    this.AddView(this.view.ViewGroup);
                });
            }
        }