Skip to content

Commit 43e7c29

Browse files
committed
cpp mapbuffer configs before rebase
1 parent 7fa58f5 commit 43e7c29

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ public class TextAttributeProps {
104104
protected @Nullable ReactAccessibilityDelegate.AccessibilityRole mAccessibilityRole = null;
105105
protected boolean mIsAccessibilityRoleSet = false;
106106
protected boolean mIsAccessibilityUnitSet = false;
107-
protected @Nullable ReactAccessibilityDelegate.AccessibilityUnit mAccessibilityUnit = "";
107+
protected @Nullable ReactAccessibilityDelegate.AccessibilityUnit mAccessibilityUnit =
108+
ReactAccessibilityDelegate.AccessibilityUnit.NONE;
108109
protected boolean mIsAccessibilityLink = false;
109110

110111
protected int mFontStyle = UNSET;

ReactAndroid/src/main/java/com/facebook/react/views/view/ReactMapBufferPropSetter.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
package com.facebook.react.views.view
9-
9+
import android.util.Log;
1010
import android.graphics.Color
1111
import android.graphics.Rect
1212
import androidx.core.view.ViewCompat
@@ -64,6 +64,7 @@ object ReactMapBufferPropSetter {
6464
private const val VP_POINTER_OVER_CAPTURE = 44
6565
private const val VP_BORDER_CURVES = 45 // iOS only
6666
private const val VP_FG_COLOR = 46 // iOS only?
67+
private const val VP_ACCESSIBILITY_UNIT = 99
6768

6869
// Yoga values
6970
private const val YG_BORDER_WIDTH = 100
@@ -108,6 +109,7 @@ object ReactMapBufferPropSetter {
108109

109110
fun setProps(view: ReactViewGroup, viewManager: ReactViewManager, props: MapBuffer) {
110111
for (entry in props) {
112+
Log.w("TESTING::ReactMapBufferPropSetter", "entry.key: " + ( entry.key ));
111113
when (entry.key) {
112114
VP_ACCESSIBILITY_ACTIONS -> {
113115
viewManager.accessibilityActions(view, entry.mapBufferValue)
@@ -240,6 +242,9 @@ object ReactMapBufferPropSetter {
240242
VP_ZINDEX -> {
241243
viewManager.setZIndex(view, entry.intValue.toFloat())
242244
}
245+
VP_ACCESSIBILITY_UNIT -> {
246+
viewManager.setAccessibilityUnit(view, entry.stringValue.takeIf { it.isNotEmpty() })
247+
}
243248
YG_BORDER_WIDTH -> {
244249
viewManager.borderWidth(view, entry.mapBufferValue)
245250
}

ReactCommon/react/renderer/components/view/AccessibilityPropsMapBuffer.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,6 @@ void AccessibilityProps::propsDiffMapBuffer(
127127
builder.putString(AP_ACCESSIBILITY_ROLE, newProps.accessibilityRole);
128128
}
129129

130-
if (oldProps.accessibilityUnit != newProps.accessibilityUnit) {
131-
builder.putString(AP_ACCESSIBILITY_UNIT, newProps.accessibilityUnit);
132-
}
133-
134130
if (oldProps.accessibilityState != newProps.accessibilityState) {
135131
builder.putMapBuffer(
136132
AP_ACCESSIBILITY_STATE,
@@ -165,6 +161,9 @@ void AccessibilityProps::propsDiffMapBuffer(
165161
}
166162
builder.putInt(AP_IMPORTANT_FOR_ACCESSIBILITY, value);
167163
}
164+
if (oldProps.accessibilityUnit != newProps.accessibilityUnit) {
165+
builder.putString(AP_ACCESSIBILITY_UNIT, newProps.accessibilityUnit);
166+
}
168167
}
169168
#endif
170169

ReactCommon/react/renderer/components/view/AccessibilityPropsMapBuffer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ constexpr MapBuffer::Key AP_ACCESSIBILITY_STATE = 6;
2323
constexpr MapBuffer::Key AP_ACCESSIBILITY_VALUE = 7;
2424
constexpr MapBuffer::Key AP_ACCESSIBLE = 8;
2525
constexpr MapBuffer::Key AP_IMPORTANT_FOR_ACCESSIBILITY = 19;
26-
constexpr MapBuffer::Key AP_ACCESSIBILITY_UNIT = 20;
26+
constexpr MapBuffer::Key AP_ACCESSIBILITY_UNIT = 99;
2727

2828
// AccessibilityAction values
2929
constexpr MapBuffer::Key ACCESSIBILITY_ACTION_NAME = 0;

0 commit comments

Comments
 (0)