Search Results

Search found 5 results on 1 pages for 'thistime'.

Page 1/1 | 1 

  • how to implement double click in android

    - by Sanal Varghese
    I am doing a project in which i want to display a particular message on single touch and another message on double touch using android.How can i implement it. My sample code is below if(firstTap){ thisTime = SystemClock.u`enter code here`ptimeMillis(); firstTap = false; }else{ prevTime = thisTime; thisTime = SystemClock.uptimeMillis(); //Check that thisTime is greater than prevTime //just incase system clock reset to zero if(thisTime > prevTime){ //Check if times are within our max delay if((thisTime - prevTime) <= DOUBLE_CLICK_MAX_DELAY){ //We have detected a double tap! Toast.makeText(AddLocation.this, "DOUBLE TAP DETECTED!!!", Toast.LENGTH_LONG).show(); //PUT YOUR LOGIC HERE!!!! }else{ //Otherwise Reset firstTap firstTap = true; } }else{ firstTap = true; } } return false;

    Read the article

  • JQuery Scrollable List Dissapears if scrolled IE7

    - by namtax
    Hi there I have created a time picker using jquery, using the following code // Display Time Picker $('.time').click(function(){ $('.timePicker').remove(); var thisTime = $(this); var timePicker = '<ul class="timePicker">' timePicker += '<li>09:00</li>' timePicker += '<li>09:15</li>' timePicker += '</ul>' thisTime.after(timePicker); $('.timePicker').fadeIn() $('.timePicker li').click(function(){ term = $(this).html(); $(thisTime).val(term); $('.timePicker').remove(); }); }).blur(function(){ $('.timePicker').fadeOut(); }); This adds a dropdown scrollable list of times to any input field with the class "time". This functions as expected in all browsers apart from IE7, where if I scroll the list to choose a time lower down in the list, the list dissapears.. Hope that makes sense, any help would be much appreciated Many thanks

    Read the article

  • Jquery: Display element relative to another

    - by namtax
    Hi I am trying to display a drop down list using jquery everytime a user clicks on a particular formfield... At the moment the HTML is as stands // Form field to enter the time an event starts <div> <label for="eventTime"> Event Time </label> <input type = "text" name="eventTime" id="eventTime" class="time"> </label> </div> // Form field to enter the time an event finishes <div> <label for="eventEnd"> Event Ends</label> <input type = "text" name="eventEnds" id="eventEnds" class="time"> </label> </div> And the Jquery looks like so // Display Time Picker $('.time').click(function(){ var thisTime = $(this); var timePicker = '<ul class="timePicker">' timePicker += '<li>10.00am</li>' timePicker += '<li>11.00am</li>' timePicker += '<li>12.00am</li>' timePicker += '</ul>' $('.timePicker').hide().insertAfter(thisTime); //show the menu directly over the placeholder var pos = thisTime.offset(); $(".timePicker").attr({ top: pos.top left: pos.left }); $(".timePicker").show(); }); However, when I click on one the form fields with class time, the timePicker drop down appears, but it always appears in the same location, not next to the form field as I would like. Any ideas? Thanks

    Read the article

  • [UIView didCreateWorkout:Type:Distance:Time:Message:]: unrecognized selector sent to instance.

    - by Stephen
    Hello, I'm getting the above error and have been looking at it all day, I'm getting no where fast. Anyone any ideas ? I'm new to IPhone Development. Code Below: #import "WorkoutViewController.h" #import "Workout.h" @implementation WorkoutViewController @synthesize workoutDelegate; //@synthesize Speed; //@synthesize Calories; @synthesize route; @synthesize type; @synthesize distance; @synthesize time; @synthesize message; @synthesize DBContents; @synthesize workoutArray; @synthesize managedObjectContext; //@synthesize saveWorkout; //@synthesize cancelWorkout; -(IBAction)hideKeyboard { } -(IBAction)saveWorkout { [workoutDelegate didCreateWorkout: route.text Type: type.text Distance: distance.text Time: time.text Message: message.text]; } -(IBAction)cancelWorkout { [self.workoutDelegate didCancelWorkout]; } // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -(void)viewDidLoad { //Set images for Save & Cancel buttons. UIImage *normalImage = [[UIImage imageNamed:@"whiteButton.png"] stretchableImageWithLeftCapWidth:12.0 topCapHeight:0.0]; [saveWorkout setBackgroundImage:normalImage forState:UIControlStateNormal]; [cancelWorkout setBackgroundImage:normalImage forState:UIControlStateNormal]; UIImage *pressedImage = [[UIImage imageNamed:@"blueButton.png"] stretchableImageWithLeftCapWidth:12.0 topCapHeight:0.0]; [saveWorkout setBackgroundImage:pressedImage forState:UIControlStateHighlighted]; [cancelWorkout setBackgroundImage:pressedImage forState:UIControlStateHighlighted]; //Fetch details from the database. NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Workout" inManagedObjectContext:managedObjectContext]; [request setEntity:entity]; NSError *error; self.workoutArray = [[managedObjectContext executeFetchRequest:request error:&error] mutableCopy]; [request release]; //self.workoutArray = [[NSMutableArray alloc] init]; //self.DBContents.text = [self.workoutArray objectAtIndex:0]; [super viewDidLoad]; } -(void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } -(void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } -(void) didCreateWorkout:(NSString *)thisRoute Type:(NSString *)thisType Distance:(NSString *)thisDistance Time:(NSString *)thisTime Message:(NSString *)thisMessage { // Add the new workout. Workout *newWorkout = [NSEntityDescription insertNewObjectForEntityForName:@"Workout" inManagedObjectContext:self.managedObjectContext]; newWorkout.route = thisRoute; newWorkout.type = thisType; newWorkout.distance = thisDistance; newWorkout.time = thisTime; newWorkout.message = thisMessage; [self.workoutArray addObject:newWorkout]; //[self dismissModalViewControllerAnimated:YES]; } -(void)didCancelWorkout { [self dismissModalViewControllerAnimated:YES]; } -(void)dealloc { // [Speed release]; // [Calories release]; [route release]; [type release]; [distance release]; [time release]; [message release]; // [saveWorkout release]; // [cancelWorkout release]; [workoutArray release]; [managedObjectContext release]; [super dealloc]; } @end I'm trying to save details that I key on the screen (WorkoutViewController.xib) and I click the save button and get the above error. Thanks Stephen

    Read the article

1