Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(android): spinner buttons invisible #673

Merged
merged 1 commit into from
Oct 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public MinuteIntervalSnappableTimePickerDialog(
RNTimePickerDisplay display
) {
super(context, listener, hourOfDay, minute, is24HourView);
setCanceledOnTouchOutside(true);
mTimePickerInterval = minuteInterval;
mTimeSetListener = listener;
mDisplay = display;
Expand All @@ -51,6 +52,7 @@ public MinuteIntervalSnappableTimePickerDialog(
RNTimePickerDisplay display
) {
super(context, theme, listener, hourOfDay, minute, is24HourView);
setCanceledOnTouchOutside(true);
mTimePickerInterval = minuteInterval;
mTimeSetListener = listener;
mDisplay = display;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public RNDismissableDatePickerDialog(
int dayOfMonth,
RNDatePickerDisplay display) {
super(context, callback, year, monthOfYear, dayOfMonth);
setCanceledOnTouchOutside(true);
fixSpinner(context, year, monthOfYear, dayOfMonth, display);
}

Expand All @@ -52,6 +53,7 @@ public RNDismissableDatePickerDialog(
int dayOfMonth,
RNDatePickerDisplay display) {
super(context, theme, callback, year, monthOfYear, dayOfMonth);
setCanceledOnTouchOutside(true);
fixSpinner(context, year, monthOfYear, dayOfMonth, display);
}

Expand Down
10 changes: 6 additions & 4 deletions android/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="SpinnerDatePickerDialog" parent="Theme.AppCompat.Light.Dialog" tools:targetApi="lollipop">
<style name="SpinnerDatePickerDialog" tools:targetApi="lollipop">
<item name="android:datePickerStyle">@style/SpinnerDatePickerStyle</item>
<item name="android:windowIsFloating">true</item>
</style>

<style name="SpinnerDatePickerStyle" parent="android:Widget.Material.Light.DatePicker" tools:targetApi="lollipop">
<style name="SpinnerDatePickerStyle" parent="android:Widget.Material.DatePicker" tools:targetApi="lollipop">
<item name="android:datePickerMode">spinner</item>
</style>

Expand All @@ -24,11 +25,12 @@
<item name="android:timePickerMode">clock</item>
</style>

<style name="SpinnerTimePickerDialog" parent="Theme.AppCompat.Light.Dialog" tools:targetApi="lollipop">
<style name="SpinnerTimePickerDialog" tools:targetApi="lollipop">
<item name="android:timePickerStyle">@style/SpinnerTimePickerStyle</item>
<item name="android:windowIsFloating">true</item>
</style>

<style name="SpinnerTimePickerStyle" parent="android:Widget.Material.Light.TimePicker" tools:targetApi="lollipop">
<style name="SpinnerTimePickerStyle" parent="android:Widget.Material.TimePicker" tools:targetApi="lollipop">
<item name="android:timePickerMode">spinner</item>
</style>
</resources>
15 changes: 10 additions & 5 deletions example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,16 @@ export const App = () => {
setShow(false);
}
if (event.type === 'dismissed') {
Alert.alert('picker was dismissed', undefined, [
{
text: 'great',
},
]);
Alert.alert(
'picker was dismissed',
undefined,
[
{
text: 'great',
},
],
{cancelable: true},
);
return;
}

Expand Down