From ee38f43feaf2a25d3adfb76561c572fa12e98f92 Mon Sep 17 00:00:00 2001 From: iPel Date: Thu, 16 Nov 2023 00:31:10 +0800 Subject: [PATCH] feat(android): deprecate `underlineColorAndroid` prop --- docs/api/hippy-react/components.md | 1 - docs/api/hippy-vue/components.md | 1 - .../mtt/hippy/views/textinput/HippyTextInput.java | 11 +---------- .../views/textinput/HippyTextInputController.java | 6 ------ 4 files changed, 1 insertion(+), 18 deletions(-) diff --git a/docs/api/hippy-react/components.md b/docs/api/hippy-react/components.md index 62854f358f7..79b4e75aea9 100644 --- a/docs/api/hippy-react/components.md +++ b/docs/api/hippy-react/components.md @@ -338,7 +338,6 @@ import icon from './qb_icon_new.png'; | placeholder | 如果没有任何文字输入,会显示此字符串。 | `string` | `Android、iOS、hippy-react-web、Web-Renderer、Voltron` | | placeholderTextColor | 占位字符串显示的文字颜色。(也可设置为 Style 属性)`最低支持版本2.13.4` | [`color`](api/style/color.md) | `Android、iOS、Web-Renderer、Voltron` | | returnKeyType | 指定软键盘的回车键显示的样式。(其中部分样式仅`multiline=false`时有效) | `enum (done, go, next, search, send)` | `Android、iOS、Web-Renderer、Voltron` | -| underlineColorAndroid | `TextInput` 下底线的颜色。 可以设置为 'transparent' 来去掉下底线。(也可设置为 Style 属性) | [`color`](api/style/color.md) | `Android` | | value | 指定 `TextInput` 组件的值。 | `string` | `Android、iOS、hippy-react-web、Web-Renderer、Voltron` | | autoFocus | 组件渲染时自动获得焦点。 | `boolean` | `Android、iOS、hippy-react-web、Web-Renderer、Voltron` | | breakStrategy* | 设置Android API 23及以上系统的文本折行策略。`default: simple` | `enum(simple, high_quality, balanced)` | `Android(版本 2.14.2以上)` | diff --git a/docs/api/hippy-vue/components.md b/docs/api/hippy-vue/components.md index ebf0b27e556..2798dc62468 100644 --- a/docs/api/hippy-vue/components.md +++ b/docs/api/hippy-vue/components.md @@ -257,7 +257,6 @@ | numberOfLines | 设置 `input` 最大显示行数,如果 `input` 没有显式设置高度,会根据 `numberOfLines` 来计算高度撑开。在使用的时候必需同时设置 `multiline` 参数为 `true`。 | `number` | `Android、Voltron、Web-Renderer` | | placeholder | 如果没有任何文字输入,会显示此字符串。 | `string` | `Android、iOS、Web-Renderer、Voltron` | | placeholder-text-color | 占位字符串显示的文字颜色。(也可设置为 Style 属性) `最低支持版本2.13.4` | [`color`](api/style/color.md) | `Android、iOS、Web-Renderer、Voltron` | -| underline-color-android | `input` 下底线的颜色。 可以设置为 'transparent' 来去掉下底线。(也可设置为 Style 属性) `最低支持版本2.13.4` | [`color`](api/style/color.md) | `Android` | | returnKeyType | 指定软键盘的回车键显示的样式。(其中部分样式仅对单行文本组件有效) | `enum(done, go, next, search, send)` | `Android、iOS、Web-Renderer` | | value | 指定 `input` 组件的值。 | `string` | `Android、iOS、Web-Renderer、Voltron` | | break-strategy* | 设置Android API 23及以上系统的文本换行策略。`default: simple` | `enum(simple, high_quality, balanced)` | `Android(版本 2.14.2以上)` | diff --git a/renderer/native/android/src/main/java/com/tencent/mtt/hippy/views/textinput/HippyTextInput.java b/renderer/native/android/src/main/java/com/tencent/mtt/hippy/views/textinput/HippyTextInput.java index a2e27d495a4..9c3bd567bdc 100644 --- a/renderer/native/android/src/main/java/com/tencent/mtt/hippy/views/textinput/HippyTextInput.java +++ b/renderer/native/android/src/main/java/com/tencent/mtt/hippy/views/textinput/HippyTextInput.java @@ -104,6 +104,7 @@ public HippyTextInput(Context context) { ViewGroup.LayoutParams.MATCH_PARENT)); setPadding(0, 0, 0, 0); setGravityVertical(Gravity.CENTER_VERTICAL); + setBackground(null); } @Override @@ -472,16 +473,6 @@ public void afterTextChanged(Editable s) { } } - @Override - public void setBackgroundColor(int color) { - int paddingBottom = getPaddingBottom(); - int paddingTop = getPaddingTop(); - int paddingLeft = getPaddingLeft(); - int paddingRight = getPaddingRight(); - // Android这个EditText控件默认带有内边距,设置背景时系统也可能会再把它默认的内边距给加上去。这里强制去掉内边距 - setPadding(paddingLeft, paddingTop, paddingRight, paddingBottom); - } - @Override public NativeGestureDispatcher getGestureDispatcher() { return null; diff --git a/renderer/native/android/src/main/java/com/tencent/mtt/hippy/views/textinput/HippyTextInputController.java b/renderer/native/android/src/main/java/com/tencent/mtt/hippy/views/textinput/HippyTextInputController.java index 465efe4178a..40ab6422a02 100644 --- a/renderer/native/android/src/main/java/com/tencent/mtt/hippy/views/textinput/HippyTextInputController.java +++ b/renderer/native/android/src/main/java/com/tencent/mtt/hippy/views/textinput/HippyTextInputController.java @@ -334,12 +334,6 @@ public void setMaxLines(HippyTextInput input, int numberOfLine) { input.setMaxLines(numberOfLine); } - - @HippyControllerProps(name = "underlineColorAndroid", defaultType = HippyControllerProps.NUMBER, defaultNumber = Color.TRANSPARENT) - public void setUnderlineColor(HippyTextInput hippyTextInput, int underlineColor) { - //hippyTextInput.setUnderlineColor(underlineColor); - } - @HippyControllerProps(name = "changetext", defaultType = HippyControllerProps.BOOLEAN) public void setOnChangeText(HippyTextInput hippyTextInput, boolean change) { hippyTextInput.setOnChangeListener(change);