From adc14105727f708c990b7a744a0ea270ff0fba13 Mon Sep 17 00:00:00 2001 From: Dulmandakh Date: Wed, 6 Feb 2019 11:55:18 -0800 Subject: [PATCH] ReactPicker extends AppCompatSpinner (#23303) Summary: Google recommends to extend AppCompat widget, and this PR changes ReactPicker to extend AppCompatSpinner. [Android] [Changed] - ReactPicker extends AppCompatSpinner Pull Request resolved: https://github.com/facebook/react-native/pull/23303 Differential Revision: D13973918 Pulled By: cpojer fbshipit-source-id: f925994eb631815c7461ed519701cd77e7068f38 --- .../src/androidTest/java/com/facebook/react/tests/BUCK | 1 + .../src/main/java/com/facebook/react/views/picker/BUCK | 4 ++++ .../java/com/facebook/react/views/picker/ReactPicker.java | 5 +++-- .../main/third-party/android/support/v7/appcompat-orig/BUCK | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ReactAndroid/src/androidTest/java/com/facebook/react/tests/BUCK b/ReactAndroid/src/androidTest/java/com/facebook/react/tests/BUCK index a80f3f40e..7266b1d2c 100644 --- a/ReactAndroid/src/androidTest/java/com/facebook/react/tests/BUCK +++ b/ReactAndroid/src/androidTest/java/com/facebook/react/tests/BUCK @@ -7,6 +7,7 @@ rn_android_library( "PUBLIC", ], deps = [ + react_native_dep("third-party/android/support/v7/appcompat-orig:appcompat"), react_native_dep("third-party/android/support/v4:lib-support-v4"), react_native_dep("third-party/java/jsr-305:jsr-305"), react_native_dep("third-party/java/junit:junit"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/picker/BUCK b/ReactAndroid/src/main/java/com/facebook/react/views/picker/BUCK index 2b9cfcc3f..15edc7a1a 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/picker/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/views/picker/BUCK @@ -6,6 +6,10 @@ rn_android_library( visibility = [ "PUBLIC", ], + provided_deps = [ + react_native_dep("third-party/android/support/v4:lib-support-v4"), + react_native_dep("third-party/android/support/v7/appcompat-orig:appcompat"), + ], deps = [ react_native_dep("third-party/java/infer-annotations:infer-annotations"), react_native_dep("third-party/java/jsr-305:jsr-305"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/picker/ReactPicker.java b/ReactAndroid/src/main/java/com/facebook/react/views/picker/ReactPicker.java index b1d7578ff..5bb2330ed 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/picker/ReactPicker.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/picker/ReactPicker.java @@ -8,6 +8,7 @@ package com.facebook.react.views.picker; import android.content.Context; +import android.support.v7.widget.AppCompatSpinner; import android.util.AttributeSet; import android.view.View; import android.widget.AdapterView; @@ -17,9 +18,9 @@ import com.facebook.react.common.annotations.VisibleForTesting; import javax.annotation.Nullable; -public class ReactPicker extends Spinner { +public class ReactPicker extends AppCompatSpinner { - private int mMode = MODE_DIALOG; + private int mMode = Spinner.MODE_DIALOG; private @Nullable Integer mPrimaryColor; private @Nullable OnSelectListener mOnSelectListener; private @Nullable Integer mStagedSelection; diff --git a/ReactAndroid/src/main/third-party/android/support/v7/appcompat-orig/BUCK b/ReactAndroid/src/main/third-party/android/support/v7/appcompat-orig/BUCK index 25d67547d..53a572042 100644 --- a/ReactAndroid/src/main/third-party/android/support/v7/appcompat-orig/BUCK +++ b/ReactAndroid/src/main/third-party/android/support/v7/appcompat-orig/BUCK @@ -19,7 +19,7 @@ rn_android_library( ":res-for-appcompat", ], exported_deps = [ - ":classes-for-react-native", + ":classes-for-react-native" ], )