入院が年明けまで続きそうな勢いです!
ブログ更新をあまりにもしないのもアレなんで・・・
ぱすわ〜ど帳(SA)
なんでもらんちゃ〜(SA)
ぶろ〜どきゃすた〜(SA)
のレビュー、ちゃんと見ています!!!
ご安心ください!!!
そうそう・・・
せっかくのこの機会を利用して、ぱすわ〜ど帳(SA)の機能を
検討していたりします。
・検索機能
・カテゴリロック機能
・パスワード生成ロジック変更
といったものを検討しています!!!
ということで、今日はこの辺で!!!
みなさ〜〜〜ん
よいお年を
主にAndroidのアプリ開発についてツラツラと書いてくブログです。 iPhoneの開発も手がけてます! Androidアプリのサポートは終了させていただきました。
import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Path; import android.util.AttributeSet; import android.view.MotionEvent; import android.webkit.WebView; public class WritableWebView extends WebView { private Path _writedPath = null; private Paint _paint = null; public WritableWebView(Context context) { super(context); _writedPath = new Path(); _paint = new Paint(Paint.DITHER_FLAG); _paint.setAntiAlias(true); _paint.setDither(true); _paint.setColor(0xFFFF0000); _paint.setStyle(Paint.Style.STROKE); _paint.setStrokeJoin(Paint.Join.ROUND); _paint.setStrokeCap(Paint.Cap.ROUND); _paint.setStrokeWidth(12); } public WritableWebView(Context context, AttributeSet attrs) { super(context, attrs); _writedPath = new Path(); _paint = new Paint(Paint.DITHER_FLAG); _paint.setAntiAlias(true); _paint.setDither(true); _paint.setColor(0xFFFF0000); _paint.setStyle(Paint.Style.STROKE); _paint.setStrokeJoin(Paint.Join.ROUND); _paint.setStrokeCap(Paint.Cap.ROUND); _paint.setStrokeWidth(12); } public WritableWebView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); _writedPath = new Path(); _paint = new Paint(Paint.DITHER_FLAG); _paint.setAntiAlias(true); _paint.setDither(true); _paint.setColor(0xFFFF0000); _paint.setStyle(Paint.Style.STROKE); _paint.setStrokeJoin(Paint.Join.ROUND); _paint.setStrokeCap(Paint.Cap.ROUND); _paint.setStrokeWidth(12); } @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.drawPath(_writedPath, _paint); } private float mX, mY; private static final float TOUCH_TOLERANCE = 4; private void touch_start(float x, float y) { _writedPath.reset(); _writedPath.moveTo(x, y); mX = x; mY = y; } private void touch_move(float x, float y) { float dx = Math.abs(x - mX); float dy = Math.abs(y - mY); if (dx >= TOUCH_TOLERANCE || dy >= TOUCH_TOLERANCE) { _writedPath.quadTo(mX, mY, (x + mX)/2, (y + mY)/2); mX = x; mY = y; } } private void touch_up() { _writedPath.lineTo(mX, mY); } @Override public boolean onTouchEvent(MotionEvent event) { if (_writable == true) { float x = event.getX(); float y = event.getY(); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: touch_start(x, y); invalidate(); break; case MotionEvent.ACTION_MOVE: touch_move(x, y); invalidate(); break; case MotionEvent.ACTION_UP: touch_up(); invalidate(); break; } return true; } else { return super.onTouchEvent(event); } } }
WritableWebView webview = (WritableWebView)findViewById(R.id.webview); webview.getSettings().setJavaScriptEnabled(true); webview.loadUrl("http://developerwaiwai.blogspot.jp/");
@interface WritableView : UIView { UIBezierPath* _path; } @end @implementation WritableView - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.opaque = YES; self.backgroundColor = [UIColor colorWithWhite:1.0f alpha:0.0f]; self.autoresizesSubviews = YES; self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; self.contentMode = UIViewContentModeScaleToFill; _path = [UIBezierPath bezierPath]; _path.lineCapStyle = kCGLineCapRound; _path.lineJoinStyle = kCGLineJoinRound; } return self; } - (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event { UITouch* touch = [[event touchesForView:self] anyObject]; CGPoint touchedLocation = [touch locationInView:self]; [_path removeAllPoints]; [_path moveToPoint:touchedLocation]; } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch* touch = [[event touchesForView:self] anyObject]; CGPoint movedLocation = [touch locationInView:self]; [_path addLineToPoint:movedLocation]; [self setNeedsDisplay]; } - (void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event { [self setNeedsDisplay]; } - (void)drawRect:(CGRect)rect { [[UIColor redColor] setStroke]; _path.lineWidth = 5; [_path stroke]; } @end
writableView = [[WritableView alloc] initWithFrame:frame]; [webView.superview addSubView:writableView];
30秒ルールって知ってます? 一旦マスターパスワード解除したら、30秒間はマスターパスワードなしで 入れる仕様にしてあるため、それと勘違いしてるんじゃないですかね! |
お持ちのアプリ | |||
---|---|---|---|
120,464
|
58.94 %
| ||
48,086
|
23.53 %
| ||
21,005
|
10.28 %
| ||
11,520
|
5.64 %
| ||
1,878
|
0.92 %
| ||
759
|
0.37 %
| ||
345
|
0.17 %
| ||
208
|
0.10 %
| ||
56
|
0.03 %
| ||
78
|
0.04 %
|