Example #1
0
        private void SetRecyclerViewAdapters()
        {
            try
            {
                EmptyStateLayout = FindViewById <ViewStub>(Resource.Id.viewStub);
                MainRecyclerView = FindViewById <WRecyclerView>(Resource.Id.Recyler);
                MAdapter         = new NativePostAdapter(this, "", MainRecyclerView, NativeFeedType.Global, SupportFragmentManager);

                SwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
                SwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
                SwipeRefreshLayout.Refreshing = true;
                SwipeRefreshLayout.Enabled    = true;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));

                MainRecyclerView.SetXAdapter(MAdapter, SwipeRefreshLayout);

                CommentsRecyclerView = FindViewById <RecyclerView>(Resource.Id.recycler_view);
                CommentsRecyclerView.NestedScrollingEnabled = false;
                CommentAdapter = new CommentAdapter(this)
                {
                    CommentList = new ObservableCollection <CommentObjectExtra>()
                };
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        private void SetRecyclerViewAdapters()
        {
            try
            {
                MainRecyclerView  = FindViewById <WRecyclerView>(Resource.Id.Recyler);
                NativeFeedAdapter = new NativePostAdapter(this, "", MainRecyclerView, NativeFeedType.Global);
                MainRecyclerView.SetXAdapter(NativeFeedAdapter, SwipeRefreshLayout);

                MAdapter = new CommentAdapter(this)
                {
                    CommentList = new ObservableCollection <CommentObjectExtra>()
                };
                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 <CommentObjectExtra>(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)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
        private void SetRecyclerViewAdapters()
        {
            try
            {
                MainRecyclerView = FindViewById <WRecyclerView>(Resource.Id.Recyler);
                EmptyStateLayout = FindViewById <ViewStub>(Resource.Id.viewStub);

                PostFeedAdapter = new NativePostAdapter(this, IdSearch, MainRecyclerView, NativeFeedType.SearchForPosts);

                SwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
                SwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
                SwipeRefreshLayout.Refreshing = false;
                SwipeRefreshLayout.Enabled    = true;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));

                MainRecyclerView.SetXAdapter(PostFeedAdapter, SwipeRefreshLayout);

                if (Inflated == null)
                {
                    Inflated = EmptyStateLayout.Inflate();
                }

                EmptyStateInflater x1 = new EmptyStateInflater();
                x1.InflateLayout(Inflated, EmptyStateInflater.Type.NoSearchResult);
                x1.EmptyStateButton.Visibility = ViewStates.Gone;

                EmptyStateLayout.Visibility = ViewStates.Visible;
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
 private void SetRecyclerViewAdapters()
 {
     try
     {
         MainRecyclerView = FindViewById <WRecyclerView>(Resource.Id.Recyler);
         PostFeedAdapter  = new NativePostAdapter(this, "", MainRecyclerView, NativeFeedType.Share);
         MainRecyclerView.SetXAdapter(PostFeedAdapter, null);
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
     }
 }
 private void SetRecyclerViewAdapters()
 {
     try
     {
         MainRecyclerView = FindViewById <WRecyclerView>(Resource.Id.Recyler);
         PostFeedAdapter  = new NativePostAdapter(this, "", MainRecyclerView, NativeFeedType.Share, SupportFragmentManager);
         MainRecyclerView.SetXAdapter(PostFeedAdapter, null);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
Example #6
0
 private void SetRecyclerViewAdapters()
 {
     try
     {
         PostFeedAdapter = new NativePostAdapter(this, EventData.Id, MainRecyclerView, NativeFeedType.Event, SupportFragmentManager);
         MainRecyclerView.SetXAdapter(PostFeedAdapter, null);
         Combiner = new FeedCombiner(null, PostFeedAdapter.ListDiffer, this);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
Example #7
0
 private void SetRecyclerViewAdapters()
 {
     try
     {
         PostFeedAdapter = new NativePostAdapter(this, EventData.Id, MainRecyclerView, NativeFeedType.Event, SupportFragmentManager);
         MainRecyclerView.SetXAdapter(PostFeedAdapter, null);
         Combiner = new FeedCombiner(null, PostFeedAdapter.ListDiffer, this);
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
     }
 }
Example #8
0
 private void SetRecyclerViewAdapters(View view)
 {
     try
     {
         MainRecyclerView = (WRecyclerView)view.FindViewById(Resource.Id.newsfeedRecyler);
         PostFeedAdapter  = new NativePostAdapter(Activity, UserDetails.UserId, MainRecyclerView, NativeFeedType.Global, Activity.SupportFragmentManager);
         MainRecyclerView.SetXAdapter(PostFeedAdapter, SwipeRefreshLayout);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
 private void SetRecyclerViewAdapters()
 {
     try
     {
         MainRecyclerView = FindViewById <WRecyclerView>(Resource.Id.newsfeedRecyler);
         PostFeedAdapter  = new NativePostAdapter(this, GroupId, MainRecyclerView, NativeFeedType.Group, SupportFragmentManager);
         MainRecyclerView.SetXAdapter(PostFeedAdapter, null);
         Combiner = new FeedCombiner(null, PostFeedAdapter.ListDiffer, this);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
 private void SetRecyclerViewAdapters()
 {
     try
     {
         PostFeedAdapter = new NativePostAdapter(Activity, UserDetails.UserId, MainRecyclerView, NativeFeedType.Global, Activity.SupportFragmentManager);
         MainRecyclerView?.SetXAdapter(PostFeedAdapter, SwipeRefreshLayout);
         if (AppSettings.ShowNewPostOnNewsFeed)
         {
             MainRecyclerView?.SetXPopupBubble(PopupBubbleView);
         }
         else
         {
             PopupBubbleView.Visibility = ViewStates.Gone;
         }
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
     }
 }
Example #11
0
        private void SetRecyclerViewAdapters()
        {
            try
            {
                MainRecyclerView = FindViewById <WRecyclerView>(Resource.Id.Recyler);
                PostFeedAdapter  = new NativePostAdapter(this, "", MainRecyclerView, NativeFeedType.Popular, SupportFragmentManager);

                SwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
                SwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
                SwipeRefreshLayout.Refreshing = true;
                SwipeRefreshLayout.Enabled    = true;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));

                MainRecyclerView.SetXAdapter(PostFeedAdapter, SwipeRefreshLayout);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Example #12
0
 private void SetRecyclerViewAdapters(View view)
 {
     try
     {
         MainRecyclerView = (WRecyclerView)view.FindViewById(Resource.Id.newsfeedRecyler);
         PostFeedAdapter  = new NativePostAdapter(Activity, UserDetails.UserId, MainRecyclerView, NativeFeedType.Global, Activity.SupportFragmentManager);
         MainRecyclerView.SetXAdapter(PostFeedAdapter, SwipeRefreshLayout);
         if (AppSettings.ShowNewPostOnNewsFeed)
         {
             MainRecyclerView.SetXPopupBubble(PopupBubbleView);
         }
         else
         {
             PopupBubbleView.Visibility = ViewStates.Gone;
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
Example #13
0
        private void SetRecyclerViewAdapters()
        {
            try
            {
                MainRecyclerView = FindViewById <WRecyclerView>(Resource.Id.Recyler);
                EmptyStateLayout = FindViewById <ViewStub>(Resource.Id.viewStub);

                SwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
                SwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
                SwipeRefreshLayout.Refreshing = true;
                SwipeRefreshLayout.Enabled    = true;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));

                PostFeedAdapter = new NativePostAdapter(this, "", MainRecyclerView, NativeFeedType.Memories);

                MainRecyclerView.SetXAdapter(PostFeedAdapter, SwipeRefreshLayout);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
        private void SetRecyclerViewAdapters()
        {
            try
            {
                PostFeedAdapter = new NativePostAdapter(Activity, UserDetails.UserId, MainRecyclerView, NativeFeedType.Global);
                MainRecyclerView?.SetXAdapter(PostFeedAdapter, SwipeRefreshLayout);
                switch (AppSettings.ShowNewPostOnNewsFeed)
                {
                case true:
                    MainRecyclerView?.SetXPopupBubble(PopupBubbleView);
                    break;

                default:
                    PopupBubbleView.Visibility = ViewStates.Gone;
                    break;
                }
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Example #15
0
        private void SetRecyclerViewAdapters()
        {
            try
            {
                MainRecyclerView = FindViewById <WRecyclerView>(Resource.Id.Recyler);
                PostFeedAdapter  = new NativePostAdapter(this, "", MainRecyclerView, NativeFeedType.Saved);

                SwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
                SwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
                SwipeRefreshLayout.Refreshing = true;
                SwipeRefreshLayout.Enabled    = true;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));

                MainRecyclerView.SetXAdapter(PostFeedAdapter, SwipeRefreshLayout);

                LinearLayout adContainer = FindViewById <LinearLayout>(Resource.Id.bannerContainer);
                BannerAd = AdsFacebook.InitAdView(this, adContainer);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }