public bool SetFav(TextView favButton) { try { CommentsAdapter.MyBounceInterpolator interpolator = new CommentsAdapter.MyBounceInterpolator(0.2, 20); var animationScale = AnimationUtils.LoadAnimation(MainContext, Resource.Animation.scale); animationScale.Interpolator = interpolator; if (favButton.Tag.ToString() == "Added") { favButton.StartAnimation(animationScale); favButton.SetTextColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#888888") : Color.ParseColor("#444444")); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, favButton, IonIconsFonts.IosStarOutline); favButton.Tag = "Add"; return(false); } else { favButton.StartAnimation(animationScale); favButton.SetTextColor(Color.ParseColor("#FFCE00")); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, favButton, IonIconsFonts.AndroidStar); favButton.Tag = "Added"; return(true); } } catch (Exception exception) { Console.WriteLine(exception); return(false); } }
public bool SetLike(TextView likeButton) { try { CommentsAdapter.MyBounceInterpolator interpolator = new CommentsAdapter.MyBounceInterpolator(0.2, 20); var animationScale = AnimationUtils.LoadAnimation(MainContext, Resource.Animation.scale); animationScale.Interpolator = interpolator; if (likeButton.Tag.ToString() == "Liked") { likeButton.StartAnimation(animationScale); likeButton.SetTextColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#888888") : Color.ParseColor("#444444")); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, likeButton, IonIconsFonts.IosHeartOutline); likeButton.Tag = "Like"; return(false); } else { likeButton.StartAnimation(animationScale); likeButton.SetTextColor(Color.ParseColor("#ed4856")); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, likeButton, IonIconsFonts.IosHeart); likeButton.Tag = "Liked"; likeButton.StartAnimation(animationScale); return(true); } } catch (Exception exception) { Console.WriteLine(exception); return(false); } }