Exemplo n.º 1
0
        public override Java.Lang.ICharSequence FilterFormatted(Java.Lang.ICharSequence source, int start, int end, ISpanned dest, int dstart, int dend)
        {
            for (var x = start; x < end; x++)
            {
                if (char.IsUpper(source.ElementAt(x)))
                {
                    var v = new char[end - start];
                    TextUtils.GetChars(source.ToString(), start, end, v, 0);
                    var s = new string(v).ToLower(CultureInfo.InvariantCulture);

                    if (source is ISpanned sourceSpanned)
                    {
                        var sp = new SpannableString(s);
                        TextUtils.CopySpansFrom(sourceSpanned, start, end, null, sp, 0);
                        return(sp);
                    }
                    else
                    {
                        return(new Java.Lang.String(s));
                    }
                }
            }

            return(null);
        }