Commit 246090f6 authored by Jidong Chen's avatar Jidong Chen Committed by 福居

switch to disable accessibility support.

parent 67f132b9
......@@ -84,6 +84,11 @@
[[_engine lifecycleChannel] sendMessage:@"AppLifecycleState.inactive"];
}
- (void)setAccessibilityEnabled:(BOOL)enable
{
self.viewController.accessibilityEnable = enable;
}
@end
#endif
......@@ -85,4 +85,9 @@
[self.viewController sendOnChannel:channel message:data];
}
- (void)setAccessibilityEnabled:(BOOL)enable
{
self.viewController.accessibilityEnable = enable;
}
@end
......@@ -31,6 +31,9 @@ NS_ASSUME_NONNULL_BEGIN
- (void)boost_viewDidAppear:(BOOL)animated;
- (void)boost_viewWillDisappear:(BOOL)animated;
- (void)boost_viewDidDisappear:(BOOL)animated;
@property (nonatomic,assign) BOOL accessibilityEnable;
@end
NS_ASSUME_NONNULL_END
......@@ -23,6 +23,7 @@
*/
#import "FLBFlutterViewControllerAdaptor.h"
#import <objc/runtime.h>
@interface FLBFlutterViewControllerAdaptor ()
@end
......@@ -32,6 +33,15 @@
- (void)viewDidLoad {
[super viewDidLoad];
Class class = [self class];
SEL originalSelector = @selector(onAccessibilityStatusChanged:);
SEL swizzledSelector = @selector(fixed_onAccessibilityStatusChanged:);
Method originalMethod = class_getInstanceMethod(class, originalSelector);
Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector);
method_exchangeImplementations(originalMethod, swizzledMethod);
self.view.backgroundColor = [UIColor whiteColor];
// Do any additional setup after loading the view.
......@@ -96,4 +106,11 @@
//Override this to avoid unnecessary splash Screen.
}
- (void)fixed_onAccessibilityStatusChanged:(NSNotification*)notification {
if(self.accessibilityEnable){
[self fixed_onAccessibilityStatusChanged:notification];
}
}
@end
......@@ -33,6 +33,7 @@ NS_ASSUME_NONNULL_BEGIN
@protocol FLBFlutterViewProvider <NSObject>
@required
- (void)setAccessibilityEnable:(BOOL)enable;
- (FlutterViewController *)viewController;
- (void)pause;
- (void)resume;
......
......@@ -33,6 +33,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong) id<FLBPlatform> platform;
#pragma mark - Getters
- (void)setAccessibilityEnable:(BOOL)enable;
+ (FLBFlutterApplication *)sharedApplication;
- (void)startFlutterWithPlatform:(id<FLBPlatform>)platform
onStart:(void (^)(FlutterViewController *))callback;
......
......@@ -142,6 +142,10 @@
[self.viewProvider inactive];
}
- (void)setAccessibilityEnable:(BOOL)enable
{
[self.viewProvider setAccessibilityEnable:enable];
}
@end
......@@ -31,6 +31,8 @@ typedef FLBFlutterViewContainer * (^FLBPageBuilder)(NSString *name,NSDictionary
@interface FlutterBoostPlugin : NSObject<FlutterPlugin>
#pragma mark - Initializer
- (void)setAccessibilityEnable:(BOOL)enable;
+ (instancetype)sharedInstance;
- (void)startFlutterWithPlatform:(id<FLBPlatform>)platform onStart:(void (^)(FlutterViewController *))callback;
......
......@@ -101,4 +101,9 @@
[_resultMediator removeHandlerForKey:vcid];
}
- (void)setAccessibilityEnable:(BOOL)enable
{
[[FLBFlutterApplication sharedApplication] setAccessibilityEnable:enable];
}
@end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment