[Libreoffice-commits] core.git: 2 commits - ios/iosremote
Siqi LIU
me at siqi.fr
Sun Sep 8 03:43:06 PDT 2013
ios/iosremote/UIView+Shadowing.h | 10 ++--
ios/iosremote/UIView+Shadowing.m | 10 ++--
ios/iosremote/WalkThroughContainerViewController.h | 10 ++--
ios/iosremote/WalkThroughContainerViewController.m | 10 ++--
ios/iosremote/iosremote/SWRevealViewController/SWRevealViewController.h | 4 -
ios/iosremote/iosremote/SWRevealViewController/SWRevealViewController.m | 1
ios/iosremote/iosremote/Timer.m | 21 ++++++++--
ios/iosremote/iosremote/UIImageView+setImageAnimated.h | 10 ++--
ios/iosremote/iosremote/UIImageView+setImageAnimated.m | 10 ++--
ios/iosremote/iosremote/UIViewController+LibOStyling.h | 1
ios/iosremote/iosremote/UIViewController+LibOStyling.m | 1
ios/iosremote/iosremote/WalkThroughPageViewController.h | 10 ++--
ios/iosremote/iosremote/WalkThroughPageViewController.m | 10 ++--
ios/iosremote/iosremote/slideShowSwipeInList_iphone.m | 1
ios/iosremote/iosremote/slideShow_vc_iphone.m | 1
ios/iosremote/iosremote/stopWatch.m | 1
16 files changed, 62 insertions(+), 49 deletions(-)
New commits:
commit c755f71b8b5b009573a673f3f757609ca0ef5ffd
Author: Siqi LIU <me at siqi.fr>
Date: Sun Sep 8 12:42:17 2013 +0200
various bug fixes related to countdown timer
Change-Id: Ie1feb26c1b4d72b37d8767c30644f2411dbd2121
diff --git a/ios/iosremote/iosremote/SWRevealViewController/SWRevealViewController.h b/ios/iosremote/iosremote/SWRevealViewController/SWRevealViewController.h
index dc7e144..1610fef 100755
--- a/ios/iosremote/iosremote/SWRevealViewController/SWRevealViewController.h
+++ b/ios/iosremote/iosremote/SWRevealViewController/SWRevealViewController.h
@@ -60,6 +60,8 @@ typedef enum
@interface SWRevealViewController : UIViewController <StopWatchDelegate, TimerDelegate>
+- (void)startTimePickerwithTimer:(Timer *) timer;
+
// Object instance init and rear view setting
- (id)initWithRearViewController:(UIViewController *)rearViewController frontViewController:(UIViewController *)frontViewController;
@@ -173,8 +175,6 @@ typedef enum
@property (strong) void(^performBlock)( SWRevealViewControllerSegue* segue, UIViewController* svc, UIViewController* dvc );
-- (void)startTimePickerwithTimer:(Timer *) timer;
-
@end
diff --git a/ios/iosremote/iosremote/SWRevealViewController/SWRevealViewController.m b/ios/iosremote/iosremote/SWRevealViewController/SWRevealViewController.m
index 922f83c..3414114 100755
--- a/ios/iosremote/iosremote/SWRevealViewController/SWRevealViewController.m
+++ b/ios/iosremote/iosremote/SWRevealViewController/SWRevealViewController.m
@@ -436,7 +436,6 @@ const int FrontViewPositionNone = 0xff;
- (void)startTimePickerwithTimer:(Timer *) timer
{
- NSLog(@"Fired by : %@", [timer class]);
[self callDP:self];
}
diff --git a/ios/iosremote/iosremote/Timer.m b/ios/iosremote/iosremote/Timer.m
index 57c5f7a..6e866d4 100644
--- a/ios/iosremote/iosremote/Timer.m
+++ b/ios/iosremote/iosremote/Timer.m
@@ -34,7 +34,7 @@ int initSecondsLeft;
self = [super init];
self.state = TIMER_STATE_CLEARED;
self.set = NO;
- secondsLeft = 30;
+ secondsLeft = 0;
return self;
}
@@ -70,10 +70,19 @@ int initSecondsLeft;
[self.startButton addTarget:self action:@selector(start) forControlEvents:UIControlEventTouchUpInside];
[self.clearButton addTarget:self action:@selector(clear) forControlEvents:UIControlEventTouchUpInside];
// Sending the sender as well, so that we get a handle on the Timer itself ---> allow us to update seconds left
- [self.setTimeButton addTarget:self.delegate action:@selector(startTimePickerwithTimer:) forControlEvents:UIControlEventTouchUpInside];
+ [self.setTimeButton addTarget:self action:@selector(startTimePickerwithTimer) forControlEvents:UIControlEventTouchUpInside];
self.set = YES;
}
+- (void)startTimePickerwithTimer
+{
+ if (self.state == TIMER_STATE_RUNNING) {
+ // If running, we switch it to pause before setting a new duration
+ [self start];
+ }
+ [self.delegate startTimePickerwithTimer:self];
+}
+
- (void)updateTimer
{
// Create date from the elapsed time
@@ -106,6 +115,10 @@ int initSecondsLeft;
case TIMER_STATE_RUNNING:
self.state = TIMER_STATE_PAUSED;
[self.timerTimer invalidate];
+ if (secondsLeft == 0) {
+ [self.timeLabel setText:@"00:00:00"];
+ }
+ [self.delegate setTitle:@"" sender:self];
break;
case TIMER_STATE_PAUSED:
self.state = TIMER_STATE_RUNNING;
@@ -121,6 +134,8 @@ int initSecondsLeft;
secondsLeft++;
[self updateTimer];
// Create the stop watch timer that fires every 100 ms
+ [self.timerTimer invalidate];
+ self.timerTimer = nil;
self.timerTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
target:self
selector:@selector(updateTimer)
@@ -173,7 +188,7 @@ int initSecondsLeft;
- (void) setSecondsLeft:(NSTimeInterval)duration
{
secondsLeft = (int) duration;
-
+ initSecondsLeft = secondsLeft;
hours = secondsLeft / 3600;
minutes = (secondsLeft % 3600) / 60;
seconds = (secondsLeft %3600) % 60;
diff --git a/ios/iosremote/iosremote/UIViewController+LibOStyling.h b/ios/iosremote/iosremote/UIViewController+LibOStyling.h
index 24b5bab..57ed9bc 100644
--- a/ios/iosremote/iosremote/UIViewController+LibOStyling.h
+++ b/ios/iosremote/iosremote/UIViewController+LibOStyling.h
@@ -24,6 +24,5 @@ TitleLabelOwner owner;
- (void)setTitle:(NSString *)title;
- (void)setOwner:(TitleLabelOwner) aOwner;
-- (void)startTimePickerwithTimer:(Timer *) timer;
@end
diff --git a/ios/iosremote/iosremote/UIViewController+LibOStyling.m b/ios/iosremote/iosremote/UIViewController+LibOStyling.m
index 193f912..b9cd7ef 100644
--- a/ios/iosremote/iosremote/UIViewController+LibOStyling.m
+++ b/ios/iosremote/iosremote/UIViewController+LibOStyling.m
@@ -9,7 +9,6 @@
#import "UIViewController+LibOStyling.h"
#import "ControlVariables.h"
#import "Timer.h"
-#import "TimerCountdownTimePicker.h"
#import "stopWatch.h"
@implementation UIViewController (LibOStyling)
diff --git a/ios/iosremote/iosremote/slideShowSwipeInList_iphone.m b/ios/iosremote/iosremote/slideShowSwipeInList_iphone.m
index 2424e10..01fbb9c 100644
--- a/ios/iosremote/iosremote/slideShowSwipeInList_iphone.m
+++ b/ios/iosremote/iosremote/slideShowSwipeInList_iphone.m
@@ -52,6 +52,7 @@ dispatch_queue_t backgroundQueue;
self.clearsSelectionOnViewWillAppear = NO;
// set stopwatch as default, users may swipe for a timer
self.currentPage = 0;
+ [self.revealViewController setOwner:STOPWATCH];
self.stopWatch = [[stopWatch alloc] init];
if ([[NSUserDefaults standardUserDefaults] boolForKey:KEY_TIMER]) {
diff --git a/ios/iosremote/iosremote/slideShow_vc_iphone.m b/ios/iosremote/iosremote/slideShow_vc_iphone.m
index 2988252..1d8f2db 100644
--- a/ios/iosremote/iosremote/slideShow_vc_iphone.m
+++ b/ios/iosremote/iosremote/slideShow_vc_iphone.m
@@ -306,7 +306,6 @@
target:self.revealViewController
action:@selector( revealToggle: )];
self.revealViewController.navigationItem.leftBarButtonItem = self.revealButtonItem;
- [self.navigationController.navigationBar addGestureRecognizer: self.revealViewController.panGestureRecognizer];
self.pointerCalibrationOn = NO;
self.movingPointer.layer.cornerRadius = 3;
diff --git a/ios/iosremote/iosremote/stopWatch.m b/ios/iosremote/iosremote/stopWatch.m
index c5c942e..716508b 100644
--- a/ios/iosremote/iosremote/stopWatch.m
+++ b/ios/iosremote/iosremote/stopWatch.m
@@ -90,6 +90,7 @@
case TIMER_STATE_RUNNING:
self.state = TIMER_STATE_PAUSED;
[self.stopWatchTimer invalidate];
+ [self.delegate setTitle:@"" sender:self];
self.lastInterval += [[NSDate date] timeIntervalSinceDate:self.startDate];
break;
case TIMER_STATE_PAUSED:
commit 01f7ab201c4819ada35c6c29ec79810c91906545
Author: Siqi LIU <me at siqi.fr>
Date: Sun Sep 8 08:42:33 2013 +0200
license
Change-Id: Ib99cc99be7cfd48af7025834056e0b87fbd121be
diff --git a/ios/iosremote/UIView+Shadowing.h b/ios/iosremote/UIView+Shadowing.h
index 223c4fd..d7b3869 100644
--- a/ios/iosremote/UIView+Shadowing.h
+++ b/ios/iosremote/UIView+Shadowing.h
@@ -1,10 +1,10 @@
+// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
//
-// UIView+Shadowing.h
-// iosremote
-//
-// Created by Siqi Liu on 9/6/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
+// This file is part of the LibreOffice project.
//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#import <UIKit/UIKit.h>
diff --git a/ios/iosremote/UIView+Shadowing.m b/ios/iosremote/UIView+Shadowing.m
index 343063c..616bb18 100644
--- a/ios/iosremote/UIView+Shadowing.m
+++ b/ios/iosremote/UIView+Shadowing.m
@@ -1,10 +1,10 @@
+// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
//
-// UIView+Shadowing.m
-// iosremote
-//
-// Created by Siqi Liu on 9/6/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
+// This file is part of the LibreOffice project.
//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#import "UIView+Shadowing.h"
#import <QuartzCore/CALayer.h>
diff --git a/ios/iosremote/WalkThroughContainerViewController.h b/ios/iosremote/WalkThroughContainerViewController.h
index ee5dff0..1474d16 100644
--- a/ios/iosremote/WalkThroughContainerViewController.h
+++ b/ios/iosremote/WalkThroughContainerViewController.h
@@ -1,10 +1,10 @@
+// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
//
-// WalkThroughContainerViewController.h
-// iosremote
-//
-// Created by Siqi Liu on 8/27/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
+// This file is part of the LibreOffice project.
//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#import <UIKit/UIKit.h>
diff --git a/ios/iosremote/WalkThroughContainerViewController.m b/ios/iosremote/WalkThroughContainerViewController.m
index cd449bc..ace14fc 100644
--- a/ios/iosremote/WalkThroughContainerViewController.m
+++ b/ios/iosremote/WalkThroughContainerViewController.m
@@ -1,10 +1,10 @@
+// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
//
-// WalkThroughContainerViewController.m
-// iosremote
-//
-// Created by Siqi Liu on 8/27/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
+// This file is part of the LibreOffice project.
//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#import "WalkThroughContainerViewController.h"
#import "WalkThroughPageViewController.h"
diff --git a/ios/iosremote/iosremote/UIImageView+setImageAnimated.h b/ios/iosremote/iosremote/UIImageView+setImageAnimated.h
index 24f3b20..5f8ca73 100644
--- a/ios/iosremote/iosremote/UIImageView+setImageAnimated.h
+++ b/ios/iosremote/iosremote/UIImageView+setImageAnimated.h
@@ -1,10 +1,10 @@
+// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
//
-// NSObject+UIImageView_setImageAnimated.h
-// iosremote
-//
-// Created by Siqi Liu on 7/31/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
+// This file is part of the LibreOffice project.
//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#import <Foundation/Foundation.h>
diff --git a/ios/iosremote/iosremote/UIImageView+setImageAnimated.m b/ios/iosremote/iosremote/UIImageView+setImageAnimated.m
index ca163df..3a1464b 100644
--- a/ios/iosremote/iosremote/UIImageView+setImageAnimated.m
+++ b/ios/iosremote/iosremote/UIImageView+setImageAnimated.m
@@ -1,10 +1,10 @@
+// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
//
-// NSObject+UIImageView_setImageAnimated.m
-// iosremote
-//
-// Created by Siqi Liu on 7/31/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
+// This file is part of the LibreOffice project.
//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#import "UIImageView+setImageAnimated.h"
diff --git a/ios/iosremote/iosremote/WalkThroughPageViewController.h b/ios/iosremote/iosremote/WalkThroughPageViewController.h
index 86260e7..08b293a 100644
--- a/ios/iosremote/iosremote/WalkThroughPageViewController.h
+++ b/ios/iosremote/iosremote/WalkThroughPageViewController.h
@@ -1,10 +1,10 @@
+// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
//
-// WalkThroughPageViewController.h
-// iosremote
-//
-// Created by Siqi Liu on 8/27/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
+// This file is part of the LibreOffice project.
//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#import <UIKit/UIKit.h>
diff --git a/ios/iosremote/iosremote/WalkThroughPageViewController.m b/ios/iosremote/iosremote/WalkThroughPageViewController.m
index 4b91e25..a53ccf5 100644
--- a/ios/iosremote/iosremote/WalkThroughPageViewController.m
+++ b/ios/iosremote/iosremote/WalkThroughPageViewController.m
@@ -1,10 +1,10 @@
+// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
//
-// WalkThroughPageViewController.m
-// iosremote
-//
-// Created by Siqi Liu on 8/27/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
+// This file is part of the LibreOffice project.
//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#import "WalkThroughPageViewController.h"
More information about the Libreoffice-commits
mailing list