Refactor TextLayoutManager.isRTL() method
Summary: Quick refactor of refactor TextLayoutManager.isRTL() method to cleanup the method and remove lint warning changelog: [internal] internal Reviewed By: javache Differential Revision: D43888197 fbshipit-source-id: 779fb84527f95b3c04504eaa4302be55ab328634
This commit is contained in:
Родитель
9ee0e1c78e
Коммит
8c3cb4e6db
|
@ -72,11 +72,12 @@ public class TextLayoutManager {
|
|||
|
||||
public static boolean isRTL(ReadableMap attributedString) {
|
||||
ReadableArray fragments = attributedString.getArray("fragments");
|
||||
for (int i = 0; i < fragments.size(); i++) {
|
||||
ReadableMap fragment = fragments.getMap(i);
|
||||
if (fragments != null && fragments.size() > 0) {
|
||||
ReadableMap fragment = fragments.getMap(0);
|
||||
ReadableMap map = fragment.getMap("textAttributes");
|
||||
return TextAttributeProps.getLayoutDirection(map.getString(ViewProps.LAYOUT_DIRECTION))
|
||||
== LayoutDirection.RTL;
|
||||
return map != null
|
||||
&& TextAttributeProps.getLayoutDirection(map.getString(ViewProps.LAYOUT_DIRECTION))
|
||||
== LayoutDirection.RTL;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче