Exemplo n.º 1
0
        public static bool IsPartial(TextView tv)
        {
            SimpleExpandableTextViewUtilty tag = tv.Tag as SimpleExpandableTextViewUtilty;

            if (tag == null)
            {
                throw new InvalidOperationException("Unable to handle a TextView without Tag.");
            }

            return(tag.isPartial);
        }
Exemplo n.º 2
0
        public static bool IsPartial(TextView tv, bool defaultValue)
        {
            SimpleExpandableTextViewUtilty tag = tv.Tag as SimpleExpandableTextViewUtilty;

            if (tag == null)
            {
                return(defaultValue);
            }

            return(tag.isPartial);
        }
Exemplo n.º 3
0
        public static bool ExceedMaxLines(TextView tv)
        {
            SimpleExpandableTextViewUtilty tag = tv.Tag as SimpleExpandableTextViewUtilty;

            if (tag == null)
            {
                throw new InvalidOperationException("Unable to handle a TextView without Tag.");
            }

            return(tag.lineCount > tag.maxLines);
        }
Exemplo n.º 4
0
        public static void Collapse(TextView tv)
        {
            SimpleExpandableTextViewUtilty tag = tv.Tag as SimpleExpandableTextViewUtilty;

            if (tag == null)
            {
                throw new InvalidOperationException("Unable to handle a TextView without Tag.");
            }

            tag.isPartial = true;
            //tv.Ellipsize = tag.ellipsize;
            tv.SetMaxLines(tag.maxLines);
        }
Exemplo n.º 5
0
        public static void Expand(TextView tv)
        {
            SimpleExpandableTextViewUtilty tag = tv.Tag as SimpleExpandableTextViewUtilty;

            if (tag == null)
            {
                throw new InvalidOperationException("Unable to handle a TextView without Tag.");
            }

            tag.isPartial = false;
            //tv.Ellipsize = null;
            tv.SetMaxLines(Int32.MaxValue);
        }
Exemplo n.º 6
0
        public static bool IsExpandable(TextView tv)
        {
            SimpleExpandableTextViewUtilty tag = tv.Tag as SimpleExpandableTextViewUtilty;

            return(tag != null);
        }