Kaydet (Commit) 6d29bafe authored tarafından Siqi LIU's avatar Siqi LIU

iOS datepicker background issues

Change-Id: I532d3b854ff3b66048b40decd2d9232ab9720151
üst b95acb2b
......@@ -404,7 +404,7 @@ const int FrontViewPositionNone = 0xff;
}
CGRect toolbarTargetFrame = CGRectMake(0, self.view.bounds.size.height-216-44, 320, 44);
CGRect datePickerTargetFrame = CGRectMake(0, self.view.bounds.size.height-216, 320, 216);
UIView *darkView = [[UIView alloc] initWithFrame:self.view.bounds];
darkView.alpha = 0;
darkView.backgroundColor = [UIColor blackColor];
......@@ -412,9 +412,11 @@ const int FrontViewPositionNone = 0xff;
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissDatePicker:)];
[darkView addGestureRecognizer:tapGesture];
[self.view addSubview:darkView];
darkView.alpha = 0.5;
UIDatePicker *datePicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(0, self.view.bounds.size.height+44, 320, 216)];
datePicker.tag = 90;
datePicker.backgroundColor = [UIColor whiteColor];
[datePicker setDatePickerMode:UIDatePickerModeCountDownTimer];
[datePicker addTarget:self action:@selector(changeDate:) forControlEvents:UIControlEventValueChanged];
[self.view addSubview:datePicker];
......@@ -430,7 +432,7 @@ const int FrontViewPositionNone = 0xff;
[UIView beginAnimations:@"MoveIn" context:nil];
toolBar.frame = toolbarTargetFrame;
datePicker.frame = datePickerTargetFrame;
darkView.alpha = 0.5;
[UIView commitAnimations];
}
......
......@@ -622,12 +622,10 @@
</scene>
</scenes>
<resources>
<image name="Default.png" width="320" height="480"/>
<image name="Default.png" width="320" height="480"/>
<image name="WTPairingScreenshot.png" width="474" height="312"/>
<image name="add.png" width="30" height="30"/>
<image name="buttonBackground.png" width="45" height="45"/>
<image name="buttonBackground.png" width="45" height="45"/>
<image name="more_icon.png" width="30" height="30"/>
<image name="more_ipad.png" width="60" height="60"/>
<image name="nextButton_normal.png" width="42" height="230"/>
......@@ -635,10 +633,8 @@
<image name="previousButton_normal.png" width="42" height="230"/>
<image name="previousButton_pressed.png" width="42" height="230"/>
<image name="timer_clear_btn_dark.png" width="60" height="60"/>
<image name="timer_clear_btn_dark.png" width="60" height="60"/>
<image name="timer_settime_btn.png" width="60" height="60"/>
<image name="timer_start_btn_dark.png" width="60" height="60"/>
<image name="timer_start_btn_dark.png" width="60" height="60"/>
</resources>
<color key="tintColor" red="1" green="0.50196078430000002" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
......
......@@ -622,12 +622,10 @@
</scene>
</scenes>
<resources>
<image name="Default.png" width="320" height="480"/>
<image name="Default.png" width="320" height="480"/>
<image name="WTPairingScreenshot.png" width="474" height="312"/>
<image name="add.png" width="30" height="30"/>
<image name="buttonBackground.png" width="45" height="45"/>
<image name="buttonBackground.png" width="45" height="45"/>
<image name="more_icon.png" width="30" height="30"/>
<image name="more_ipad.png" width="60" height="60"/>
<image name="nextButton_normal.png" width="42" height="230"/>
......@@ -635,10 +633,8 @@
<image name="previousButton_normal.png" width="42" height="230"/>
<image name="previousButton_pressed.png" width="42" height="230"/>
<image name="timer_clear_btn_dark.png" width="60" height="60"/>
<image name="timer_clear_btn_dark.png" width="60" height="60"/>
<image name="timer_settime_btn.png" width="60" height="60"/>
<image name="timer_start_btn_dark.png" width="60" height="60"/>
<image name="timer_start_btn_dark.png" width="60" height="60"/>
</resources>
<color key="tintColor" red="1" green="0.50196078430000002" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
......
......@@ -565,7 +565,6 @@ static BOOL isBlank = NO;
popoverView.backgroundColor = [UIColor blackColor];
UIDatePicker *datePicker=[[UIDatePicker alloc]init];//Date picker
datePicker.frame=CGRectMake(0,44,320, 216);
datePicker.datePickerMode = UIDatePickerModeCountDownTimer;
[datePicker setTag:10];
[datePicker addTarget:self action:@selector(changeDate:) forControlEvents:UIControlEventValueChanged];
......@@ -575,7 +574,12 @@ static BOOL isBlank = NO;
self.popoverTimePickerController = [[UIPopoverController alloc] initWithContentViewController:popoverContent];
self.popoverTimePickerController.delegate = self;
[self.popoverTimePickerController setPopoverContentSize:CGSizeMake(320, 264) animated:NO];
// iOS7's time picker has default clearcolor background
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
datePicker.backgroundColor = [UIColor whiteColor];
}
datePicker.frame=CGRectMake(0,0,320, 216);
[self.popoverTimePickerController setPopoverContentSize:CGSizeMake(320, 216) animated:NO];
[self.popoverTimePickerController presentPopoverFromRect:self.timerSetTimeButton.frame inView:self.timerView permittedArrowDirections:UIPopoverArrowDirectionDown animated:YES];
}
......
......@@ -236,12 +236,6 @@
- (void)viewDidLoad
{
[super viewDidLoad];
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
self.center = [NSNotificationCenter defaultCenter];
self.comManager = [CommunicationManager sharedComManager];
......
......@@ -18,6 +18,10 @@
@end
/**
This class controls the behavior of stopwatch timing widget.
**/
@interface StopWatch : NSObject
// StopWatch
......@@ -26,13 +30,18 @@
@property BOOL set;
@property (weak, nonatomic) id<StopWatchDelegate> delegate;
// initialzie Stopwatch with relative UIButton/UILabel elements
- (StopWatch *) initWithStartButton:(UIButton *)startButton
ClearButton:(UIButton *)clearButton
TimeLabel:(UILabel *)timeLabel;
// initialzie Stopwatch with a tableviewCell which contains relative UIButton/UILabel elements
- (void) setupWithTableViewCell:(UITableViewCell *)cell;
// Start/Pause/Resume the stopwatch
- (void) start;
// Stop the stopwatch and update seconds left to its original value
- (void) clear;
// Keep start button icon up-to-date with respect to its current state
- (void) updateStartButtonIcon;
@end
......@@ -19,18 +19,20 @@
@property (nonatomic, strong) NSString* name;
@property (nonatomic, strong) Server* server;
// Connect to the server stored in [server]
- (void) connect;
// Disconnect from server
- (void) disconnect;
- (id) initWithServer:(Server*)server
managedBy:(CommunicationManager*)manager
interpretedBy:(CommandInterpreter*)receiver;
// Send a command (command by transmitter) to the server, base64 encoded
- (void) sendCommand:(NSString *)aCommand;
// Attempt to connect with a time out.
- (void)startConnectionTimeoutTimerwithInterval:(double) interval;
// Stop connection timeout timer
- (void)stopConnectionTimeoutTimer;
// Delegate method, handle stream events and transfer events to CommandInterpreter
-(void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode;
@end
\ No newline at end of file
......@@ -62,6 +62,7 @@ enum ConnectionState : NSInteger {
CONNECTED
};
//
enum SearchState : NSInteger {
WAITING,
SEARCHING
......
......@@ -607,7 +607,7 @@
<image name="add.png" width="30" height="30"/>
<image name="buttonBackground.png" width="45" height="45"/>
<image name="ic_launcher.png" width="16" height="16"/>
<image name="more_icon.png" width="60" height="60"/>
<image name="more_icon.png" width="30" height="30"/>
<image name="pointer.png" width="143" height="147"/>
<image name="pointer_pushed.png" width="143" height="147"/>
<image name="pushed_next_button.png" width="315" height="220"/>
......
......@@ -607,7 +607,7 @@
<image name="add.png" width="30" height="30"/>
<image name="buttonBackground.png" width="45" height="45"/>
<image name="ic_launcher.png" width="16" height="16"/>
<image name="more_icon.png" width="60" height="60"/>
<image name="more_icon.png" width="30" height="30"/>
<image name="pointer.png" width="143" height="147"/>
<image name="pointer_pushed.png" width="143" height="147"/>
<image name="pushed_next_button.png" width="315" height="220"/>
......
......@@ -609,7 +609,7 @@ Contrôle Distant</string>
<image name="add.png" width="30" height="30"/>
<image name="buttonBackground.png" width="45" height="45"/>
<image name="ic_launcher.png" width="16" height="16"/>
<image name="more_icon.png" width="60" height="60"/>
<image name="more_icon.png" width="30" height="30"/>
<image name="pointer.png" width="143" height="147"/>
<image name="pointer_pushed.png" width="143" height="147"/>
<image name="pushed_next_button.png" width="315" height="220"/>
......
......@@ -609,7 +609,7 @@ Contrôle Distant</string>
<image name="add.png" width="30" height="30"/>
<image name="buttonBackground.png" width="45" height="45"/>
<image name="ic_launcher.png" width="16" height="16"/>
<image name="more_icon.png" width="60" height="60"/>
<image name="more_icon.png" width="30" height="30"/>
<image name="pointer.png" width="143" height="147"/>
<image name="pointer_pushed.png" width="143" height="147"/>
<image name="pushed_next_button.png" width="315" height="220"/>
......
......@@ -607,7 +607,7 @@
<image name="add.png" width="30" height="30"/>
<image name="buttonBackground.png" width="45" height="45"/>
<image name="ic_launcher.png" width="16" height="16"/>
<image name="more_icon.png" width="60" height="60"/>
<image name="more_icon.png" width="30" height="30"/>
<image name="pointer.png" width="143" height="147"/>
<image name="pointer_pushed.png" width="143" height="147"/>
<image name="pushed_next_button.png" width="315" height="220"/>
......
......@@ -607,7 +607,7 @@
<image name="add.png" width="30" height="30"/>
<image name="buttonBackground.png" width="45" height="45"/>
<image name="ic_launcher.png" width="16" height="16"/>
<image name="more_icon.png" width="60" height="60"/>
<image name="more_icon.png" width="30" height="30"/>
<image name="pointer.png" width="143" height="147"/>
<image name="pointer_pushed.png" width="143" height="147"/>
<image name="pushed_next_button.png" width="315" height="220"/>
......
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