예제 #1
0
 protected override void OnDetached()
 {
     try
     {
         control.ClearColorFilter();
     }
     catch { }
 }
예제 #2
0
        void SetImageViewTintColor(ImageView image, Forms.Color color)
        {
            if (color == Forms.Color.Default)
            {
                image.ClearColorFilter();
            }

            image.SetColorFilter(new PorterDuffColorFilter(color.ToAndroid(), PorterDuff.Mode.SrcIn ?? throw new NullReferenceException()));
        }
예제 #3
0
        void SetImageViewTintColor(ImageView image, Forms.Color color)
        {
            if (color == Forms.Color.Default)
            {
                image.ClearColorFilter();
            }

            image.SetColorFilter(new PorterDuffColorFilter(color.ToAndroid(), PorterDuff.Mode.SrcIn));
        }
예제 #4
0
 public static void SetConditionalColorFilter(this ImageView view, bool condition)
 {
     if (condition)
     {
         view.SetColorFilter(App.Context.Resources.GetColor(Resource.Color.theme_primary));
     }
     else
     {
         view.ClearColorFilter();
     }
 }
예제 #5
0
        private void OnSwitchSpeakerClicked(ImageView button)
        {
            if (button.Selected)
            {
                button.Selected = false;
                button.ClearColorFilter();
            }
            else
            {
                button.Selected = true;
                button.SetColorFilter(Resources.GetColor(Resource.Color.colorPrimary), PorterDuff.Mode.Multiply);
            }

            _rtcEngine.SetEnableSpeakerphone(button.Selected);
        }
예제 #6
0
        private void OnMuteClicked(ImageView button)
        {
            if (button.Selected)
            {
                button.Selected = false;
                button.ClearColorFilter();
            }
            else
            {
                button.Selected = true;
                button.SetColorFilter(Resources.GetColor(Resource.Color.colorPrimary), PorterDuff.Mode.Multiply);
            }

            _rtcEngine.MuteLocalAudioStream(button.Selected);
        }
예제 #7
0
        private async Task AnimateFailedTryAsync()
        {
            if (_icon == null)
            {
                return;
            }

            _icon.SetColorFilter(NegativeColor);
            var shake = ObjectAnimator.OfFloat(_icon, "translationX", -10f, 10f);

            shake.SetDuration(500);
            shake.SetInterpolator(new CycleInterpolator(5));
            await shake.StartAsync();

            _icon.ClearColorFilter();
        }
        public static async Task PulseGridItem(ImageView imageView)
        {
            var animatedValue = 0;
            var loop          = 3;

            do
            {
                imageView.SetColorFilter(Color.Argb(animatedValue, 255, 255, 255), PorterDuff.Mode.Multiply);
                animatedValue += 40;
                await Task.Delay(100);

                if (animatedValue > 100)
                {
                    animatedValue = 0;
                    loop--;
                }
            } while (loop > 0);
            imageView.ClearColorFilter();
        }
 void Animation.IAnimationListener.OnAnimationEnd(Animation animation)
 {
     _icon.ClearColorFilter();
 }