Ejemplo n.º 1
0
        //Refresh
        private void SwipeRefreshLayoutOnRefresh(object sender, EventArgs e)
        {
            try
            {
                MAdapter.NotificationsList.Clear();
                MAdapter.NotifyDataSetChanged();

                if (MainScrollEvent != null)
                {
                    MainScrollEvent.IsLoading = false;
                }

                MRecycler.Visibility        = ViewStates.Visible;
                EmptyStateLayout.Visibility = ViewStates.Gone;

                if (!Methods.CheckConnectivity())
                {
                    Toast.MakeText(Context, Context.GetString(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short)?.Show();
                }
                else
                {
                    PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                        () => LoadGeneralData(true)
                    });
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
Ejemplo n.º 2
0
        private void SwipeRefreshLayoutOnRefresh(object sender, EventArgs e)
        {
            try
            {
                //Get Data Api
                MAdapter.NotificationsList.Clear();
                MAdapter.NotifyDataSetChanged();

                StartApiService();
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
        //Refresh
        private void SwipeRefreshLayoutOnRefresh(object sender, EventArgs e)
        {
            try
            {
                MAdapter.NotificationsList.Clear();
                MAdapter.NotifyDataSetChanged();

                MRecycler.Visibility        = ViewStates.Visible;
                EmptyStateLayout.Visibility = ViewStates.Gone;

                StartApiService();
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Ejemplo n.º 4
0
        private void VisitsButtonOnClick(object sender, EventArgs e)
        {
            try
            {
                MAdapter.NotificationsList.Clear();

                MAdapter.NotificationsList = ListUtils.VisitsList;
                MAdapter.NotifyDataSetChanged();

                ToolbarView.SetBackgroundResource(Resource.Drawable.Shape_Gradient_Normal);
                VisitsImage.SetColorFilter(Color.ParseColor("#ffffff"));
                VisitsTextView.SetTextColor(Color.ParseColor(AppSettings.MainColor));
                VisitsLayout.SetBackgroundResource(Resource.Drawable.Shape_Radius_Gradient_Btn);
                VisitsButton.Tag = "Clicked";

                ResetTabsButtonOnVistsClick();

                if (MAdapter.NotificationsList.Count > 0)
                {
                    MRecycler.Visibility        = ViewStates.Visible;
                    EmptyStateLayout.Visibility = ViewStates.Gone;
                }

                if (Methods.CheckConnectivity())
                {
                    PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                        () => LoadVisitsAsync()
                    });
                }


                if (Build.VERSION.SdkInt < BuildVersionCodes.Lollipop)
                {
                    return;
                }

                Activity.Window.ClearFlags(WindowManagerFlags.TranslucentStatus);
                Activity.Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);
                Activity.Window.SetStatusBarColor(Color.ParseColor(AppSettings.MainColor));
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }