Add picker for ViewDescriptor
Summary: This diff uses the new picker defined in EnumMapping for regular Android View properties. Reviewed By: muraziz Differential Revision: D23538532 fbshipit-source-id: be5b776453e7322fb13a5f9e6a66a1f8d1243e79
This commit is contained in:
committed by
Facebook GitHub Bot
parent
c78bac3d90
commit
842fe6df5c
@@ -110,7 +110,7 @@ public class ViewDescriptor extends NodeDescriptor<View> {
|
|||||||
.put("height", InspectorValue.mutable(node.getHeight()))
|
.put("height", InspectorValue.mutable(node.getHeight()))
|
||||||
.put("width", InspectorValue.mutable(node.getWidth()))
|
.put("width", InspectorValue.mutable(node.getWidth()))
|
||||||
.put("alpha", InspectorValue.mutable(node.getAlpha()))
|
.put("alpha", InspectorValue.mutable(node.getAlpha()))
|
||||||
.put("visibility", sVisibilityMapping.get(node.getVisibility()))
|
.put("visibility", sVisibilityMapping.toPicker(node.getVisibility()))
|
||||||
.put("background", fromDrawable(node.getBackground()))
|
.put("background", fromDrawable(node.getBackground()))
|
||||||
.put("tag", InspectorValue.mutable(node.getTag()))
|
.put("tag", InspectorValue.mutable(node.getTag()))
|
||||||
.put("keyedTags", getTags(node))
|
.put("keyedTags", getTags(node))
|
||||||
@@ -157,9 +157,9 @@ public class ViewDescriptor extends NodeDescriptor<View> {
|
|||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||||
viewProps
|
viewProps
|
||||||
.put("layoutDirection", sLayoutDirectionMapping.get(node.getLayoutDirection()))
|
.put("layoutDirection", sLayoutDirectionMapping.toPicker(node.getLayoutDirection()))
|
||||||
.put("textDirection", sTextDirectionMapping.get(node.getTextDirection()))
|
.put("textDirection", sTextDirectionMapping.toPicker(node.getTextDirection()))
|
||||||
.put("textAlignment", sTextAlignmentMapping.get(node.getTextAlignment()));
|
.put("textAlignment", sTextAlignmentMapping.toPicker(node.getTextAlignment()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
@@ -595,14 +595,14 @@ public class ViewDescriptor extends NodeDescriptor<View> {
|
|||||||
|
|
||||||
if (layoutParams instanceof FrameLayout.LayoutParams) {
|
if (layoutParams instanceof FrameLayout.LayoutParams) {
|
||||||
final FrameLayout.LayoutParams frameLayoutParams = (FrameLayout.LayoutParams) layoutParams;
|
final FrameLayout.LayoutParams frameLayoutParams = (FrameLayout.LayoutParams) layoutParams;
|
||||||
params.put("gravity", sGravityMapping.get(frameLayoutParams.gravity));
|
params.put("gravity", sGravityMapping.toPicker(frameLayoutParams.gravity));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (layoutParams instanceof LinearLayout.LayoutParams) {
|
if (layoutParams instanceof LinearLayout.LayoutParams) {
|
||||||
final LinearLayout.LayoutParams linearLayoutParams = (LinearLayout.LayoutParams) layoutParams;
|
final LinearLayout.LayoutParams linearLayoutParams = (LinearLayout.LayoutParams) layoutParams;
|
||||||
params
|
params
|
||||||
.put("weight", InspectorValue.mutable(linearLayoutParams.weight))
|
.put("weight", InspectorValue.mutable(linearLayoutParams.weight))
|
||||||
.put("gravity", sGravityMapping.get(linearLayoutParams.gravity));
|
.put("gravity", sGravityMapping.toPicker(linearLayoutParams.gravity));
|
||||||
}
|
}
|
||||||
|
|
||||||
return params.build();
|
return params.build();
|
||||||
|
|||||||
@@ -578,7 +578,7 @@ public final class AccessibilityUtil {
|
|||||||
actionsArrayBuilder.put(actionLabel);
|
actionsArrayBuilder.put(actionLabel);
|
||||||
} else {
|
} else {
|
||||||
actionsArrayBuilder.put(
|
actionsArrayBuilder.put(
|
||||||
AccessibilityUtil.sAccessibilityActionMapping.get(action.getId(), false));
|
AccessibilityUtil.sAccessibilityActionMapping.toPicker(action.getId(), false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nodeInfoProps.put("actions", actionsArrayBuilder.build());
|
nodeInfoProps.put("actions", actionsArrayBuilder.build());
|
||||||
@@ -693,7 +693,7 @@ public final class AccessibilityUtil {
|
|||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
||||||
props.put(
|
props.put(
|
||||||
"important-for-accessibility",
|
"important-for-accessibility",
|
||||||
AccessibilityUtil.sImportantForAccessibilityMapping.get(
|
AccessibilityUtil.sImportantForAccessibilityMapping.toPicker(
|
||||||
view.getImportantForAccessibility()));
|
view.getImportantForAccessibility()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user