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); }
public static bool IsPartial(TextView tv, bool defaultValue) { SimpleExpandableTextViewUtilty tag = tv.Tag as SimpleExpandableTextViewUtilty; if (tag == null) { return(defaultValue); } return(tag.isPartial); }
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); }
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); }
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); }
public static bool IsExpandable(TextView tv) { SimpleExpandableTextViewUtilty tag = tv.Tag as SimpleExpandableTextViewUtilty; return(tag != null); }