Kaydet (Commit) 1a412370 authored tarafından Siqi LIU's avatar Siqi LIU

auto scroll to default time widget fix

Change-Id: Ib71adb544c02b764fe85b2fd32fda2097efc41d0
üst 24f277a4
...@@ -16,4 +16,6 @@ ...@@ -16,4 +16,6 @@
@property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) UIWindow *window;
- (void) reconfigure;
@end @end
...@@ -68,6 +68,8 @@ blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] ...@@ -68,6 +68,8 @@ blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
kStopwatchAutoStart = [[NSUserDefaults standardUserDefaults] boolForKey:@"STOPWATCH_AUTO_START"]; kStopwatchAutoStart = [[NSUserDefaults standardUserDefaults] boolForKey:@"STOPWATCH_AUTO_START"];
kCountDownTimerAutoStart = [[NSUserDefaults standardUserDefaults] boolForKey:@"TIMER_AUTO_START"]; kCountDownTimerAutoStart = [[NSUserDefaults standardUserDefaults] boolForKey:@"TIMER_AUTO_START"];
kCountDownTimerVibration = [[NSUserDefaults standardUserDefaults] boolForKey:@"TIMER_VIBRATION"]; kCountDownTimerVibration = [[NSUserDefaults standardUserDefaults] boolForKey:@"TIMER_VIBRATION"];
NSLog(@"Setting kDefaultTimerWidget to %d", kDefaultTimerWidget);
} }
- (void)applicationWillResignActive:(UIApplication *)application - (void)applicationWillResignActive:(UIApplication *)application
......
...@@ -322,12 +322,6 @@ ...@@ -322,12 +322,6 @@
[self.timerView setShadowLight]; [self.timerView setShadowLight];
self.timer.delegate = self; self.timer.delegate = self;
self.stopWatchTimerScrollView.contentSize = CGSizeMake(1240, 62); self.stopWatchTimerScrollView.contentSize = CGSizeMake(1240, 62);
CGRect frame = self.stopWatchTimerScrollView.frame;
frame.origin.x = frame.size.width * kDefaultTimerWidget;
frame.origin.y = 0;
[self.stopWatchTimerScrollView scrollRectToVisible:frame animated:YES];
} }
- (void)viewDidAppear:(BOOL)animated - (void)viewDidAppear:(BOOL)animated
...@@ -412,6 +406,12 @@ ...@@ -412,6 +406,12 @@
[self.stopWatch start]; [self.stopWatch start];
if (kCountDownTimerAutoStart) if (kCountDownTimerAutoStart)
[self.timer start]; [self.timer start];
CGRect frame = self.stopWatchTimerScrollView.frame;
frame.origin.x = frame.size.width * kDefaultTimerWidget;
frame.origin.y = 0;
[self.stopWatchTimerScrollView scrollRectToVisible:frame animated:YES];
[self.timer setSecondsLeft:kCountDownTimerDefaultDuration * 60];
}]; }];
self.slideshow.delegate = self; self.slideshow.delegate = self;
} }
......
...@@ -11,9 +11,10 @@ ...@@ -11,9 +11,10 @@
#import "CommandTransmitter.h" #import "CommandTransmitter.h"
#import "CommandInterpreter.h" #import "CommandInterpreter.h"
#import "SlideShow.h" #import "SlideShow.h"
#import "AppDelegate.h"
#import "IASKAppSettingsViewController.h" #import "IASKAppSettingsViewController.h"
@interface slideShowPreviewTable_vc () @interface slideShowPreviewTable_vc () <IASKSettingsDelegate>
@property (nonatomic, strong) IASKAppSettingsViewController *appSettingsViewController; @property (nonatomic, strong) IASKAppSettingsViewController *appSettingsViewController;
...@@ -25,6 +26,12 @@ ...@@ -25,6 +26,12 @@
@synthesize titleObserver = _titleObserver; @synthesize titleObserver = _titleObserver;
@synthesize appSettingsViewController = _appSettingsViewController; @synthesize appSettingsViewController = _appSettingsViewController;
#pragma mark IASKSettingsDelegate
- (void)settingsViewControllerDidEnd:(IASKAppSettingsViewController*)sender
{
[(AppDelegate *)[[UIApplication sharedApplication] delegate] reconfigure];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{ {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
......
...@@ -216,7 +216,7 @@ dispatch_queue_t backgroundQueue; ...@@ -216,7 +216,7 @@ dispatch_queue_t backgroundQueue;
scroll.contentSize = CGSizeMake(412, 120); scroll.contentSize = CGSizeMake(412, 120);
CGRect frame = scroll.frame; CGRect frame = scroll.frame;
frame.origin.x = frame.size.width * kDefaultTimerWidget; frame.origin.x = frame.size.width * self.currentPage;
frame.origin.y = 0; frame.origin.y = 0;
[scroll scrollRectToVisible:frame animated:YES]; [scroll scrollRectToVisible:frame animated:YES];
......
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