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
This commit is contained in:
Dulmandakh 2019-02-06 11:55:18 -08:00 committed by Facebook Github Bot
parent 3cca9e76c5
commit adc1410572
4 changed files with 9 additions and 3 deletions

View File

@ -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"),

View File

@ -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"),

View File

@ -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;

View File

@ -19,7 +19,7 @@ rn_android_library(
":res-for-appcompat",
],
exported_deps = [
":classes-for-react-native",
":classes-for-react-native"
],
)