在手機關機的情況下,按住調低音量鍵,然後快速按下電源鍵。
等待畫面上出現 3 個 Android 影像,然後放開調低音量鍵。
按下調低音量鍵,選取清理磁碟空間,然後按下電源鍵。
按下調低音量鍵,開始執行出廠重設。
以手為半徑是我的世界範圍! 在這個世界裡頭沒有爭吵,沒有公司派的勾心鬥角,當然也沒有那種跟你搏軟然後在背後捅你一百多刀的恐怖smile! 所以這是屬於我的半徑! 閒人勿進,因為結界的關西。 半徑內的咖啡、半徑內的電波、半徑變成了一個獨立的單位在這個獨立的世界與國家中。 而我的半徑中我是完全自由的非固體! 因為我是法系人物!
2011年3月23日
2011年3月22日
UIActivityIndicatorView : WaitView implementation
Header file --------------------------------------------------
//
// WaitView.h
// UIActivityIndicatorView
//
// Created by Lin, Justin on 2011/3/22.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import
@interface WaitView : NSObject {
UIActivityIndicatorView *activityIndicator;
}
-(void) endWait;
- (void) beginWait;
@end
Source file --------------------------------------------------
//
// WaitView.m
// UIActivityIndicatorView
//
// Created by Lin, Justin on 2011/3/22.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import "WaitView.h"
@interface WaitView(PrivateMethods)
- (UIView *) mainWindow;
- (void) startWaitAnimation;
- (void) stopWaitAnimation;
@end
@implementation WaitView
- (UIView *) mainWindow {
return [[[UIApplication sharedApplication] windows] objectAtIndex:0];
}
- (void) startWaitAnimation {
if (activityIndicator != nil) {
return;
}
activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
[activityIndicator setFrame:CGRectMake(135, 125, 24, 24)];
[activityIndicator setHidesWhenStopped:YES];
[[self mainWindow] addSubview:activityIndicator];
[activityIndicator startAnimating];
}
- (void) stopWaitAnimation {
if (activityIndicator == nil) {
return;
}
[activityIndicator stopAnimating];
[activityIndicator removeFromSuperview];
activityIndicator = nil;
}
-(void) endWait {
// stop thread
[NSThread detachNewThreadSelector: @selector(stopWaitAnimation) toTarget:self withObject:nil];
}
- (void) beginWait {
// start thread
[NSThread detachNewThreadSelector: @selector(startWaitAnimation) toTarget:self withObject:nil];
}
@end
2011年3月21日
[轉貼] JavaScript Touch and Gesture Events iPhone and Android
JavaScript Touch and Gesture Events iPhone and Android
There are quite a few sites that describe the touch and gesture events that can be used in the mobile version of WebKit running on iPhone and iPod Touch. There is, however, not so much info with regards to Android. I've placed a few links at the bottom of this article that contain information used to compile this brief explanation.
Touch events are a bit like mouse events, but there are some very important differences when it comes to touch vs. mouse:
A touch object contains pretty much the same data as a mouse event such as pageX, pageY etc...
Example:
Apples WebKit implementation has a few things that are different from the Android implementation. The touchEnd event removes the current touch from the
Example:
Touch events are a bit like mouse events, but there are some very important differences when it comes to touch vs. mouse:
- A touch is very hard to keep steady whilst a mouse can stay at a fixed position - this means that we go from a touchStart event directly to a touchMove event. Unlike a mouse where a mouseDown event is likely to fire without being followed up by a mouseMove event.
- There is no mouseOver equivalent since a touch can be discontinuous, i.e., we can get from point A to point B without the need of drawing a continuous line between these points.
- A touch is an averaged point taken from the surface area in contact with the pointing device (your finger) translated to pixel coordinates - like finding the centre of a circle. A mouse is very precise and there is no averaging that needs to be done. What I'm trying to say is that a touch is not as accurate as a mouse.
Android and iPhone touch events
Android and iPhone versions of WebKit have some touch events in common:- touchstart - triggered when a touch is initiated. Mouse equivalent - mouseDown
- touchmove - triggered when a touch moves. Mouse equivalent - mouseMove
- touchend - triggered when a touch ends. Mouse equivalent - mouseUp. This one is a bit special on the iPhone - see below
- touchcancel - bit of a mystery
document.addEventListener('touchstart', function(event) { alert(event.touches.length); }, false);
The Event object
As you may have noticed above, the event object contains an array called touches (in Androids case, the event object also containes a touch object - at this stage, touches has always a length of 1 in Android so event.touches[0] === event.touch). The touches array is Apples way of handling multi-touch events - but more on that later.A touch object contains pretty much the same data as a mouse event such as pageX, pageY etc...
Example:
document.addEventListener('touchmove', function(event) { event.preventDefault(); var touch = event.touches[0]; console.log("Touch x:" + touch.pageX + ", y:" + touch.pageY); }, false);
What about a click?
mouseClick events are triggered after a touchStart, touchEnd event sequence. A reason for mouseClick events not triggering can be that the event propagates further and a touchMove being initiated - this will cancel the mouseClick event sequence.iPhone Touch and Gesture Events
Apples WebKit implementation has a few things that are different from the Android implementation. The touchEnd event removes the current touch from the
event.touches array. Instead, we have to look inside the event.changedTouches array.Apples event object for touch events
The event object contains the following arrays:- touches - contains touch information upon touchStart and touchMove not touchEnd events
- targetTouches - contains information for touches originating from the same target element
- changedTouches - contains touch information upon all touch events
Gesture events
Apple supports gestures which are mult-touch events such as "pinching" and "rotating":- gesturestart - triggered when initiating a multi-touch event
- gesturechange - triggered when multiple touches move
- gestureend - triggered when a multi-touch event ends
Example:
document.addEventListener('gesturechange', function(event) { event.preventDefault(); console.log("Scale: " + event.scale + ", Rotation: " + event.rotation); }, false);
Event table
| touchstart | touchmove | touchend | gesturestart | gesturemove | gestureend | |
|---|---|---|---|---|---|---|
| Android | y | y | y | n | n | n |
| iPhone | y | y | y | y | y | y |
| has event.touches | y | y | y | n | n | n |
| (iPhone) has event.scale and event.rotation | n | n | n | y | y | y |
| (iPhone) touch in event.touches | y | y | n | - | - | - |
| (iPhone) touch in event.changedTouches | y | y | y | - | - | - |
Links
訂閱:
文章 (Atom)