本文整理汇总了C#中Android.Append方法的典型用法代码示例。如果您正苦于以下问题:C# Android.Append方法的具体用法?C# Android.Append怎么用?C# Android.Append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android
的用法示例。
在下文中一共展示了Android.Append方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleTag
public void HandleTag( Boolean opening, String tag, Android.Text.IEditable output, IXMLReader xmlReader)
{
if (opening) {
// opening tag
// if (HtmlTextView.DEBUG) {
// Log.d(HtmlTextView.TAG, "opening, output: " + output.ToString());
// }
//
if (tag.ToLower() == "ul") {
lists.Push(tag);
} else if (tag.Equals("ol")) {
lists.Push(tag);
olNextIndex.Push(1);
} else if (tag.Equals("li")) {
if (output.Length() > 0 && output.CharAt(output.Length() - 1) != '\n') {
output.Append("\n");
}
String parentList = lists.Peek();
if (parentList.Equals("ol")) {
start(output, new Ol());
output.Append(olNextIndex.Peek().ToString()).Append('.').Append(' ');
olNextIndex.Push(olNextIndex.Pop() + 1);
} else if (parentList.Equals("ul")) {
start(output, new Ul());
}
} else if (tag.Equals("code")) {
start(output, new Code());
} else if (tag.Equals("center")) {
start(output, new Center());
} else if (tag.Equals("s") || tag.Equals("strike")) {
start(output, new Strike());
}
} else {
// closing tag
// if (HtmlTextView.DEBUG) {
// Log.d(HtmlTextView.TAG, "closing, output: " + output.ToString());
// }
//
if (tag.Equals("ul")) {
lists.Pop();
} else if (tag.Equals("ol")) {
lists.Pop();
olNextIndex.Pop();
} else if (tag.Equals("li")) {
if (lists.Peek().Equals("ul")) {
if (output.Length() > 0 && output.CharAt(output.Length() - 1) != '\n') {
output.Append("\n");
}
// Nested BulletSpans increases distance between bullet and Text, so we must prevent it.
int bulletMargin = indent;
if (lists.Count > 1) {
bulletMargin = indent - bullet.GetLeadingMargin(true);
if (lists.Count > 2) {
// This get's more complicated when we add a LeadingMarginSpan into the same line:
// we have also counter it's effect to BulletSpan
bulletMargin -= (lists.Count - 2) * listItemIndent;
}
}
BulletSpan newBullet = new BulletSpan(bulletMargin);
end(output, typeof(Ul), false,
new LeadingMarginSpanStandard(listItemIndent * (lists.Count - 1)),
newBullet);
} else if (lists.Peek().Equals("ol")) {
if (output.Length() > 0 && output.CharAt(output.Length() - 1) != '\n') {
output.Append("\n");
}
int numberMargin = listItemIndent * (lists.Count - 1);
if (lists.Count > 2) {
// Same as in ordered lists: counter the effect of nested Spans
numberMargin -= (lists.Count - 2) * listItemIndent;
}
end(output, typeof(Ol), false, new LeadingMarginSpanStandard(numberMargin));
}
} else if (tag.Equals("code")) {
end(output, typeof(Code), false, new TypefaceSpan("monospace"));
} else if (tag.Equals("center")) {
end(output, typeof(Center), true, new AlignmentSpanStandard(Layout.Alignment.AlignCenter));
} else if (tag.Equals("s") || tag.Equals("strike")) {
end(output, typeof(Strike), false, new StrikethroughSpan());
}
}
}