mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
36037fa81b
Summary: related: https://github.com/facebook/react-native/issues/30846, https://github.com/facebook/react-native/issues/26739 Added `accessibilityLabelledBy` props to find the nativeID of the associated label, it mainly for` <TextInput> `. The reason for implementing it as `labelledBy` instead of `labelFor` is as follows. - It was difficult to find a component with `labelFor` because the `<Text>` component does not add the `labelFor` received from her Props to the View's tag. - The use case looks like the HTML `aria-labelledby`, which is intuitive for web developers. It also seems easy to convert to a web platform. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [Android] [Added] - add `accessibilityLabelledBy` props Pull Request resolved: https://github.com/facebook/react-native/pull/32470 Test Plan: I checked it with RNTester using an Android11. https://user-images.githubusercontent.com/40130327/138666856-891d9f4d-52cf-4181-a81f-13b033037db4.mp4 Reviewed By: lunaleaps, kacieb Differential Revision: D31897112 Pulled By: ShikaSD fbshipit-source-id: 66361735679560c01834b3a4483adf264098b3e3
101 lines
2.9 KiB
Java
101 lines
2.9 KiB
Java
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
package com.facebook.react.uimanager;
|
|
|
|
import android.view.View;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
import com.facebook.react.bridge.Dynamic;
|
|
import com.facebook.react.bridge.ReadableArray;
|
|
import com.facebook.react.bridge.ReadableMap;
|
|
|
|
public abstract class BaseViewManagerAdapter<T extends View>
|
|
implements BaseViewManagerInterface<T> {
|
|
@Override
|
|
public void setAccessibilityActions(@NonNull T view, ReadableArray accessibilityActions) {}
|
|
|
|
@Override
|
|
public void setAccessibilityHint(@NonNull T view, String accessibilityHint) {}
|
|
|
|
@Override
|
|
public void setAccessibilityLabel(@NonNull T view, String accessibilityLabel) {}
|
|
|
|
@Override
|
|
public void setAccessibilityLiveRegion(@NonNull T view, @Nullable String liveRegion) {}
|
|
|
|
@Override
|
|
public void setAccessibilityRole(@NonNull T view, @Nullable String accessibilityRole) {}
|
|
|
|
@Override
|
|
public void setViewState(@NonNull T view, @Nullable ReadableMap accessibilityState) {}
|
|
|
|
@Override
|
|
public void setBackgroundColor(@NonNull T view, int backgroundColor) {}
|
|
|
|
@Override
|
|
public void setBorderRadius(@NonNull T view, float borderRadius) {}
|
|
|
|
@Override
|
|
public void setBorderBottomLeftRadius(@NonNull T view, float borderRadius) {}
|
|
|
|
@Override
|
|
public void setBorderBottomRightRadius(@NonNull T view, float borderRadius) {}
|
|
|
|
@Override
|
|
public void setBorderTopLeftRadius(@NonNull T view, float borderRadius) {}
|
|
|
|
@Override
|
|
public void setBorderTopRightRadius(@NonNull T view, float borderRadius) {}
|
|
|
|
@Override
|
|
public void setElevation(@NonNull T view, float elevation) {}
|
|
|
|
@Override
|
|
public void setShadowColor(@NonNull T view, int shadowColor) {}
|
|
|
|
@Override
|
|
public void setImportantForAccessibility(
|
|
@NonNull T view, @Nullable String importantForAccessibility) {}
|
|
|
|
@Override
|
|
public void setNativeId(@NonNull T view, String nativeId) {}
|
|
|
|
@Override
|
|
public void setAccessibilityLabelledBy(@NonNull T view, Dynamic nativeId) {}
|
|
|
|
@Override
|
|
public void setOpacity(@NonNull T view, float opacity) {}
|
|
|
|
@Override
|
|
public void setRenderToHardwareTexture(@NonNull T view, boolean useHWTexture) {}
|
|
|
|
@Override
|
|
public void setRotation(@NonNull T view, float rotation) {}
|
|
|
|
@Override
|
|
public void setScaleX(@NonNull T view, float scaleX) {}
|
|
|
|
@Override
|
|
public void setScaleY(@NonNull T view, float scaleY) {}
|
|
|
|
@Override
|
|
public void setTestId(@NonNull T view, String testId) {}
|
|
|
|
@Override
|
|
public void setTransform(@NonNull T view, @Nullable ReadableArray matrix) {}
|
|
|
|
@Override
|
|
public void setTranslateX(@NonNull T view, float translateX) {}
|
|
|
|
@Override
|
|
public void setTranslateY(@NonNull T view, float translateY) {}
|
|
|
|
@Override
|
|
public void setZIndex(@NonNull T view, float zIndex) {}
|
|
}
|