コード例 #1
0
        private void DestroyBasic()
        {
            try
            {
                MAdView?.Destroy();
                RewardedVideoAd?.OnDestroy(this);

                MAdapter           = null;
                SwipeRefreshLayout = null;
                MRecycler          = null;
                EmptyStateLayout   = null;
                Inflated           = null;
                RewardedVideoAd    = null;
                MAdView            = null;
                AdapterModelsClass = null;
                FollowersModel     = null;
                GroupsModel        = null;
                PagesModel         = null;
                ImagesModel        = null;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
コード例 #2
0
        private void DestroyBasic()
        {
            try
            {
                MAdView?.Destroy();


                MAdapter           = null !;
                SwipeRefreshLayout = null !;
                MRecycler          = null !;
                EmptyStateLayout   = null !;
                Inflated           = null !;

                MAdView            = null !;
                AdapterModelsClass = null !;
                FollowersModel     = null !;
                GroupsModel        = null !;
                PagesModel         = null !;
                ImagesModel        = null !;
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
コード例 #3
0
        public void PagesBoxPostView(PagesModelClass modelClass, int index)
        {
            var item = new AdapterModelsClass
            {
                TypeView   = PostModelType.PagesBox,
                Id         = 333333333,
                PagesModel = modelClass
            };

            if (index == -1)
            {
                PostList.Add(item);
                AddPostDivider();
            }
            else
            {
                PostList.Insert(index, item);
                AddPostDivider(PostList.IndexOf(item) + 1);
            }
        }
コード例 #4
0
        private void SetData()
        {
            try
            {
                var item = Intent.GetStringExtra("itemObject");
                if (string.IsNullOrEmpty(item))
                {
                    return;
                }

                switch (Type)
                {
                case "MangedGroupsModel":
                case "MangedPagesModel":
                {
                    if (MAdapter is SearchGroupAdapter adapter1)
                    {
                        GroupsModel = JsonConvert.DeserializeObject <GroupsModelClass>(item);
                        if (GroupsModel != null)
                        {
                            adapter1.GroupList = new ObservableCollection <GroupClass>(GroupsModel.GroupsList);
                            adapter1.NotifyDataSetChanged();
                        }
                    }
                    else if (MAdapter is SearchPageAdapter adapter2)
                    {
                        PagesModel = JsonConvert.DeserializeObject <PagesModelClass>(item);
                        if (PagesModel != null)
                        {
                            adapter2.PageList = new ObservableCollection <PageClass>(PagesModel.PagesList);
                            adapter2.NotifyDataSetChanged();
                        }
                    }

                    break;
                }

                case "StoryModel":
                case "FollowersModel":
                case "GroupsModel":
                case "PagesModel":
                case "ImagesModel":
                {
                    if (MAdapter is SearchGroupAdapter adapter1)
                    {
                        GroupsModel = JsonConvert.DeserializeObject <GroupsModelClass>(item);
                        if (GroupsModel != null)
                        {
                            adapter1.GroupList = new ObservableCollection <GroupClass>(GroupsModel.GroupsList);
                            adapter1.NotifyDataSetChanged();
                        }
                    }
                    else if (MAdapter is SearchPageAdapter adapter2)
                    {
                        PagesModel = JsonConvert.DeserializeObject <PagesModelClass>(item);
                        if (PagesModel != null)
                        {
                            adapter2.PageList = new ObservableCollection <PageClass>(PagesModel.PagesList);
                            adapter2.NotifyDataSetChanged();
                        }
                    }
                    else if (MAdapter is ContactsAdapter adapter3)
                    {
                        FollowersModel = JsonConvert.DeserializeObject <FollowersModelClass>(item);
                        if (FollowersModel != null)
                        {
                            adapter3.UserList = new ObservableCollection <UserDataObject>(FollowersModel.FollowersList);
                            adapter3.NotifyDataSetChanged();
                        }
                    }
                    else if (MAdapter is RowStoryAdapter adapter4)
                    {
                        AdapterModelsClass = JsonConvert.DeserializeObject <AdapterModelsClass>(item);
                        if (AdapterModelsClass != null)
                        {
                            adapter4.StoryList = new ObservableCollection <GetUserStoriesObject.StoryObject>(AdapterModelsClass.StoryList);
                            adapter4.StoryList.Remove(adapter4.StoryList.FirstOrDefault(a => a.Type == "Your"));
                            adapter4.NotifyDataSetChanged();
                        }
                    }
                    else if (MAdapter is UserPhotosAdapter adapter5)
                    {
                        ImagesModel = JsonConvert.DeserializeObject <ImagesModelClass>(item);
                        if (ImagesModel != null)
                        {
                            adapter5.UserPhotosList = new ObservableCollection <PostDataObject>(ImagesModel.ImagesList);
                            adapter5.NotifyDataSetChanged();
                        }
                    }
                    break;
                }
                }

                if (MAdapter?.ItemCount > 0)
                {
                    MRecycler.Visibility        = ViewStates.Visible;
                    EmptyStateLayout.Visibility = ViewStates.Gone;
                }
                else
                {
                    ShowEmptyPage();
                }

                SwipeRefreshLayout.Refreshing = false;
                SwipeRefreshLayout.Enabled    = false;

                StartApiService();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                SwipeRefreshLayout.Refreshing = false;
                SwipeRefreshLayout.Enabled    = false;
            }
        }