public static void MakeTextViewResizable( TextView tv, int maxLines, bool isPartial, ISimpleExpandableTextViewListerner listerner) { tv.ViewTreeObserver.AddOnGlobalLayoutListener( new SimpleExpandableTextViewUtilty( tv, maxLines, isPartial, listerner)); }
//private readonly Android.Text.TextUtils.TruncateAt ellipsize; public SimpleExpandableTextViewUtilty( TextView tv, int maxLines, bool isPartial, ISimpleExpandableTextViewListerner listerner) { this.tv = tv; this.maxLines = maxLines; this.listerner = listerner; this.isPartial = isPartial; //ellipsize = Android.Text.TextUtils.TruncateAt.End; tv.Tag = this; }
public static void MakeTextViewResizable( TextView tv, int maxLines, ISimpleExpandableTextViewListerner listerner, AutoLinkOptions autoLinkOptions, bool isPartial = true) { tv.Tag = new ExpandableTextViewTag() { Text = tv.Text, MaxLines = maxLines, ClickSwitch = false, IsPartial = isPartial, Listerner = listerner, AutoLinkOptions = autoLinkOptions, ViewMoreLessOptions = null, }; init(tv); }