-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathRCTDateTimePicker.java
More file actions
40 lines (32 loc) · 1.35 KB
/
RCTDateTimePicker.java
File metadata and controls
40 lines (32 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.keyee.datetime;
import android.app.Activity;
import android.app.DialogFragment;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.ReadableMap;
public class RCTDateTimePicker extends ReactContextBaseJavaModule {
public RCTDateTimePicker(ReactApplicationContext reactContext) {
super(reactContext);
}
@Override
public String getName() {
return "DateTimePicker";
}
@ReactMethod
public void showDatePicker(ReadableMap options, Callback callback) {
DialogFragment datePicker = new DatePicker(options, callback);
datePicker.show(getCurrentActivity().getFragmentManager(), "datePicker");
}
@ReactMethod
public void showTimePicker(ReadableMap options, Callback callback) {
DialogFragment timePicker = new TimePicker(options, callback);
timePicker.show(getCurrentActivity().getFragmentManager(), "timePicker");
}
@ReactMethod
public void showDateTimePicker(ReadableMap options, Callback callback) {
DialogFragment datetimePicker = new DateTimePicker(options, callback);
datetimePicker.show(getCurrentActivity().getFragmentManager(), "datetimePicker");
}
}