private void Loadonresume()
        {
            try
            {
                ContactName = ContactRepository.GetContactbyUserId(Convert.ToInt64(contactViewModel.ContactId)).name;
                contactId   = contactViewModel.ContactId;
                if (InternetConnectivityModel.CheckConnection())
                {
                    loadSignalR();
                }

                InvokeOnMainThread(() =>
                {
                    paginationModel.SkipRecords = 0;
                    paginationModel.TakeRecords = 30;
                    LoadLocalLatestMessages();
                });

                if (InternetConnectivityModel.CheckConnection())
                {
                    LoadServerMessagesUpto(DateTime.UtcNow);
                }
            }
            catch (Exception e)
            {
                //Crashes.TrackError(e);
            }
        }
        private void Loadonresume()
        {
            try
            {
                if (InternetConnectivityModel.CheckConnection())
                {
                    loadGroupSignalR();
                }
                InvokeOnMainThread(() =>
                {
                    paginationModel.SkipRecords = 0;
                    paginationModel.TakeRecords = 30;
                    LoadLocalLatestMessages();
                });

                if (InternetConnectivityModel.CheckConnection())
                {
                    LoadServerMessagesUpto(DateTime.UtcNow);
                }
            }
            catch (Exception e)
            {
                Crashes.TrackError(e);
            }
        }
예제 #3
0
        private void Loadonresume()
        {
            try
            {
                // Create your application here
                GroupObject            = JsonConvert.DeserializeObject <GroupModel>(Intent.GetStringExtra("GroupObject"));
                SupportActionBar.Title = GroupObject.GroupName;
                if (InternetConnectivityModel.CheckConnection(this))
                {
                    loadGroupSignalR();
                }
                RunOnUiThread(() =>
                {
                    paginationModel.SkipRecords = 0;
                    paginationModel.TakeRecords = 30;
                    LoadLocalLatestMessages();
                });

                if (InternetConnectivityModel.CheckConnection(this))
                {
                    LoadServerMessagesUpto(DateTime.UtcNow);
                }
            }
            catch (Exception e)
            {
                Crashes.TrackError(e);
            }
        }
        private void Loadonresume()
        {
            try
            {
                // Create your application here
                ContactObject = JsonConvert.DeserializeObject <ContactViewModel>(Intent.GetStringExtra("ContactObject"));
                ContactName   = ContactRepository.GetContactbyUserId(Convert.ToInt64(ContactObject.ContactId)).name;
                contactId     = ContactObject.ContactId;
                if (InternetConnectivityModel.CheckConnection(this))
                {
                    loadSignalR();
                }
                RunOnUiThread(() =>
                {
                    paginationModel.SkipRecords = 0;
                    paginationModel.TakeRecords = 30;
                    LoadLocalLatestMessages();
                });

                if (InternetConnectivityModel.CheckConnection(this))
                {
                    LoadServerMessagesUpto(DateTime.UtcNow);
                }
            }
            catch (Exception e)
            {
                Crashes.TrackError(e);
            }
        }
예제 #5
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            Title = "READ";

            searchBar              = CommonSearchView.Create();
            searchBar.TextChanged += (sender, e) =>
            {
                searchBooks();
            };
            searchBar.CancelButtonClicked  += SearchBar_CancelButtonClicked;
            tblBookReadList.TableHeaderView = searchBar;

            paginationModel.Status = 1;
            if (InternetConnectivityModel.CheckConnection())
            {
                
            {
                    
                LoadServerBooks(); 

                }
            }
            
 else
            {
                
 paginationModel.SkipRecords = 0; 
 paginationModel.TakeRecords = 30; 
                loadBookAdapter(); 

            }
        }
 public void OnClick(View v)
 {
     if (InternetConnectivityModel.CheckConnection(context, true))
     {
         BooksMapViewModel _model = new BooksMapViewModel();
         _model.BookId = obitmobEvent.BookId;
         _model.IsRead = 0;
         _model.UserId = CommonHelper.GetUserId();
         SaveBook(_model);
     }
 }
 partial void BtnWishList_TouchUpInside(UIButton sender)
 {
     if (InternetConnectivityModel.CheckConnection(true))
     {
         BooksMapViewModel _model = new BooksMapViewModel();
         _model.BookId = book.BookId;
         _model.IsRead = 0;
         _model.UserId = CommonHelper.GetUserId();
         SaveWishListBook(_model);
     }
 }
예제 #8
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate(Resource.Layout.Read_Fragment, container, false);

            HasOptionsMenu         = true;
            paginationModel.Status = 1; // 0 = WishList ,  1 = Read , 2 = All
            mRecyclerView          = view.FindViewById <RecyclerView>(Resource.Id.ReadBookList);
            if (mRecyclerView != null)
            {
                mRecyclerView.HasFixedSize = true;
                var layoutManager    = new LinearLayoutManager(this.Context);
                var onScrollListener = new XamarinRecyclerViewOnScrollListener(layoutManager);
                onScrollListener.LoadMoreEvent += (object sender, bool loadCalled) =>
                {
                    if (loadCalled)
                    {
                        if (loadList && !(BookList.Count < 30))
                        {
                            Toast.MakeText(this.Context, "Loading More Books...", ToastLength.Long).Show();
                            if (InternetConnectivityModel.CheckConnection(this.Context))
                            {
                                LoadMoreBooks();
                            }
                            else
                            {
                                LoadMoreBooksOffline();
                            }
                        }
                    }
                };
                mRecyclerView.AddOnScrollListener(onScrollListener);
                mRecyclerView.SetLayoutManager(layoutManager);
            }
            paginationModel.SkipRecords = 0;
            mRecyclerView.Click        += MRecyclerView_Click;
            FloatingActionButton fabAddBook = view.FindViewById <FloatingActionButton>(Resource.Id.fabAddBook);

            fabAddBook.Click += FabAddBook_Click;
            if (InternetConnectivityModel.CheckConnection(this.Context))
            {
                LoadServerBooks();
            }
            else
            {
                paginationModel.SkipRecords = 0;
                paginationModel.TakeRecords = 30;
                loadBookAdapter();
            }
            return(view);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.AddContactslayout);

            var toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.app_bar);

            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            SupportActionBar.SetTitle(Resource.String.AddContacts);
            paginationModel.Status = 2;

            mRecyclerView = FindViewById <RecyclerView>(Resource.Id.ContactList);
            if (mRecyclerView != null)
            {
                mRecyclerView.HasFixedSize = true;
                var layoutManager    = new LinearLayoutManager(this);
                var onScrollListener = new XamarinRecyclerViewOnScrollListener(layoutManager);
                onScrollListener.LoadMoreEvent += (object sender, bool loadCalled) =>
                {
                    if (loadCalled)
                    {
                        if (loadList)
                        {
                            Toast.MakeText(this, "Loading More Contacts...", ToastLength.Long).Show();
                            if (InternetConnectivityModel.CheckConnection(this))
                            {
                                if (String.IsNullOrEmpty(paginationModel.SearchText))
                                {
                                    LoadMoreContacts();
                                }
                            }
                            else
                            {
                                // LoadMoreBooksOffline();
                            }
                        }
                    }
                };
                mRecyclerView.AddOnScrollListener(onScrollListener);
                mRecyclerView.SetLayoutManager(layoutManager);
            }
            paginationModel.SkipRecords = 0;
            if (InternetConnectivityModel.CheckConnection(this, true))
            {
                LoadServerContacts();
            }
        }
 void BookShelfWishListsource_ReloadList(object sender, long e)
 {
     if (loadList && !(BookList.Count < 30))
     {
         CustomToast.Show(Message: "Loading More Books", Default: true);
         if (InternetConnectivityModel.CheckConnection())
         {
             LoadMoreBooks();
         }
         else
         {
             LoadMoreBooksOffline();
         }
     }
 }
        private async void Loadonresume()
        {
            if (InternetConnectivityModel.CheckConnection())
            {
                loadSignalR();
            }

            InvokeOnMainThread(() =>
            {
                LoadLocalChats();
            });

            if (InternetConnectivityModel.CheckConnection())
            {
                LoaderAsyncfromserver();
            }
        }
        private async Task Loadonresume()
        {
            try
            {
                InvokeOnMainThread(() =>
                {
                    loadadapter();
                });

                if (InternetConnectivityModel.CheckConnection())
                {
                    GetMyContactsFromServer();
                }
            }
            catch (Exception ex)
            {
                Crashes.TrackError(ex);
            }
        }
예제 #13
0
        private async void Loadonresume()
        {
            try
            {
                Activity.RunOnUiThread(() =>
                {
                    loadadapter();
                });

                if (InternetConnectivityModel.CheckConnection(this.Context))
                {
                    GetMyContactsFromServer();
                }
            }
            catch (Exception ex)
            {
                Crashes.TrackError(ex);
            }
        }
예제 #14
0
        private async void Loadonresume()
        {
            if (IsVisible == true)
            {
                if (InternetConnectivityModel.CheckConnection(this.Context))
                {
                    loadSignalR();
                }

                Activity.RunOnUiThread(() =>
                {
                    LoadLocalChats();
                });

                if (InternetConnectivityModel.CheckConnection(this.Context))
                {
                    LoaderAsyncfromserver();
                }
            }
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            Title     = "ADD CONTACTS";
            searchBar = CommonSearchView.Create();

            searchBar.SearchButtonClicked += SearchBar_SearchButtonClicked;
            searchBar.CancelButtonClicked += SearchBar_CancelButtonClicked;
            tblAddContacts.TableHeaderView = searchBar;
            paginationModel.Status         = 2;
            if (InternetConnectivityModel.CheckConnection())
            {
                LoadServerContacts();
            }
            else
            {
                paginationModel.SkipRecords = 0;
                paginationModel.TakeRecords = 30;
            }
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            searchBar              = CommonSearchView.Create();
            searchBar.TextChanged += (sender, e) =>
            {
                searchBooks();
            };
            searchBar.CancelButtonClicked  += SearchBar_CancelButtonClicked;
            tblBookWishList.TableHeaderView = searchBar;
            Title = "WISH LIST";
            paginationModel.Status = 0;
            if (InternetConnectivityModel.CheckConnection())
            {
                LoadServerBooks();
            }
            else
            {
                paginationModel.SkipRecords = 0;
                paginationModel.TakeRecords = 30;
                loadBookAdapter();
            }
        }