private void StartApiService()
        {
            if (Methods.CheckConnectivity())
            {
                PollyController.RunRetryPolicyFunction(UserDetails.IsLogin
                    ? new List <Func <Task> > {
                    () => GetPublicPlaylist(), () => GetPlaylist()
                }
                    : new List <Func <Task> > {
                    () => GetPublicPlaylist()
                });
            }
            else
            {
                SwipeRefreshLayout.OnFinishFreshAndLoad();

                Inflated = EmptyStateLayout.Inflate();
                EmptyStateInflater x = new EmptyStateInflater();
                x.InflateLayout(Inflated, EmptyStateInflater.Type.NoConnection);
                if (!x.EmptyStateButton.HasOnClickListeners)
                {
                    x.EmptyStateButton.Click += null;
                    x.EmptyStateButton.Click += EmptyStateButtonOnClick;
                }

                Toast.MakeText(Context, GetText(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Long).Show();
            }
        }
Beispiel #2
0
        private void ShowEmptyPage()
        {
            try
            {
                MainScrollEvent.IsLoading = false;
                SwipeRefreshLayout.OnFinishFreshAndLoad();

                if (ProgressBarLoader.Visibility == ViewStates.Visible)
                {
                    ProgressBarLoader.Visibility = ViewStates.Gone;
                    AppBarLayout.SetExpanded(true);
                }

                if (CardDateAdapter2?.UsersDateList?.Count > 0 || NearByAdapter?.NearByList?.Count > 0)
                {
                    NearByRecyclerView.Visibility = ViewStates.Visible;
                    EmptyStateLayout.Visibility   = ViewStates.Gone;
                }

                if (HotOrNotUserAdapter?.UsersDateList?.Count > 0)
                {
                    RecylerHotOrNot.Visibility  = ViewStates.Visible;
                    HotOrNotLinear.Visibility   = ViewStates.Visible;
                    EmptyStateLayout.Visibility = ViewStates.Gone;
                }

                if (CardDateAdapter2?.UsersDateList?.Count == 0 || NearByAdapter?.NearByList?.Count == 0 && HotOrNotUserAdapter?.UsersDateList?.Count == 0)
                {
                    NearByRecyclerView.Visibility = ViewStates.Gone;
                    RecylerHotOrNot.Visibility    = ViewStates.Gone;
                    HotOrNotLinear.Visibility     = ViewStates.Gone;

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

                    EmptyStateInflater x = new EmptyStateInflater();
                    x.InflateLayout(Inflated, EmptyStateInflater.Type.NoSearchResult);
                    if (!x.EmptyStateButton.HasOnClickListeners)
                    {
                        x.EmptyStateButton.Click += null;
                    }

                    EmptyStateLayout.Visibility = ViewStates.Visible;
                }
            }
            catch (Exception e)
            {
                MainScrollEvent.IsLoading    = false;
                ProgressBarLoader.Visibility = ViewStates.Gone;
                SwipeRefreshLayout.OnFinishFreshAndLoad();
                Console.WriteLine(e);
            }
        }
Beispiel #3
0
 private void StartApiService(string featuredOffset = "0", string topOffset = "0", string latestOffset = "0", string favOffset = "0")
 {
     if (Methods.CheckConnectivity())
     {
         PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
             () => LoadVideos(featuredOffset, topOffset, latestOffset, favOffset)
         });
     }
     else
     {
         SwipeRefreshLayout.OnFinishFreshAndLoad();
         Toast.MakeText(Context, GetText(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Long).Show();
     }
 }
Beispiel #4
0
        private void ShowEmptyPage()
        {
            try
            {
                MainScrollEvent.IsLoading = false;
                SwipeRefreshLayout.OnFinishFreshAndLoad();

                if (ProgressBarLoader.Visibility == ViewStates.Visible)
                {
                    ProgressBarLoader.Visibility = ViewStates.Gone;
                    AppBarLayout.SetExpanded(true);
                }

                if (ExploreAdapter.FeaturedList.Count > 0)
                {
                    ExploreRecylerView.Visibility = ViewStates.Visible;
                    EmptyStateLayout.Visibility   = ViewStates.Gone;
                }
                else
                {
                    ExploreRecylerView.Visibility = ViewStates.Gone;

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

                    EmptyStateInflater x = new EmptyStateInflater();
                    x.InflateLayout(Inflated, EmptyStateInflater.Type.NoPost);
                    if (!x.EmptyStateButton.HasOnClickListeners)
                    {
                        x.EmptyStateButton.Click += null;
                    }
                    EmptyStateLayout.Visibility = ViewStates.Visible;
                }
            }
            catch (Exception e)
            {
                MainScrollEvent.IsLoading    = false;
                ProgressBarLoader.Visibility = ViewStates.Gone;
                SwipeRefreshLayout.OnFinishFreshAndLoad();
                Console.WriteLine(e);
            }
        }
Beispiel #5
0
        private void ShowEmptyPage()
        {
            try
            {
                MainScrollEvent.IsLoading = false;
                SwipeRefreshLayout.OnFinishFreshAndLoad();

                if (UserPostAdapter.PostList.Count > 0)
                {
                    ProfileFeedRecyclerView.Visibility = ViewStates.Visible;
                    EmptyStateLayout.Visibility        = ViewStates.Gone;
                }
                else
                {
                    ProfileFeedRecyclerView.Visibility = ViewStates.Gone;

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

                    EmptyStateInflater x = new EmptyStateInflater();
                    x.InflateLayout(Inflated, EmptyStateInflater.Type.NoPost);
                    if (!x.EmptyStateButton.HasOnClickListeners)
                    {
                        x.EmptyStateButton.Click += null;
                    }
                    EmptyStateLayout.Visibility = ViewStates.Visible;
                }
            }
            catch (Exception e)
            {
                MainScrollEvent.IsLoading = false;
                SwipeRefreshLayout.OnFinishFreshAndLoad();
                Console.WriteLine(e);
            }
        }
Beispiel #6
0
        private void StartApiService()
        {
            if (Methods.CheckConnectivity())
            {
                PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                    LoadDiscover, ApiRequest.GetGenres_Api, () => LoadArtists()
                });
            }
            else
            {
                SwipeRefreshLayout.OnFinishFreshAndLoad();

                Inflated = EmptyStateLayout.Inflate();
                EmptyStateInflater x = new EmptyStateInflater();
                x.InflateLayout(Inflated, EmptyStateInflater.Type.NoConnection);
                if (!x.EmptyStateButton.HasOnClickListeners)
                {
                    x.EmptyStateButton.Click += null;
                    x.EmptyStateButton.Click += EmptyStateButtonOnClick;
                }

                Toast.MakeText(Context, GetText(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Long).Show();
            }
        }
        private void InitComponent(View view)
        {
            try
            {
                AppBarLayout = view.FindViewById <AppBarLayout>(Resource.Id.appBarLayout);
                AppBarLayout.SetExpanded(false);

                StoryRecycler = view.FindViewById <RecyclerView>(Resource.Id.StoryRecyler);

                TxtAppName      = view.FindViewById <TextView>(Resource.Id.Appname);
                TxtAppName.Text = AppSettings.ApplicationName;
                TxtAppName.SetTextColor(AppSettings.SetTabDarkTheme ? Color.White : Color.Black);

                ImageChat        = view.FindViewById <ImageView>(Resource.Id.chatbutton);
                ImageChat.Click += ImageChatOnClick;

                SwipeRefreshLayout = (SpringView)view.FindViewById(Resource.Id.material_style_ptr_frame);
                SwipeRefreshLayout.SetType(SpringView.Type.Overlap);
                SwipeRefreshLayout.Header = new PixelDefaultHeader(Activity);
                SwipeRefreshLayout.Footer = new PixelDefaultFooter(Activity);
                SwipeRefreshLayout.Enable = true;
                SwipeRefreshLayout.SetListener(this);
                SwipeRefreshLayout.OnFinishFreshAndLoad();//check this

                RecyclerFeed = view.FindViewById <PRecyclerView>(Resource.Id.RecylerFeed);

                ProgressBar            = view.FindViewById <ProgressBar>(Resource.Id.sectionProgress);
                ProgressBar.Visibility = ViewStates.Visible;

                EmptyStateLayout            = view.FindViewById <ViewStub>(Resource.Id.viewStub);
                EmptyStateLayout.Visibility = ViewStates.Gone;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }