- App.tsx: full navigation (Auth stack + Main tabs with 5 screens) - Auth: LoginScreen, RegisterScreen, ForgotPasswordScreen - HomeScreen: dashboard with IoT metrics, weather widget, alerts, quick actions, sensors - MapScreen: interactive map with layer toggles (6 layers) - MarketplaceScreen: categories (6), products (5), search - ChatScreen: AI chat with quick prompts (4), bot responses - ProfileScreen: user info, stats, menu (9 items), logout - AlertsScreen: alert list with severity, acknowledge - SensorsScreen: sensor list with type filters (6 types), search - ZonesScreen: zone cards with stats - SettingsScreen: language picker (FR/EN/ES/DE), privacy, about - Stores: iotStore (sensors, zones, alerts), notificationStore, uiStore + i18n - Hooks: useSensors, useAlerts, useNotifications, useLocation - Components: Card, Button, LoadingSpinner, ErrorBoundary, Header - Services: iotService, notificationService (with axios API client) - Utils: formatters (temp, AQI, noise, dates), validators (email, password, IBAN) - Theme: colors.ts with full design system (Blue Ocean palette) - Ditto: fixed MongoDB connection, new JWT secrets, official gateway image
109 lines
2.1 KiB
Objective-C
109 lines
2.1 KiB
Objective-C
#import "RNManualActivationRecognizer.h"
|
|
#import "RNGestureHandler.h"
|
|
|
|
@implementation RNManualActivationRecognizer {
|
|
RNGestureHandler *_handler;
|
|
int _activePointers;
|
|
}
|
|
|
|
- (id)initWithGestureHandler:(RNGestureHandler *)gestureHandler
|
|
{
|
|
if ((self = [super initWithTarget:self action:@selector(handleGesture:)])) {
|
|
_handler = gestureHandler;
|
|
_activePointers = 0;
|
|
self.delegate = self;
|
|
#if !TARGET_OS_OSX
|
|
self.cancelsTouchesInView = NO;
|
|
#endif
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (void)handleGesture:(UIGestureRecognizer *)recognizer
|
|
{
|
|
if (recognizer.state == UIGestureRecognizerStateBegan) {
|
|
self.state = UIGestureRecognizerStateEnded;
|
|
[self reset];
|
|
}
|
|
}
|
|
|
|
#if TARGET_OS_OSX
|
|
- (void)mouseUp:(NSEvent *)event
|
|
{
|
|
[super mouseUp:event];
|
|
|
|
_activePointers -= 1;
|
|
}
|
|
|
|
- (void)mouseDown:(NSEvent *)event
|
|
{
|
|
[super mouseDown:event];
|
|
|
|
_activePointers += 1;
|
|
|
|
if (_activePointers == 0) {
|
|
self.state = UIGestureRecognizerStateBegan;
|
|
}
|
|
}
|
|
|
|
#else
|
|
|
|
- (void)touchesBegan:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
|
|
{
|
|
[super touchesBegan:touches withEvent:event];
|
|
|
|
_activePointers += touches.count;
|
|
}
|
|
|
|
- (void)touchesEnded:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
|
|
{
|
|
[super touchesEnded:touches withEvent:event];
|
|
|
|
_activePointers -= touches.count;
|
|
|
|
if (_activePointers == 0) {
|
|
self.state = UIGestureRecognizerStateBegan;
|
|
}
|
|
}
|
|
|
|
- (void)touchesCancelled:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
|
|
{
|
|
[super touchesCancelled:touches withEvent:event];
|
|
|
|
_activePointers = 0;
|
|
[self reset];
|
|
}
|
|
|
|
#endif
|
|
|
|
- (void)reset
|
|
{
|
|
self.enabled = YES;
|
|
[super reset];
|
|
}
|
|
|
|
- (void)fail
|
|
{
|
|
self.enabled = NO;
|
|
}
|
|
|
|
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
|
|
shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
|
|
{
|
|
return YES;
|
|
}
|
|
|
|
- (BOOL)shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
|
|
{
|
|
RNGestureHandler *handler = [RNGestureHandler findGestureHandlerByRecognizer:otherGestureRecognizer];
|
|
if (handler != nil) {
|
|
if (handler.tag == _handler.tag) {
|
|
return YES;
|
|
}
|
|
}
|
|
|
|
return NO;
|
|
}
|
|
|
|
@end
|