Exemple #1
0
        private void DestroyBasic()
        {
            try
            {
                RewardedVideoAd?.OnDestroy(this);

                Adapter         = null;
                ViewPager       = null;
                TabLayout       = null;
                AngryTab        = null;
                HahaTab         = null;
                LikeTab         = null;
                LoveTab         = null;
                SadTab          = null;
                WowTab          = null;
                PostId          = null;
                TypeReaction    = null;
                PostData        = null;
                RewardedVideoAd = null;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemple #2
0
        private void DestroyBasic()
        {
            try
            {
                RewardedVideoAd?.OnDestroy(this);

                Adapter         = null !;
                ViewPager       = null !;
                TabLayout       = null !;
                AngryTab        = null !;
                HahaTab         = null !;
                LikeTab         = null !;
                LoveTab         = null !;
                SadTab          = null !;
                WowTab          = null !;
                Id              = null !;
                TypeReaction    = null !;
                CommentObject   = null !;
                RewardedVideoAd = null !;
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Exemple #3
0
 private void DestroyBasic()
 {
     try
     {
         Adapter      = null !;
         ViewPager    = null !;
         TabLayout    = null !;
         AngryTab     = null !;
         HahaTab      = null !;
         LikeTab      = null !;
         LoveTab      = null !;
         SadTab       = null !;
         WowTab       = null !;
         PostId       = null !;
         TypeReaction = null !;
         PostData     = null !;
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
     }
 }
Exemple #4
0
        private void SetUpViewPager(ViewPager viewPager)
        {
            try
            {
                PostData = JsonConvert.DeserializeObject <PostDataObject>(Intent.GetStringExtra("PostObject"));
                if (PostData != null)
                {
                    Adapter = new MainTabAdapter(SupportFragmentManager);

                    if (PostData.Reaction.Count > 0 && PostData.Reaction.Like == 0 && PostData.Reaction.Love == 0 && PostData.Reaction.HaHa == 0 && PostData.Reaction.Wow == 0 && PostData.Reaction.Sad == 0 && PostData.Reaction.Angry == 0 &&
                        PostData.Reaction.Like1 == 0 && PostData.Reaction.Love2 == 0 && PostData.Reaction.HaHa3 == 0 && PostData.Reaction.Wow4 == 0 && PostData.Reaction.Sad5 == 0 && PostData.Reaction.Angry6 == 0)
                    {
                        LikeTab  = new LikeReactionFragment();
                        LoveTab  = new LoveReactionFragment();
                        HahaTab  = new HahaReactionFragment();
                        WowTab   = new WowReactionFragment();
                        SadTab   = new SadReactionFragment();
                        AngryTab = new AngryReactionFragment();

                        Adapter.AddFragment(LikeTab, GetText(Resource.String.Btn_Likes));
                        Adapter.AddFragment(LoveTab, GetText(Resource.String.Btn_Love));
                        Adapter.AddFragment(HahaTab, GetText(Resource.String.Btn_Haha));
                        Adapter.AddFragment(WowTab, GetText(Resource.String.Btn_Wow));
                        Adapter.AddFragment(SadTab, GetText(Resource.String.Btn_Sad));
                        Adapter.AddFragment(AngryTab, GetText(Resource.String.Btn_Angry));
                    }
                    else
                    {
                        if (PostData.Reaction.Like > 0 || PostData.Reaction.Like1 > 0)
                        {
                            LikeTab = new LikeReactionFragment();
                            Adapter.AddFragment(LikeTab, GetText(Resource.String.Btn_Likes));
                        }

                        if (PostData.Reaction.Love > 0 || PostData.Reaction.Love2 > 0)
                        {
                            LoveTab = new LoveReactionFragment();
                            Adapter.AddFragment(LoveTab, GetText(Resource.String.Btn_Love));
                        }

                        if (PostData.Reaction.HaHa > 0 || PostData.Reaction.HaHa3 > 0)
                        {
                            HahaTab = new HahaReactionFragment();
                            Adapter.AddFragment(HahaTab, GetText(Resource.String.Btn_Haha));
                        }

                        if (PostData.Reaction.Wow > 0 || PostData.Reaction.Wow4 > 0)
                        {
                            WowTab = new WowReactionFragment();
                            Adapter.AddFragment(WowTab, GetText(Resource.String.Btn_Wow));
                        }

                        if (PostData.Reaction.Sad > 0 || PostData.Reaction.Sad5 > 0)
                        {
                            SadTab = new SadReactionFragment();
                            Adapter.AddFragment(SadTab, GetText(Resource.String.Btn_Sad));
                        }

                        if (PostData.Reaction.Angry > 0 || PostData.Reaction.Angry6 > 0)
                        {
                            AngryTab = new AngryReactionFragment();
                            Adapter.AddFragment(AngryTab, GetText(Resource.String.Btn_Angry));
                        }
                    }

                    viewPager.CurrentItem = Adapter.Count;
                    viewPager.Adapter     = Adapter;
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Exemple #5
0
        private void SetUpViewPager(ViewPager viewPager)
        {
            try
            {
                CommentObject = JsonConvert.DeserializeObject <GetCommentObject>(Intent?.GetStringExtra("CommentObject") ?? "");
                if (CommentObject != null)
                {
                    Id = CommentObject.Id;

                    Adapter = new MainTabAdapter(SupportFragmentManager);

                    if (CommentObject.Reaction.Count > 0)
                    {
                        LikeTab  = new LikeReactionFragment();
                        LoveTab  = new LoveReactionFragment();
                        HahaTab  = new HahaReactionFragment();
                        WowTab   = new WowReactionFragment();
                        SadTab   = new SadReactionFragment();
                        AngryTab = new AngryReactionFragment();

                        Bundle args = new Bundle();
                        args.PutString("NamePage", TypeClass);

                        LikeTab  = new LikeReactionFragment();
                        LoveTab  = new LoveReactionFragment();
                        HahaTab  = new HahaReactionFragment();
                        WowTab   = new WowReactionFragment();
                        SadTab   = new SadReactionFragment();
                        AngryTab = new AngryReactionFragment();

                        LikeTab.Arguments  = args;
                        LoveTab.Arguments  = args;
                        HahaTab.Arguments  = args;
                        WowTab.Arguments   = args;
                        SadTab.Arguments   = args;
                        AngryTab.Arguments = args;

                        Adapter.AddFragment(LikeTab, GetText(Resource.String.Btn_Likes));
                        Adapter.AddFragment(LoveTab, GetText(Resource.String.Btn_Love));
                        Adapter.AddFragment(HahaTab, GetText(Resource.String.Btn_Haha));
                        Adapter.AddFragment(WowTab, GetText(Resource.String.Btn_Wow));
                        Adapter.AddFragment(SadTab, GetText(Resource.String.Btn_Sad));
                        Adapter.AddFragment(AngryTab, GetText(Resource.String.Btn_Angry));
                    }//wael
                     //else
                     //{
                     //    if (PostData.Reaction.Like > 0 || PostData.Reaction.Like1 > 0)
                     //    {
                     //        LikeTab = new LikeReactionFragment();
                     //        Adapter.AddFragment(LikeTab, GetText(Resource.String.Btn_Likes));
                     //    }

                    //    if (PostData.Reaction.Love > 0 || PostData.Reaction.Love2 > 0)
                    //    {
                    //        LoveTab = new LoveReactionFragment();
                    //        Adapter.AddFragment(LoveTab, GetText(Resource.String.Btn_Love));
                    //    }

                    //    if (PostData.Reaction.HaHa > 0 || PostData.Reaction.HaHa3 > 0)
                    //    {
                    //        HahaTab = new HahaReactionFragment();
                    //        Adapter.AddFragment(HahaTab, GetText(Resource.String.Btn_Haha));
                    //    }

                    //    if (PostData.Reaction.Wow > 0 || PostData.Reaction.Wow4 > 0)
                    //    {
                    //        WowTab = new WowReactionFragment();
                    //        Adapter.AddFragment(WowTab, GetText(Resource.String.Btn_Wow));
                    //    }

                    //    if (PostData.Reaction.Sad > 0 || PostData.Reaction.Sad5 > 0)
                    //    {
                    //        SadTab = new SadReactionFragment();
                    //        Adapter.AddFragment(SadTab, GetText(Resource.String.Btn_Sad));
                    //    }

                    //    if (PostData.Reaction.Angry > 0 || PostData.Reaction.Angry6 > 0)
                    //    {
                    //        AngryTab = new AngryReactionFragment();
                    //        Adapter.AddFragment(AngryTab, GetText(Resource.String.Btn_Angry));
                    //    }
                    //}

                    viewPager.CurrentItem = Adapter.Count;
                    viewPager.Adapter     = Adapter;
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
Exemple #6
0
        private void SetUpViewPager(ViewPager2 viewPager)
        {
            try
            {
                CommentObject = JsonConvert.DeserializeObject <GetCommentObject>(Intent?.GetStringExtra("CommentObject") ?? "");
                if (CommentObject != null)
                {
                    Id = CommentObject.Id;

                    Adapter = new MainTabAdapter(this);

                    switch (CommentObject.Reaction.Count)
                    {
                    case > 0:
                    {
                        LikeTab  = new LikeReactionFragment();
                        LoveTab  = new LoveReactionFragment();
                        HahaTab  = new HahaReactionFragment();
                        WowTab   = new WowReactionFragment();
                        SadTab   = new SadReactionFragment();
                        AngryTab = new AngryReactionFragment();

                        Bundle args = new Bundle();
                        args.PutString("NamePage", TypeClass);

                        LikeTab  = new LikeReactionFragment();
                        LoveTab  = new LoveReactionFragment();
                        HahaTab  = new HahaReactionFragment();
                        WowTab   = new WowReactionFragment();
                        SadTab   = new SadReactionFragment();
                        AngryTab = new AngryReactionFragment();

                        LikeTab.Arguments  = args;
                        LoveTab.Arguments  = args;
                        HahaTab.Arguments  = args;
                        WowTab.Arguments   = args;
                        SadTab.Arguments   = args;
                        AngryTab.Arguments = args;

                        Adapter.AddFragment(LikeTab, GetText(Resource.String.Btn_Likes));
                        Adapter.AddFragment(LoveTab, GetText(Resource.String.Btn_Love));
                        Adapter.AddFragment(HahaTab, GetText(Resource.String.Btn_Haha));
                        Adapter.AddFragment(WowTab, GetText(Resource.String.Btn_Wow));
                        Adapter.AddFragment(SadTab, GetText(Resource.String.Btn_Sad));
                        Adapter.AddFragment(AngryTab, GetText(Resource.String.Btn_Angry));     //wael
                        break;
                    }
                    }
                    //else
                    //{
                    //    if (PostData.Reaction.Like > 0 || PostData.Reaction.Like1 > 0)
                    //    {
                    //        LikeTab = new LikeReactionFragment();
                    //        Adapter.AddFragment(LikeTab, GetText(Resource.String.Btn_Likes));
                    //    }

                    //    if (PostData.Reaction.Love > 0 || PostData.Reaction.Love2 > 0)
                    //    {
                    //        LoveTab = new LoveReactionFragment();
                    //        Adapter.AddFragment(LoveTab, GetText(Resource.String.Btn_Love));
                    //    }

                    //    if (PostData.Reaction.HaHa > 0 || PostData.Reaction.HaHa3 > 0)
                    //    {
                    //        HahaTab = new HahaReactionFragment();
                    //        Adapter.AddFragment(HahaTab, GetText(Resource.String.Btn_Haha));
                    //    }

                    //    if (PostData.Reaction.Wow > 0 || PostData.Reaction.Wow4 > 0)
                    //    {
                    //        WowTab = new WowReactionFragment();
                    //        Adapter.AddFragment(WowTab, GetText(Resource.String.Btn_Wow));
                    //    }

                    //    if (PostData.Reaction.Sad > 0 || PostData.Reaction.Sad5 > 0)
                    //    {
                    //        SadTab = new SadReactionFragment();
                    //        Adapter.AddFragment(SadTab, GetText(Resource.String.Btn_Sad));
                    //    }

                    //    if (PostData.Reaction.Angry > 0 || PostData.Reaction.Angry6 > 0)
                    //    {
                    //        AngryTab = new AngryReactionFragment();
                    //        Adapter.AddFragment(AngryTab, GetText(Resource.String.Btn_Angry));
                    //    }
                    //}

                    viewPager.CurrentItem        = Adapter.ItemCount;
                    viewPager.OffscreenPageLimit = Adapter.ItemCount;

                    viewPager.Orientation = ViewPager2.OrientationHorizontal;
                    viewPager.RegisterOnPageChangeCallback(new MyOnPageChangeCallback(this));
                    viewPager.Adapter = Adapter;
                    viewPager.Adapter.NotifyDataSetChanged();
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }