private void setUpTvEllipsize3() { SpannableString moreText = new SpannableString("***"); moreText.SetSpan(new ForegroundColorSpan(Color.Green), 0, moreText.Length(), SpanTypes.ExclusiveExclusive); mTvEllipsize3.SetEllipsizeText(moreText, 8); mTvEllipsize3.SetText(Resource.String.long_text); }
private void setUpTvEllipsize1() { SpannableString moreText = new SpannableString("..."); moreText.SetSpan(new ForegroundColorSpan(Color.Magenta), 0, moreText.Length(), SpanTypes.ExclusiveExclusive); mTvEllipsize1.SetEllipsizeText(moreText, 0); mTvEllipsize1.SetText(Resource.String.long_text); }
private void setUpTvEllipsize4() { string timeText = " 1 minute ago"; SpannableString timeLongText = new SpannableString(GetString(Resource.String.long_text) + timeText); timeLongText.SetSpan(new TextAppearanceSpan(this, Resource.Style.time_style), timeLongText.Length() - timeText.Length, timeLongText.Length(), SpanTypes.ExclusiveExclusive); SpannableString moreText = new SpannableString("...more"); moreText.SetSpan(new EllipsizeSpan(mTvEllipsize4, timeLongText), 3, moreText.Length(), SpanTypes.ExclusiveExclusive); moreText.SetSpan(new TextAppearanceSpan(this, Resource.Style.link_style), 3, moreText.Length(), SpanTypes.ExclusiveExclusive); mTvEllipsize4.MovementMethod = LinkMovementMethod.Instance; mTvEllipsize4.SetText(timeLongText, TextView.BufferType.Normal); mTvEllipsize4.SetEllipsizeText(moreText, timeText.Length); }