use of com.mta.tehreer.unicode.BidiRun in project Tehreer-Android by mta452.
the class BidiInfoActivity method writeParagraphText.
private void writeParagraphText(SpannableStringBuilder builder, BidiParagraph paragraph, int index) {
int paragraphStart = paragraph.getCharStart();
int paragraphEnd = paragraph.getCharEnd();
int paragraphLength = paragraphEnd - paragraphStart;
String paragraphText = ((paragraph.getBaseLevel() & 1) == 1 ? RLI : LRI) + mBidiText.substring(paragraphStart, paragraphEnd) + PDI;
appendText(builder, "Paragraph " + index + "\n", spansFirstHeading());
appendText(builder, "Paragraph Text:", spansInlineHeading());
appendText(builder, " “" + paragraphText + "”\n");
appendText(builder, "Paragraph Range:", spansInlineHeading());
appendText(builder, " Start=" + paragraphStart + " Length=" + paragraphLength + "\n");
appendText(builder, "Base Level:", spansInlineHeading());
appendText(builder, " " + paragraph.getBaseLevel() + "\n\n");
int counter = 1;
for (BidiRun bidiRun : paragraph.getLogicalRuns()) {
writeRunText(builder, bidiRun, counter);
counter++;
}
BidiLine line = null;
try {
line = paragraph.createLine(paragraphStart, paragraphEnd);
writeLineText(builder, line);
writeMirrorsText(builder, line);
} finally {
if (line != null) {
line.dispose();
}
}
appendText(builder, "\n");
}
Aggregations