Esempio n. 1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate(Resource.Layout.browsePage, container, false);



            topRated = view.FindViewById <RecyclerView>(Resource.Id.topRated);
            InitTopRatedRecyclerView();

            popular = view.FindViewById <RecyclerView>(Resource.Id.popular);
            InitPopularRecyclerView();


            nowPlaying = view.FindViewById <RecyclerView>(Resource.Id.nowPlaying);
            InitNowPlayingRecyclerView();

            swipeRefresh = view.FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefresh);
            swipeRefresh.SetOnRefreshListener(new SwipeRefreshListener(async() =>
            {
                await viewModel.Refresh(() =>
                {
                    Locator.Get <IUIDispatcher>().RunOnUiThread(() =>
                    {
                        swipeRefresh.Refreshing = false;
                        topRated.ScrollToPosition(0);
                        popular.ScrollToPosition(0);
                        nowPlaying.ScrollToPosition(0);
                    });
                });
            }));


            return(view);
        }