Example #1
0
        private void InitNowPlayingRecyclerView()
        {
            nowPlayingManager = new LinearLayoutManager(Activity, LinearLayoutManager.Horizontal, false);
            nowPlaying.SetLayoutManager(nowPlayingManager);
            nowPlayingAdapter = new ItemAdapter(viewModel.GetCachedNowPlaying());
            nowPlaying.SetAdapter(nowPlayingAdapter);
            var nowPlayingScrollListener = new ItemAdapterScollListener(nowPlayingManager);

            nowPlayingScrollListener.LoadMore += async delegate()
            {
                if (!viewModel.CanLoadMoreNowPlaying())
                {
                    return;
                }
                await viewModel.GetNowPlaying().ConfigureAwait(false);
            };
            nowPlaying.AddOnScrollListener(nowPlayingScrollListener);
        }