protected override void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                base.OnCreate(savedInstanceState);
                SetTheme(AppSettings.SetTabDarkTheme ? Resource.Style.MyTheme_Dark_Base : Resource.Style.MyTheme_Base);

                Methods.App.FullScreenApp(this);

                // Create your application here
                SetContentView(Resource.Layout.RecyclerDefaultLayout);

                //Get Value And Set Toolbar
                InitComponent();
                InitToolbar();
                SetRecyclerViewAdapters();

                LoadContacts();
                AdsGoogle.Ad_AppOpenManager(this);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(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);
            }
        }
Ejemplo n.º 3
0
            public override void OnPageSelected(int position)
            {
                try
                {
                    base.OnPageSelected(position);

                    if (AppSettings.LastChatSystem == SystemApiGetLastChat.New)
                    {
                        switch (position)
                        {
                        // lastMessages
                        case 0:
                            AdsGoogle.Ad_AppOpenManager(Activity.Activity);
                            break;

                        // Story
                        case 1:
                            AdsGoogle.Ad_RewardedVideo(Activity.Activity);
                            //LastStoriesTab.StartApiService();
                            break;

                        // Call
                        case 2:
                            AdsGoogle.Ad_Interstitial(Activity.Activity);
                            //LastCallsTab.Get_CallUser();
                            break;
                        }
                    }
                    else
                    {
                        switch (position)
                        {
                        // lastMessages
                        case 0:
                            AdsGoogle.Ad_AppOpenManager(Activity.Activity);
                            break;

                        // GroupChats
                        case 1:
                            AdsGoogle.Ad_RewardedVideo(Activity.Activity);
                            //if (AppSettings.EnableChatGroup)
                            //{
                            //    LastGroupChatsTab.StartApiService();
                            //}
                            //else if (AppSettings.EnableChatPage)
                            //{
                            //    LastPageChatsTab.StartApiService();
                            //}
                            //else
                            //{
                            //    LastStoriesTab.StartApiService();
                            //}
                            break;

                        // PageChats
                        case 2:
                            AdsGoogle.Ad_Interstitial(Activity.Activity);
                            //if (AppSettings.EnableChatPage)
                            //{
                            //    LastPageChatsTab.StartApiService();
                            //}
                            //else
                            //{
                            //    LastStoriesTab.StartApiService();
                            //}
                            break;

                        // Story
                        case 3:
                            AdsGoogle.Ad_AppOpenManager(Activity.Activity);
                            //if (AppSettings.EnableChatGroup)
                            //{
                            //    LastStoriesTab.StartApiService();
                            //}
                            //else
                            //{
                            //    LastCallsTab.Get_CallUser();
                            //}
                            break;

                        // Call
                        case 4:
                            AdsGoogle.Ad_Interstitial(Activity.Activity);
                            //LastCallsTab.Get_CallUser();
                            break;
                        }
                    }
                }
                catch (Exception exception)
                {
                    Methods.DisplayReportResultTrack(exception);
                }
            }