From 7d1c827cb2231e4091698a3d33addd067f40af7d Mon Sep 17 00:00:00 2001 From: Shen Jin Date: Fri, 24 May 2019 14:37:17 -0700 Subject: [PATCH] Fix spinner mode Summary: Okay, I think this is the best I can do David, I don't think there's an obvious/easy way for me to try to get `getIdentifier()` to return a non zero value. Setting it to what Spencer suggested works for my use case. ## Changelog [Android] [Changed] - Update spinner mode to render spinner instead of calendar Reviewed By: sahrens Differential Revision: D15427793 fbshipit-source-id: b04f024a9a1f052f69f3bda47d77821782dc2c0e --- .../react/modules/datepicker/DatePickerDialogFragment.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogFragment.java b/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogFragment.java index fdaa97fe3b7..70d4466ad00 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogFragment.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogFragment.java @@ -19,6 +19,7 @@ import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; import android.content.DialogInterface.OnDismissListener; +import android.graphics.drawable.ColorDrawable; import android.os.Build; import android.os.Bundle; import androidx.fragment.app.DialogFragment; @@ -69,8 +70,9 @@ public class DatePickerDialogFragment extends DialogFragment { break; case SPINNER: dialog = new DismissableDatePickerDialog(activityContext, - activityContext.getResources().getIdentifier("SpinnerDatePickerDialog", "style", activityContext.getPackageName()), + android.R.style.Theme_Holo_Light_Dialog, onDateSetListener, year, month, day); + dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT)); break; case DEFAULT: dialog = new DismissableDatePickerDialog(activityContext, onDateSetListener, year, month, day);