fix broken osw widget profile after switching app to background
This commit is contained in:
1 parent
c2d3028668
commit
c32f2d3f50
1 file changed
+32
-18
+32
-18
@@ -255,6 +255,10 @@
|
|||||||
selector: @selector(handleReturnToForeground)
|
selector: @selector(handleReturnToForeground)
|
||||||
name: UIApplicationDidBecomeActiveNotification
|
name: UIApplicationDidBecomeActiveNotification
|
||||||
object: nil];
|
object: nil];
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserver: self
|
||||||
|
selector: @selector(handleEnterBackground)
|
||||||
|
name: UIApplicationWillResignActiveNotification
|
||||||
|
object: nil];
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||||
selector:@selector(deviceOrientationDidChange) // handle orientation change since i made portrait mode available
|
selector:@selector(deviceOrientationDidChange) // handle orientation change since i made portrait mode available
|
||||||
name:UIDeviceOrientationDidChangeNotification
|
name:UIDeviceOrientationDidChangeNotification
|
||||||
@@ -267,24 +271,7 @@
|
|||||||
|
|
||||||
#pragma mark - Class Helper Functions
|
#pragma mark - Class Helper Functions
|
||||||
|
|
||||||
- (void)handleReturnToForeground {
|
- (void)updateViewBounds{
|
||||||
[OSCProfilesManager setOnScreenWidgetViewsSet:self.onScreenWidgetViews]; // pass the keyboard button dict to profiles manager
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator{
|
|
||||||
viewWillBeResized = true;
|
|
||||||
[self clearStickIndicator];
|
|
||||||
if(!_quickSwitchEnabled) [self saveTapped:nil];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)deviceOrientationDidChange{
|
|
||||||
[self performSelector:@selector(handleOrientationChangeForOnScreenWidgets) withObject:self afterDelay:0.05];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)handleOrientationChangeForOnScreenWidgets{
|
|
||||||
if(!viewWillBeResized) return;
|
|
||||||
[self setupWidgetPanel];
|
|
||||||
|
|
||||||
viewWillBeResized = false;
|
viewWillBeResized = false;
|
||||||
selectedWidgetView = nil;
|
selectedWidgetView = nil;
|
||||||
selectedControllerLayer = nil;
|
selectedControllerLayer = nil;
|
||||||
@@ -295,6 +282,33 @@
|
|||||||
[self reloadLegacyOnScreenControls];
|
[self reloadLegacyOnScreenControls];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)handleEnterBackground{
|
||||||
|
[self saveTapped:nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)handleReturnToForeground {
|
||||||
|
// [OSCProfilesManager setOnScreenWidgetViewsSet:self.onScreenWidgetViews]; // pass the keyboard button dict to profiles manager
|
||||||
|
[self setupWidgetPanel];
|
||||||
|
[self updateViewBounds];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator{
|
||||||
|
if ([UIApplication sharedApplication].applicationState != UIApplicationStateActive) return;
|
||||||
|
viewWillBeResized = true;
|
||||||
|
[self clearStickIndicator];
|
||||||
|
if(!_quickSwitchEnabled) [self saveTapped:nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)deviceOrientationDidChange{
|
||||||
|
[self performSelector:@selector(handleOrientationChangeForOnScreenWidgets) withObject:self afterDelay:0.0];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)handleOrientationChangeForOnScreenWidgets{
|
||||||
|
if(!viewWillBeResized) return;
|
||||||
|
[self setupWidgetPanel];
|
||||||
|
[self updateViewBounds];
|
||||||
|
}
|
||||||
|
|
||||||
/* fades the 'Undo Button' in or out depending on whether the user has any OSC layout changes to undo */
|
/* fades the 'Undo Button' in or out depending on whether the user has any OSC layout changes to undo */
|
||||||
- (void) OSCLayoutChanged {
|
- (void) OSCLayoutChanged {
|
||||||
if ([self.layoutOSC.layoutChanges count] > 0) {
|
if ([self.layoutOSC.layoutChanges count] > 0) {
|
||||||
|
|||||||
Reference in new issue
Block a user