Thursday, January 27, 2011

27 January 2011

Got quite a few things done today :)

We managed to solve the locking issue with the use of a NSTimer. Every time a user receives data, this timer would be started and would fire off in 1 second. If at anytime before the timer fires off and the user receives another set of data, the timer would be reset to fire off in 1 second again. Once the 1 second is over and no data has been received, we would then enable the user interactions. Here's how we got it done:

- (void)unlock
{
NSLog(@"UNLOCK");
self.view.userInteractionEnabled = YES;
interactingDeviceName.hidden = YES;

// End ignoring user interaction if already ignoring
if ([[UIApplication sharedApplication] isIgnoringInteractionEvents])
[[UIApplication sharedApplication] endIgnoringInteractionEvents];

timer = nil;
[timer invalidate];
[timer release];
}

- (void)lock
{
NSLog(@"LOCK");
self.view.userInteractionEnabled = NO;

// Start ignoring user interaction if not already ignoring
if (![[UIApplication sharedApplication] isIgnoringInteractionEvents])
[[UIApplication sharedApplication] beginIgnoringInteractionEvents];

if ([timer isValid]) // Set timer's fireDate to current date + 1 sec
[timer setFireDateNSDate dateWithTimeIntervalSinceNow:1.0]];
else // Create timer with that fires in 1 second.
timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(unlock) userInfo:nil repeats:NO];
}

Once locking was done, we worked on showing a label on all connected devices to show who is actually performing the current interactions. We also did a few fixes for our node button labels for them to be hidden whenever the user performs another action.

Then Kevin came in and tested out the whole flow. We were then told to make some edits:
- Segmentation for 3 buttons (adding in the "Compare" button to our current UISegmentedControl)
- Swapping the pinch gesture to do scaling, and the double tap gesture to do explode

We managed to get that done too, and we'll be testing out the flow of mirroring tomorrow.

No comments:

Post a Comment