public BidiFormatterAssert hasRtlContext() { isNotNull(); assertThat(actual.isRtlContext()) // .overridingErrorMessage("Expected RTL context but was not.") // .isTrue(); return this; }
/** * Joins a list of {@link CharSequence} into a single {@link CharSequence} seperated by a * localized delimiter such as ", ". * * @param resources Resources used to get list delimiter. * @param list List of char sequences to join. * @return Joined char sequences. */ public static CharSequence join(Resources resources, Iterable<CharSequence> list) { StringBuilder sb = new StringBuilder(); final BidiFormatter formatter = BidiFormatter.getInstance(); final CharSequence separator = resources.getString(R.string.list_delimeter); Iterator<CharSequence> itr = list.iterator(); boolean firstTime = true; while (itr.hasNext()) { if (firstTime) { firstTime = false; } else { sb.append(separator); } // Unicode wrap the elements of the list to respect RTL for individual strings. sb.append(formatter.unicodeWrap( itr.next().toString(), TextDirectionHeuristics.FIRSTSTRONG_LTR)); } // Unicode wrap the joined value, to respect locale's RTL ordering for the whole list. return formatter.unicodeWrap(sb.toString()); }
private Intent getCreateDocIntent() { final Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.setType(VCardService.X_VCARD_MIME_TYPE); intent.putExtra(Intent.EXTRA_TITLE, mBidiFormatter.unicodeWrap( getString(R.string.exporting_vcard_filename), TextDirectionHeuristics.LTR)); return intent; }
getContext().getResources().getString(R.string.phone_type_and_phone_number), mContact.getPhoneType(), BidiFormatter.getInstance().unicodeWrap(mContact.getPhoneNumber(), TextDirectionHeuristics.LTR)); setSummary(summary);
final String displayNumberStr = mBidiFormatter.unicodeWrap(displayNumber, TextDirectionHeuristics.LTR);
} else { menu.setHeaderTitle(PhoneNumberUtilsCompat.createTtsSpannable( BidiFormatter.getInstance().unicodeWrap(number, TextDirectionHeuristics.LTR)));
text = ContactDisplayUtils.getTtsSpannedPhoneNumber(resources, R.string.search_shortcut_call_number, mBidiFormatter.unicodeWrap(number, TextDirectionHeuristics.LTR)); drawableId = R.drawable.ic_search_phone; break;
public BidiFormatterAssert doesNotHaveRtlContext() { isNotNull(); assertThat(actual.isRtlContext()) // .overridingErrorMessage("Expected not to be RTL context but was.") // .isFalse(); return this; } }
final String displayNumberStr = mBidiFormatter.unicodeWrap( displayNumber.toString(), TextDirectionHeuristics.LTR);
public BidiFormatterAssert hasRtlContext() { isNotNull(); assertThat(actual.isRtlContext()) // .overridingErrorMessage("Expected RTL context but was not.") // .isTrue(); return this; }
public BidiFormatterAssert doesNotHaveRtlContext() { isNotNull(); assertThat(actual.isRtlContext()) // .overridingErrorMessage("Expected not to be RTL context but was.") // .isFalse(); return this; } }