private long CalculateCroutonDuration(Crouton crouton)
 {
     long croutonDuration = crouton.DurationInMilliseconds;
     croutonDuration += crouton.GetInAnimation().Duration;
     croutonDuration += crouton.GetOutAnimation().Duration;
     return croutonDuration;
 }
Exemplo n.º 2
0
        private long CalculateCroutonDuration(Crouton crouton)
        {
            long croutonDuration = crouton.DurationInMilliseconds;

            croutonDuration += crouton.GetInAnimation().Duration;
            croutonDuration += crouton.GetOutAnimation().Duration;
            return(croutonDuration);
        }
Exemplo n.º 3
0
        private void CallOnGlobalLayout(Crouton crouton, View croutonView)
        {
            var layoutListener = new GlobalLayoutListener();

            layoutListener.OnGlobalLayout(delegate
            {
                if (Build.VERSION.SdkInt < Build.VERSION_CODES.JellyBean)
                {
                    croutonView.ViewTreeObserver.RemoveGlobalOnLayoutListener(layoutListener);
                }
                else
                {
                    croutonView.ViewTreeObserver.RemoveOnGlobalLayoutListener(layoutListener);
                }

                if (crouton.GetInAnimation() != null)
                {
                    croutonView.StartAnimation(crouton.GetInAnimation());
                    AnnounceForAccessibilityCompat(crouton.GetActivity(), crouton.DataContext == null ? "NULL" : crouton.DataContext.ToString());
                    SendMessageDelayed(crouton, REMOVE_CROUTON,
                                       crouton.DurationInMilliseconds + crouton.GetInAnimation().Duration);
                }
            });
        }
        private void CallOnGlobalLayout(Crouton crouton, View croutonView)
        {
            var layoutListener = new GlobalLayoutListener();
            layoutListener.OnGlobalLayout(delegate
            {
                if (Build.VERSION.SdkInt < Build.VERSION_CODES.JellyBean)
                {
                    croutonView.ViewTreeObserver.RemoveGlobalOnLayoutListener(layoutListener);
                }
                else
                {
                    croutonView.ViewTreeObserver.RemoveOnGlobalLayoutListener(layoutListener);
                }

                if (crouton.GetInAnimation() != null)
                {
                    croutonView.StartAnimation(crouton.GetInAnimation());
                    AnnounceForAccessibilityCompat(crouton.GetActivity(), crouton.DataContext == null ? "NULL" : crouton.DataContext.ToString());
                    SendMessageDelayed(crouton, REMOVE_CROUTON,
                    crouton.DurationInMilliseconds + crouton.GetInAnimation().Duration);
                }
            });
        }