Skip to content

Commit

Permalink
Remove TimePickerAndroid from React Native
Browse files Browse the repository at this point in the history
Summary: Lean Core

Reviewed By: rubennorte

Differential Revision: D17344045

fbshipit-source-id: a5a7ab41075da93f8a1929059abe183838b00c82
  • Loading branch information
cpojer authored and facebook-github-bot committed Sep 13, 2019
1 parent 3666244 commit dbf070c
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 428 deletions.
33 changes: 0 additions & 33 deletions Libraries/Components/TimePickerAndroid/NativeTimePickerAndroid.js

This file was deleted.

80 changes: 0 additions & 80 deletions Libraries/Components/TimePickerAndroid/TimePickerAndroid.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -1995,39 +1995,6 @@ + (RCTManagedPointer *)JS_NativeStatusBarManager_SpecGetHeightCallbackResult:(id

} // namespace react
} // namespace facebook
@implementation RCTCxxConvert (NativeTimePickerAndroid_TimePickerOptions)
+ (RCTManagedPointer *)JS_NativeTimePickerAndroid_TimePickerOptions:(id)json
{
return facebook::react::managedPointer<JS::NativeTimePickerAndroid::TimePickerOptions>(json);
}
@end
namespace facebook {
namespace react {


static facebook::jsi::Value __hostFunction_NativeTimePickerAndroidSpecJSI_open(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "open", @selector(open:resolve:reject:), args, count);
}


NativeTimePickerAndroidSpecJSI::NativeTimePickerAndroidSpecJSI(id<RCTTurboModule> instance, std::shared_ptr<JSCallInvoker> jsInvoker)
: ObjCTurboModule("TimePickerAndroid", instance, jsInvoker) {

methodMap_["open"] = MethodMetadata {1, __hostFunction_NativeTimePickerAndroidSpecJSI_open};

setMethodArgConversionSelector(@"open", 0, @"JS_NativeTimePickerAndroid_TimePickerOptions:");


}

} // namespace react
} // namespace facebook
@implementation RCTCxxConvert (NativeTimePickerAndroid_TimePickerResult)
+ (RCTManagedPointer *)JS_NativeTimePickerAndroid_TimePickerResult:(id)json
{
return facebook::react::managedPointer<JS::NativeTimePickerAndroid::TimePickerResult>(json);
}
@end
namespace facebook {
namespace react {

Expand Down
92 changes: 0 additions & 92 deletions Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h
Original file line number Diff line number Diff line change
Expand Up @@ -2038,63 +2038,6 @@ namespace facebook {
};
} // namespace react
} // namespace facebook

namespace JS {
namespace NativeTimePickerAndroid {
struct TimePickerOptions {
folly::Optional<double> hour() const;
folly::Optional<double> minute() const;
folly::Optional<bool> is24Hour() const;
NSString *mode() const;

TimePickerOptions(NSDictionary *const v) : _v(v) {}
private:
NSDictionary *_v;
};
}
}

@interface RCTCxxConvert (NativeTimePickerAndroid_TimePickerOptions)
+ (RCTManagedPointer *)JS_NativeTimePickerAndroid_TimePickerOptions:(id)json;
@end
@protocol NativeTimePickerAndroidSpec <RCTBridgeModule, RCTTurboModule>

- (void)open:(JS::NativeTimePickerAndroid::TimePickerOptions &)options
resolve:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject;

@end
namespace facebook {
namespace react {
/**
* ObjC++ class for module 'TimePickerAndroid'
*/

class JSI_EXPORT NativeTimePickerAndroidSpecJSI : public ObjCTurboModule {
public:
NativeTimePickerAndroidSpecJSI(id<RCTTurboModule> instance, std::shared_ptr<JSCallInvoker> jsInvoker);

};
} // namespace react
} // namespace facebook

namespace JS {
namespace NativeTimePickerAndroid {
struct TimePickerResult {
NSString *action() const;
double hour() const;
double minute() const;

TimePickerResult(NSDictionary *const v) : _v(v) {}
private:
NSDictionary *_v;
};
}
}

@interface RCTCxxConvert (NativeTimePickerAndroid_TimePickerResult)
+ (RCTManagedPointer *)JS_NativeTimePickerAndroid_TimePickerResult:(id)json;
@end
@protocol NativeTimingSpec <RCTBridgeModule, RCTTurboModule>

- (void)createTimer:(double)callbackID
Expand Down Expand Up @@ -3074,41 +3017,6 @@ inline JS::NativeStatusBarManager::Constants::Builder::Builder(const Input i) :
inline JS::NativeStatusBarManager::Constants::Builder::Builder(Constants i) : _factory(^{
return i.unsafeRawValue();
}) {}
inline folly::Optional<double> JS::NativeTimePickerAndroid::TimePickerOptions::hour() const
{
id const p = _v[@"hour"];
return RCTBridgingToOptionalDouble(p);
}
inline folly::Optional<double> JS::NativeTimePickerAndroid::TimePickerOptions::minute() const
{
id const p = _v[@"minute"];
return RCTBridgingToOptionalDouble(p);
}
inline folly::Optional<bool> JS::NativeTimePickerAndroid::TimePickerOptions::is24Hour() const
{
id const p = _v[@"is24Hour"];
return RCTBridgingToOptionalBool(p);
}
inline NSString *JS::NativeTimePickerAndroid::TimePickerOptions::mode() const
{
id const p = _v[@"mode"];
return RCTBridgingToString(p);
}
inline NSString *JS::NativeTimePickerAndroid::TimePickerResult::action() const
{
id const p = _v[@"action"];
return RCTBridgingToString(p);
}
inline double JS::NativeTimePickerAndroid::TimePickerResult::hour() const
{
id const p = _v[@"hour"];
return RCTBridgingToDouble(p);
}
inline double JS::NativeTimePickerAndroid::TimePickerResult::minute() const
{
id const p = _v[@"minute"];
return RCTBridgingToDouble(p);
}
inline JS::NativeToastAndroid::Constants::Builder::Builder(const Input i) : _factory(^{
NSMutableDictionary *d = [NSMutableDictionary new];
auto SHORT = i.SHORT.get();
Expand Down
125 changes: 0 additions & 125 deletions RNTester/js/examples/TimePicker/TimePickerAndroidExample.js

This file was deleted.

4 changes: 0 additions & 4 deletions RNTester/js/utils/RNTesterList.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,6 @@ const APIExamples: Array<RNTesterExample> = [
key: 'ShareExample',
module: require('../examples/Share/ShareExample'),
},
{
key: 'TimePickerAndroidExample',
module: require('../examples/TimePicker/TimePickerAndroidExample'),
},
{
key: 'TimerExample',
module: require('../examples/Timer/TimerExample'),
Expand Down
Loading

0 comments on commit dbf070c

Please sign in to comment.