Exemplo n.º 1
0
        private void SetRecyclerViewAdapters()
        {
            try
            {
                MAdapter = new MembersAdapter(this)
                {
                    UserList = new ObservableCollection <UserDataObject>()
                };
                LayoutManager = new LinearLayoutManager(this);
                MRecycler.SetLayoutManager(LayoutManager);
                MRecycler.HasFixedSize = true;
                MRecycler.SetItemViewCacheSize(10);
                MRecycler.GetLayoutManager().ItemPrefetchEnabled = true;
                var sizeProvider = new FixedPreloadSizeProvider(10, 10);
                var preLoader    = new RecyclerViewPreloader <UserDataObject>(this, MAdapter, sizeProvider, 10);
                MRecycler.AddOnScrollListener(preLoader);
                MRecycler.SetAdapter(MAdapter);

                RecyclerViewOnScrollListener xamarinRecyclerViewOnScrollListener = new RecyclerViewOnScrollListener(LayoutManager);
                MainScrollEvent = xamarinRecyclerViewOnScrollListener;
                MainScrollEvent.LoadMoreEvent += MainScrollEventOnLoadMoreEvent;
                MRecycler.AddOnScrollListener(xamarinRecyclerViewOnScrollListener);
                MainScrollEvent.IsLoading = false;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemplo n.º 2
0
        private void DestroyBasic()
        {
            try
            {
                MAdView?.Destroy();

                MAdapter            = null !;
                SwipeRefreshLayout  = null !;
                MRecycler           = null !;
                EmptyStateLayout    = null !;
                Inflated            = null !;
                ItemUser            = null !;
                InviteFriendsButton = null !;
                PageId        = null !;
                MAdView       = null !;
                PageDataClass = null !;
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
        private void DestroyBasic()
        {
            try
            {
                MAdView?.Destroy();

                MAdapter            = null;
                SwipeRefreshLayout  = null;
                MRecycler           = null;
                EmptyStateLayout    = null;
                Inflated            = null;
                ItemUser            = null;
                InviteFriendsButton = null;
                PageId        = null;
                MAdView       = null;
                PageDataClass = null;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemplo n.º 4
0
 private void SetRecyclerViewAdapters()
 {
     try
     {
         MAdapter = new MembersAdapter(this)
         {
             UserList = new ObservableCollection <UserDataObject>()
         };
         LayoutManager = new LinearLayoutManager(this);
         MRecycler.SetLayoutManager(LayoutManager);
         MRecycler.HasFixedSize = true;
         MRecycler.SetItemViewCacheSize(10);
         MRecycler.GetLayoutManager().ItemPrefetchEnabled = true;
         var sizeProvider = new FixedPreloadSizeProvider(10, 10);
         var preLoader    = new RecyclerViewPreloader <UserDataObject>(this, MAdapter, sizeProvider, 10);
         MRecycler.AddOnScrollListener(preLoader);
         MRecycler.SetAdapter(MAdapter);
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
     }
 }