public void Get_MyFollowers() { try { if (Settings.ConnectivitySystem == "1") // Following { SupportActionBar.Title = GetText(Resource.String.Lbl_People_Followers); } else // Friend { SupportActionBar.Title = GetText(Resource.String.Lbl_Friends); } //Get All User From Database var dbDatabase = new SqLiteDatabase(); var localList = dbDatabase.Get_MyFollowers(); if (localList != null) { UserFollowersList = new ObservableCollection <Get_User_Data_Object.Followers>(localList); var list = new JavaList <Get_User_Data_Object.Followers>(localList.OrderBy(a => a.name)); if (list.Count > 0) { //Set Adapter ContactsLayoutManager = new LinearLayoutManager(this); ContactsRecyler.SetLayoutManager(ContactsLayoutManager); MyFollowersAdapter = new MyFollowers_Adapter(this, list, ContactsRecyler); ContactsRecyler.SetAdapter(MyFollowersAdapter); MyFollowersAdapter.ItemClick += MyFollowersAdapter_OnItemClick; MyFollowersAdapter.BindEnd(); } } //Show Empty Page >> //=============================================================== if (MyFollowersAdapter.mMyFollowersList.Count > 0) { swipeRefreshLayout.Refreshing = false; Contacts_Empty.Visibility = ViewStates.Gone; ContactsRecyler.Visibility = ViewStates.Visible; } else { swipeRefreshLayout.Refreshing = false; Contacts_Empty.Visibility = ViewStates.Visible; ContactsRecyler.Visibility = ViewStates.Gone; } dbDatabase.Dispose(); } catch (Exception e) { Crashes.TrackError(e); } }
public void Get_UsersContact() { try { //swipeRefreshLayout.Refreshing = true; //swipeRefreshLayout.Enabled = true; if (Type_Contacts == "UserProfile") { var list = new JavaList <Get_User_Data_Object.Followers>(UserFriendsAdapter.mAllUserFriendsList?.OrderBy(a => a.name)); if (list?.Count > 0) { //Set Adapter ContactsLayoutManager = new LinearLayoutManager(this); ContactsRecyler.SetLayoutManager(ContactsLayoutManager); UserContactsAdapter = new UserContacts_Adapter(this, list, ContactsRecyler); ContactsRecyler.SetAdapter(UserContactsAdapter); UserContactsAdapter.ItemClick += ContactAdapter_OnItemClick; UserContactsAdapter.BindEnd(); if (UserContactsAdapter.mUsersContactsList.Count > 0) { Contacts_Empty.Visibility = ViewStates.Gone; ContactsRecyler.Visibility = ViewStates.Visible; } else { Contacts_Empty.Visibility = ViewStates.Visible; ContactsRecyler.Visibility = ViewStates.Gone; } } else { Contacts_Empty.Visibility = ViewStates.Visible; ContactsRecyler.Visibility = ViewStates.Gone; } } else { Contacts_Empty.Visibility = ViewStates.Visible; ContactsRecyler.Visibility = ViewStates.Gone; } } catch (Exception e) { Crashes.TrackError(e); } }
protected override void OnCreate(Bundle savedInstanceState) { try { base.OnCreate(savedInstanceState); IMethods.IApp.FullScreenApp(this); var view = MyContextWrapper.GetContentView(this, Settings.Lang, Resource.Layout.Contacts_Main_Layout); if (view != null) { SetContentView(view); } else { SetContentView(Resource.Layout.Contacts_Main_Layout); } ContactsRecyler = FindViewById <RecyclerView>(Resource.Id.Recyler); swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout); Contacts_Empty = FindViewById <LinearLayout>(Resource.Id.Contacts_LinerEmpty); var ToolBar = FindViewById <Toolbar>(Resource.Id.toolbar); if (ToolBar != null) { if (Settings.ConnectivitySystem == "1") // Following { ToolBar.Title = GetText(Resource.String.Lbl_Following); } else // Friend { ToolBar.Title = GetText(Resource.String.Lbl_Friends); } ToolBar.SetSubtitleTextColor(Color.White); SetSupportActionBar(ToolBar); SupportActionBar.SetDisplayShowCustomEnabled(true); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetDisplayShowHomeEnabled(true); } swipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight); Icon_UserContacts = FindViewById <TextView>(Resource.Id.Contactsusers_icon); Btn_SearchRandom = FindViewById <Button>(Resource.Id.SearchRandom_Button); IMethods.Set_TextViewIcon("1", Icon_UserContacts, IonIcons_Fonts.IosPeopleOutline); Icon_UserContacts.SetTextColor(Color.ParseColor(Settings.MainColor)); ContactsLayoutManager = new LinearLayoutManager(this); ContactsRecyler.SetLayoutManager(ContactsLayoutManager); ContactsRecyler.HasFixedSize = (true); ContactsRecyler.SetItemViewCacheSize(10); ContactsRecyler.GetLayoutManager().ItemPrefetchEnabled = true; ContactsRecyler.DrawingCacheEnabled = (true); ContactsRecyler.DrawingCacheQuality = DrawingCacheQuality.High; Contacts_Empty.Visibility = ViewStates.Gone; ContactsRecyler.Visibility = ViewStates.Visible; var ContactsType = Intent.GetStringExtra("ContactsType") ?? "Data not available"; if (ContactsType != "Data not available" && !string.IsNullOrEmpty(ContactsType)) { Type_Contacts = ContactsType; } if (Type_Contacts == "Following") { Get_MyContact(); } else { Get_MyFollowers(); } //Show Ads AdsGoogle.Ad_Interstitial(this); } catch (Exception e) { Crashes.TrackError(e); } }