mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-02 22:41:18 +08:00
Android: Add support for having borders on <Text> & <TextInput> components
Summary: Currently, `<Text>` and `<TextInput>` components on Android do not support borders. This change adds support for the borderRadius, borderColor, and borderWidth props on the `<Text>` and `<TextInput>` components on Android. ReactViewGroup already implements this functionality so we copied its implementation over into the ReactTextView and ReactEditText classes. **Test plan (required)** Verified that the various border props work on Text and TextInput components in a test app. Adam Comella Microsoft Corp. Closes https://github.com/facebook/react-native/pull/9658 Differential Revision: D3819993 Pulled By: lexs fbshipit-source-id: 183b0aa95369dd781f03b5a1f0f409ab47284e39
This commit is contained in:
committed by
Facebook Github Bot 4
parent
afde9da93d
commit
28ba749ba0
@@ -38,6 +38,7 @@ import com.facebook.react.uimanager.UIImplementation;
|
||||
import com.facebook.react.uimanager.UIManagerModule;
|
||||
import com.facebook.react.uimanager.ViewManager;
|
||||
import com.facebook.react.uimanager.ViewProps;
|
||||
import com.facebook.react.views.view.ReactViewBackgroundDrawable;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
@@ -343,7 +344,7 @@ public class ReactTextTest {
|
||||
JavaOnlyMap.of(ReactTextShadowNode.PROP_TEXT, "test text"));
|
||||
|
||||
Drawable backgroundDrawable = ((TextView) rootView.getChildAt(0)).getBackground();
|
||||
assertThat(((ColorDrawable) backgroundDrawable).getColor()).isEqualTo(Color.BLUE);
|
||||
assertThat(((ReactViewBackgroundDrawable) backgroundDrawable).getColor()).isEqualTo(Color.BLUE);
|
||||
}
|
||||
|
||||
// JELLY_BEAN is needed for TextView#getMaxLines(), which is OK, because in the actual code we
|
||||
|
||||
Reference in New Issue
Block a user