Beispiel #1
0
        public void OnReselectItem(MeowBottomNavigation.Model item)
        {
            try
            {
                var p = item.GetId();

                if (p < 0)
                {
                    return;
                }

                switch (p)
                {
                // News_Feed_Tab
                case 0 when OpenNewsFeedTab == 2:
                    OpenNewsFeedTab = 1;
                    Context.NewsFeedTab.MainRecyclerView.ScrollToPosition(0);
                    break;

                case 0:
                    OpenNewsFeedTab++;
                    break;

                // Notifications_Tab
                case 1:
                    Context.NewsFeedTab?.MainRecyclerView?.StopVideo();
                    OpenNewsFeedTab = 1;
                    break;

                // Trending_Tab
                case 2 when AppSettings.ShowTrendingPage:
                    Context.NewsFeedTab?.MainRecyclerView?.StopVideo();
                    OpenNewsFeedTab = 1;
                    break;

                // Chat_Tab
                case 3:
                    Context.NewsFeedTab?.MainRecyclerView?.StopVideo();
                    OpenNewsFeedTab = 1;
                    break;

                // More_Tab
                case 4:
                    Context.NewsFeedTab?.MainRecyclerView?.StopVideo();
                    OpenNewsFeedTab = 1;
                    break;
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
        public void OnReselectItem(MeowBottomNavigation.Model item)
        {
            try
            {
                var p = item.GetId();

                if (p < 0)
                {
                    return;
                }

                if (p == 0) // News_Feed_Tab
                {
                    if (OpenNewsFeedTab == 2)
                    {
                        OpenNewsFeedTab = 1;
                        Context.NewsFeedTab.MainRecyclerView.ScrollToPosition(0);
                    }
                    else
                    {
                        OpenNewsFeedTab++;
                    }
                }
                else if (p == 1) // Notifications_Tab
                {
                    Context.NewsFeedTab?.MainRecyclerView?.ReleasePlayer();
                    OpenNewsFeedTab = 1;
                }
                else if (p == 2) // Trending_Tab
                {
                    Context.NewsFeedTab?.MainRecyclerView?.ReleasePlayer();
                    OpenNewsFeedTab = 1;
                }
                else if (p == 3) // More_Tab
                {
                    Context.NewsFeedTab?.MainRecyclerView?.ReleasePlayer();
                    OpenNewsFeedTab = 1;
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
        public void OnReselectItem(MeowBottomNavigation.Model item)
        {
            try
            {
                var p = item.GetId();

                if (p < 0)
                {
                    return;
                }

                if (p == 0) // News_Feed_Tab
                {
                    if (OpenNewsFeedTab == 2)
                    {
                        OpenNewsFeedTab = 1;
                        Context.NewsFeedTab.MainRecyclerView.ScrollToPosition(0);
                    }
                    else
                    {
                        OpenNewsFeedTab++;
                    }
                }
                else if (p == 1) // Notifications_Tab
                {
                    Context.NewsFeedTab?.MainRecyclerView?.StopVideo();
                    OpenNewsFeedTab = 1;
                }
                else if (p == 2 && AppSettings.ShowTrendingPage) // Trending_Tab
                {
                    Context.NewsFeedTab?.MainRecyclerView?.StopVideo();
                    OpenNewsFeedTab = 1;
                }
                else if (p == 3) // More_Tab
                {
                    Context.NewsFeedTab?.MainRecyclerView?.StopVideo();
                    OpenNewsFeedTab = 1;
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
        public void OnClickItem(MeowBottomNavigation.Model item)
        {
            try
            {
                if (!item.GetCount().Equals("0") || !item.GetCount().Equals("empty"))
                {
                    NavigationTabBar.SetCount(item.GetId(), "empty");
                }

                PageNumber = item.GetId();

                if (PageNumber >= 0)
                {
                    if (PageNumber == 0) // News_Feed_Tab
                    {
                        if (AppSettings.ShowAddPostOnNewsFeed && Context.FloatingActionButton.Visibility == ViewStates.Invisible)
                        {
                            Context.FloatingActionButton.Visibility = ViewStates.Visible;
                        }

                        AdsGoogle.Ad_Interstitial(MainContext);
                    }
                    else if (PageNumber == 1) // Notifications_Tab
                    {
                        if (Context.FloatingActionButton.Visibility == ViewStates.Visible)
                        {
                            Context.FloatingActionButton.Visibility = ViewStates.Gone;
                        }

                        Context.RewardedVideoAd = AdsGoogle.Ad_RewardedVideo(MainContext);
                    }
                    else if (PageNumber == 2) // Trending_Tab
                    {
                        if (Context.FloatingActionButton.Visibility == ViewStates.Visible)
                        {
                            Context.FloatingActionButton.Visibility = ViewStates.Gone;
                        }

                        AdsGoogle.Ad_Interstitial(MainContext);

                        if (AppSettings.ShowLastActivities)
                        {
                            Task.Run(() => { Context.TrendingTab.StartApiService(); });
                        }
                    }
                    else if (PageNumber == 3) // More_Tab
                    {
                        if (Context.FloatingActionButton.Visibility == ViewStates.Visible)
                        {
                            Context.FloatingActionButton.Visibility = ViewStates.Gone;
                        }

                        Context.RewardedVideoAd = AdsGoogle.Ad_RewardedVideo(MainContext);
                        PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                            () => ApiRequest.Get_MyProfileData_Api(MainContext)
                        });
                    }
                }

                if (Context.ViewPager.CurrentItem != PageNumber)
                {
                    Context.ViewPager.SetCurrentItem(PageNumber, true);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public void OnClickItem(MeowBottomNavigation.Model item)
        {
            try
            {
                if (!item.GetCount().Equals("0") || !item.GetCount().Equals("empty"))
                {
                    NavigationTabBar.SetCount(item.GetId(), "empty");
                }

                PageNumber = item.GetId();

                switch (PageNumber)
                {
                case >= 0:
                    switch (PageNumber)
                    {
                    // News_Feed_Tab
                    case 0:
                    {
                        Context.FloatingActionButton.Visibility = AppSettings.ShowAddPostOnNewsFeed switch
                        {
                            true when Context.FloatingActionButton.Visibility == ViewStates.Invisible =>
                            ViewStates.Visible,
                                                                   _ => Context.FloatingActionButton.Visibility
                        };

                        AdsGoogle.Ad_AppOpenManager(MainContext);
                        break;
                    }

                    // Notifications_Tab
                    case 1:
                    {
                        Context.FloatingActionButton.Visibility = Context.FloatingActionButton.Visibility switch
                        {
                            ViewStates.Visible => ViewStates.Gone,
                            _ => Context.FloatingActionButton.Visibility
                        };

                        AdsGoogle.Ad_RewardedVideo(MainContext);
                        break;
                    }

                    // Trending_Tab
                    case 2 when AppSettings.ShowTrendingPage:
                    {
                        Context.FloatingActionButton.Visibility = Context.FloatingActionButton.Visibility switch
                        {
                            ViewStates.Visible => ViewStates.Gone,
                            _ => Context.FloatingActionButton.Visibility
                        };

                        AdsGoogle.Ad_Interstitial(MainContext);

                        switch (AppSettings.ShowLastActivities)
                        {
                        case true:
                            Task.Factory.StartNew(() => { Context.TrendingTab.StartApiService(); });
                            break;
                        }

                        Context.InAppReview();
                        break;
                    }

                    // Chat_Tab
                    case 3:
                    {
                        if (Context.FloatingActionButton.Visibility != ViewStates.Visible)
                        {
                            Context.ChatTab.FloatingActionButtonView_Tag();
                        }

                        Context.ToolBar.Visibility = ViewStates.Gone;

                        AdsGoogle.Ad_Interstitial(MainContext);
                        break;
                    }

                    // More_Tab
                    case 4:
                    {
                        Context.FloatingActionButton.Visibility = ViewStates.Gone;

                        Context.ToolBar.Visibility = ViewStates.Visible;

                        AdsGoogle.Ad_RewardedVideo(MainContext);
                        PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                                () => ApiRequest.Get_MyProfileData_Api(MainContext)
                            });
                        break;
                    }
                    }

                    break;
                }

                if (Context.ViewPager.CurrentItem != PageNumber)
                {
                    Context.ViewPager.SetCurrentItem(PageNumber, false);
                }
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }