void CreateRecyclerView(Context context) { _recyclerView = new ScrollRecyclerView(context); _recyclerView.Touch += _recyclerView_Touch; var scrollListener = new GridViewScrollListener(Element, _recyclerView); _recyclerView.AddOnScrollListener(scrollListener); _recyclerView.SetItemAnimator(null); _recyclerView.HorizontalScrollBarEnabled = false; _recyclerView.VerticalScrollBarEnabled = true; _adapter = new GridViewAdapter(Element.ItemsSource, _recyclerView, Element, Resources.DisplayMetrics); _recyclerView.SetAdapter(_adapter); //Initialize the pull to refresh host. _pullToRefresh = new SwipeRefreshLayout(Android.App.Application.Context); //Add the recylcler to the refresh host. _pullToRefresh.AddView(_recyclerView); //Attach event handling for refresh. _pullToRefresh.Refresh += _pullToRefresh_Refresh; //Enable/Disable pull to refresh. _pullToRefresh.Enabled = Element.IsPullToRefreshEnabled; //Set the current refresh status. _pullToRefresh.Refreshing = Element.IsRefreshing; //Update the grid layout. UpdateGridLayout(); }
public GroupedGridSpanSizeLookup(GridViewAdapter adapter, int spanCount) { _adapter = adapter; _spanCount = spanCount; }