-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[android][ios] Upgrade @react-native-community/datetimepicker to 7.1.0 (
expo#22894) # Why Upgrades `@react-native-community/datetimepicker` to `7.1.0` # How ```sh et uvm -m @react-native-community/datetimepicker -c "v7.1.0" yarn et pods -f ``` # Test Plan - [x] test using `bare-expo` Android + NCL DateTimePicker Example - [x] test using `bare-expo` iOS + NCL DateTimePickerExample - [x] test unversioned expo go ios + NCL DateTimePicker Example - [x] test unversioned expo go android + NCL DateTimePicker Example # Checklist - [x] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [x] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [x] This diff will work correctly for `expo prebuild` & EAS Build (eg: updated a module plugin).
- Loading branch information
1 parent
0ac9312
commit 5b07ee5
Showing
14 changed files
with
179 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...d/host/exp/exponent/modules/api/components/datetimepicker/NativeModuleDatePickerSpec.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
/** | ||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). | ||
* | ||
* Then it was commited. It is here to support the old architecture. | ||
* If you use the new architecture, this file won't be included and instead will be generated by the codegen. | ||
* | ||
* @generated by codegen project: GenerateModuleJavaSpec.js | ||
* | ||
* @nolint | ||
*/ | ||
|
||
package versioned.host.exp.exponent.modules.api.components.datetimepicker; | ||
|
||
import com.facebook.proguard.annotations.DoNotStrip; | ||
import com.facebook.react.bridge.Promise; | ||
import com.facebook.react.bridge.ReactApplicationContext; | ||
import com.facebook.react.bridge.ReactContextBaseJavaModule; | ||
import com.facebook.react.bridge.ReactMethod; | ||
import com.facebook.react.bridge.ReactModuleWithSpec; | ||
import com.facebook.react.bridge.ReadableMap; | ||
import com.facebook.react.turbomodule.core.interfaces.TurboModule; | ||
|
||
public abstract class NativeModuleDatePickerSpec extends ReactContextBaseJavaModule implements ReactModuleWithSpec, TurboModule { | ||
public NativeModuleDatePickerSpec(ReactApplicationContext reactContext) { | ||
super(reactContext); | ||
} | ||
|
||
@ReactMethod | ||
@DoNotStrip | ||
public abstract void dismiss(Promise promise); | ||
|
||
@ReactMethod | ||
@DoNotStrip | ||
public abstract void open(ReadableMap params, Promise promise); | ||
} |
36 changes: 36 additions & 0 deletions
36
...d/host/exp/exponent/modules/api/components/datetimepicker/NativeModuleTimePickerSpec.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
/** | ||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). | ||
* | ||
* Then it was commited. It is here to support the old architecture. | ||
* If you use the new architecture, this file won't be included and instead will be generated by the codegen. | ||
* | ||
* @generated by codegen project: GenerateModuleJavaSpec.js | ||
* | ||
* @nolint | ||
*/ | ||
|
||
package versioned.host.exp.exponent.modules.api.components.datetimepicker; | ||
|
||
import com.facebook.proguard.annotations.DoNotStrip; | ||
import com.facebook.react.bridge.Promise; | ||
import com.facebook.react.bridge.ReactApplicationContext; | ||
import com.facebook.react.bridge.ReactContextBaseJavaModule; | ||
import com.facebook.react.bridge.ReactMethod; | ||
import com.facebook.react.bridge.ReactModuleWithSpec; | ||
import com.facebook.react.bridge.ReadableMap; | ||
import com.facebook.react.turbomodule.core.interfaces.TurboModule; | ||
|
||
public abstract class NativeModuleTimePickerSpec extends ReactContextBaseJavaModule implements ReactModuleWithSpec, TurboModule { | ||
public NativeModuleTimePickerSpec(ReactApplicationContext reactContext) { | ||
super(reactContext); | ||
} | ||
|
||
@ReactMethod | ||
@DoNotStrip | ||
public abstract void dismiss(Promise promise); | ||
|
||
@ReactMethod | ||
@DoNotStrip | ||
public abstract void open(ReadableMap params, Promise promise); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 65 additions & 17 deletions
82
...oned/host/exp/exponent/modules/api/components/datetimepicker/RNDateTimePickerPackage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,73 @@ | ||
package versioned.host.exp.exponent.modules.api.components.datetimepicker; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import com.facebook.react.ReactPackage; | ||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
|
||
import com.facebook.react.TurboReactPackage; | ||
import com.facebook.react.bridge.NativeModule; | ||
import com.facebook.react.bridge.ReactApplicationContext; | ||
import com.facebook.react.uimanager.ViewManager; | ||
|
||
public class RNDateTimePickerPackage implements ReactPackage { | ||
@Override | ||
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { | ||
return Arrays.<NativeModule>asList( | ||
new RNDatePickerDialogModule(reactContext), | ||
new RNTimePickerDialogModule(reactContext) | ||
); | ||
} | ||
import com.facebook.react.module.model.ReactModuleInfo; | ||
import com.facebook.react.module.model.ReactModuleInfoProvider; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
@Override | ||
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { | ||
return Collections.emptyList(); | ||
import host.exp.expoview.BuildConfig; | ||
|
||
public class RNDateTimePickerPackage extends TurboReactPackage { | ||
@Nullable | ||
@Override | ||
public NativeModule getModule(String name, ReactApplicationContext reactContext) { | ||
if (name.equals(DatePickerModule.NAME)) { | ||
return new DatePickerModule(reactContext); | ||
} else if (name.equals(TimePickerModule.NAME)) { | ||
return new TimePickerModule(reactContext); | ||
} else { | ||
return null; | ||
} | ||
} | ||
|
||
@Override | ||
public ReactModuleInfoProvider getReactModuleInfoProvider() { | ||
return () -> { | ||
boolean isTurboModule = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; | ||
final Map<String, ReactModuleInfo> moduleInfos = new HashMap<>(); | ||
moduleInfos.put( | ||
DatePickerModule.NAME, | ||
new ReactModuleInfo( | ||
DatePickerModule.NAME, | ||
DatePickerModule.NAME, | ||
false, // canOverrideExistingModule | ||
false, // needsEagerInit | ||
false, // hasConstants | ||
false, // isCxxModule | ||
isTurboModule // isTurboModule | ||
)); | ||
moduleInfos.put( | ||
TimePickerModule.NAME, | ||
new ReactModuleInfo( | ||
TimePickerModule.NAME, | ||
TimePickerModule.NAME, | ||
false, // canOverrideExistingModule | ||
false, // needsEagerInit | ||
false, // hasConstants | ||
false, // isCxxModule | ||
isTurboModule // isTurboModule | ||
)); | ||
return moduleInfos; | ||
}; | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { | ||
List<NativeModule> modules = new ArrayList<>(); | ||
modules.add(new DatePickerModule(reactContext)); | ||
modules.add(new TimePickerModule(reactContext)); | ||
|
||
return modules; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.