private void SetRecyclerViewAdapters()
        {
            try
            {
                MAdapter = new MentionAdapter(this)
                {
                    MentionList = new ObservableCollection <UserDataObject>(),
                };
                LayoutManager = new LinearLayoutManager(this);
                MRecycler.SetLayoutManager(LayoutManager);
                MRecycler.HasFixedSize = true;
                MRecycler.SetItemViewCacheSize(10);
                MRecycler.GetLayoutManager().ItemPrefetchEnabled = true;
                MRecycler.SetAdapter(MAdapter);

                RecyclerViewOnScrollListener xamarinRecyclerViewOnScrollListener = new RecyclerViewOnScrollListener(LayoutManager);
                MainScrollEvent = xamarinRecyclerViewOnScrollListener;
                MainScrollEvent.LoadMoreEvent += MainScrollEventOnLoadMoreEvent;
                MRecycler.AddOnScrollListener(xamarinRecyclerViewOnScrollListener);
                MainScrollEvent.IsLoading = false;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        private void DestroyBasic()
        {
            try
            {
                MAdView?.Destroy();
                InterstitialAd?.Destroy();

                MAdapter           = null;
                SwipeRefreshLayout = null;
                MRecycler          = null;
                EmptyStateLayout   = null;
                Inflated           = null;
                MainScrollEvent    = null;
                BtnAction          = null;
                ToolBar            = null;
                SearchText         = null;
                MAdView            = null;
                InterstitialAd     = null;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemple #3
0
        private void DestroyBasic()
        {
            try
            {
                MAdView?.Destroy();
                InterstitialAd?.Destroy();

                MAdapter           = null !;
                SwipeRefreshLayout = null !;
                MRecycler          = null !;
                EmptyStateLayout   = null !;
                Inflated           = null !;
                MainScrollEvent    = null !;
                BtnAction          = null !;
                ToolBar            = null !;
                SearchText         = null !;
                MAdView            = null !;
                InterstitialAd     = null !;
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Exemple #4
0
        public void LoadContacts()
        {
            try
            {
                var dbDatabase = new SqLiteDatabase();
                var localList  = dbDatabase.Get_MyContact(0, 25);
                if (localList != null)
                {
                    var list = localList.Select(user => new Mention
                    {
                        user_id            = user.user_id,
                        username           = user.username,
                        email              = user.email,
                        first_name         = user.first_name,
                        last_name          = user.last_name,
                        avatar             = user.avatar,
                        cover              = user.cover,
                        relationship_id    = user.relationship_id,
                        lastseen_time_text = user.lastseen_time_text,
                        address            = user.address,
                        working            = user.working,
                        working_link       = user.working_link,
                        about              = user.about,
                        school             = user.school,
                        gender             = user.gender,
                        birthday           = user.birthday,
                        website            = user.website,
                        facebook           = user.facebook,
                        google             = user.google,
                        twitter            = user.twitter,
                        linkedin           = user.linkedin,
                        youtube            = user.youtube,
                        vk                      = user.vk,
                        instagram               = user.instagram,
                        language                = user.language,
                        ip_address              = user.ip_address,
                        follow_privacy          = user.follow_privacy,
                        friend_privacy          = user.friend_privacy,
                        post_privacy            = user.post_privacy,
                        message_privacy         = user.message_privacy,
                        confirm_followers       = user.confirm_followers,
                        show_activities_privacy = user.show_activities_privacy,
                        birth_privacy           = user.birth_privacy,
                        visit_privacy           = user.visit_privacy,
                        lastseen                = user.lastseen,
                        showlastseen            = user.showlastseen,
                        e_sentme_msg            = user.e_sentme_msg,
                        e_last_notif            = user.e_last_notif,
                        status                  = user.status,
                        active                  = user.active,
                        admin                   = user.admin,
                        registered              = user.registered,
                        phone_number            = user.phone_number,
                        is_pro                  = user.is_pro,
                        pro_type                = user.pro_type,
                        joined                  = user.joined,
                        timezone                = user.timezone,
                        referrer                = user.referrer,
                        balance                 = user.balance,
                        paypal_email            = user.paypal_email,
                        notifications_sound     = user.notifications_sound,
                        order_posts_by          = user.order_posts_by,
                        social_login            = user.social_login,
                        device_id               = user.device_id,
                        web_device_id           = user.web_device_id,
                        wallet                  = user.wallet,
                        lat                     = user.lat,
                        lng                     = user.lng,
                        last_location_update    = user.last_location_update,
                        share_my_location       = user.share_my_location,
                        url                     = user.url,
                        name                    = user.name,
                        lastseen_unix_time      = user.lastseen_unix_time,
                        user_platform           = user.user_platform,
                        Selected                = false
                    }).ToList();

                    MentionsAdapter = new MentionAdapter(this, new JavaList <Mention>(list));
                    MentionRecylerView.SetLayoutManager(new LinearLayoutManager(this));
                    MentionRecylerView.SetAdapter(MentionsAdapter);

                    if (MentionsAdapter.MentionList.Count > 0)
                    {
                        MentionsAdapter.NotifyDataSetChanged();

                        //Contacts_Empty.Visibility = ViewStates.Gone;
                        //ContactsRecyler.Visibility = ViewStates.Visible;
                    }
                }

                dbDatabase.Dispose();
            }
            catch (Exception e)
            {
                Crashes.TrackError(e);
            }
        }