Skip to content
Permalink
Browse files
ReactEditText extends AppCompatEditText (#27039)
Summary:
Google recommends to extend AppCompat widgets, and Android Studio suggests the change. This PR changes ReactEditText to extend AppCompatEditText.

## Changelog

[Android] [Changed] - ReactEditText extends AppCompatEditText
Pull Request resolved: #27039

Test Plan: CI is green

Reviewed By: mdvacca

Differential Revision: D18196901

Pulled By: hramos

fbshipit-source-id: 1484ae3da1be5776d0431dab3d4bb7ddbe5b8b7c
  • Loading branch information
dulmandakh authored and facebook-github-bot committed Dec 12, 2019
1 parent f6edecc commit aaa2765a920de8234f0def4cae05ca5d6c8c8ac8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
@@ -4,13 +4,6 @@ rn_android_library(
name = "textinput",
srcs = glob(["*.java"]),
is_androidx = True,
provided_deps = [
react_native_dep("third-party/android/androidx:annotation"),
react_native_dep("third-party/android/androidx:core"),
react_native_dep("third-party/android/androidx:fragment"),
react_native_dep("third-party/android/androidx:legacy-support-core-ui"),
react_native_dep("third-party/android/androidx:legacy-support-core-utils"),
],
required_for_source_only_abi = True,
visibility = [
"PUBLIC",
@@ -31,4 +24,7 @@ rn_android_library(
react_native_target("java/com/facebook/react/views/text:text"),
react_native_target("java/com/facebook/react/views/view:view"),
],
exported_deps = [
react_native_dep("third-party/android/androidx:appcompat"),
],
)
@@ -30,8 +30,8 @@
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatEditText;
import androidx.core.view.AccessibilityDelegateCompat;
import androidx.core.view.ViewCompat;
import com.facebook.infer.annotation.Assertions;
@@ -59,7 +59,7 @@
* called this explicitly. This is the default behavior on other platforms as well.
* VisibleForTesting from {@link TextInputEventsTestCase}.
*/
public class ReactEditText extends EditText {
public class ReactEditText extends AppCompatEditText {

private final InputMethodManager mInputMethodManager;
// This flag is set to true when we set the text of the EditText explicitly. In that case, no

0 comments on commit aaa2765

Please sign in to comment.