![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Android •
文章平均质量分 77
Rainlee007
这个作者很懒,什么都没留下…
展开
-
转载:Android dispatchTouchEvent
android中的事件类型分为按键事件和屏幕触摸事件,Touch事件是屏幕触摸事件的基础事件,有必要对它进行深入的了解。一个最简单的屏幕触摸动作触发了一系列Touch事件:ACTION_DOWN->ACTION_MOVE->ACTION_MOVE->ACTION_MOVE...->ACTION_MOVE->ACTION_UP当屏幕中包含一个ViewGroup,而这个ViewGroup又包含一个子v转载 2016-08-19 10:19:45 · 257 阅读 · 0 评论 -
关于android中box2D总结与实例
将近来学的box2D总结下,暂时没有涉及到关节,等有时间了再弄吧!这次就通过一个自己写的个实例来总结吧! 首先我得说明下这次编程的目标:在屏幕上画出若干个对象,其中有动态对象,也有静态对象,利用box2D模拟物理世界,使动态对象受到重力作用,静态对象不能重力作用,但能与动态对象发生碰撞,使之状态发生改变,另外,为了能够便于观察到更多的效果,屏幕上的对象(无论动态还是静态)都可以通过用手指触摸,拉动原创 2016-08-19 10:20:38 · 1036 阅读 · 0 评论 -
关于Android如何给传递线程初始化数据
可创建一个内部类实现Runable接口,并设置一个传递数据的方法:class myRunable implements Runnable { private Object enemy; private int delay; public myRunable(Object e, int d) { // TODO Auto-gen原创 2016-08-19 10:20:26 · 524 阅读 · 0 评论 -
关于控件touch事件的整理
关于touch事件的传递:在Activity中接触屏幕后会产生MotionEvent,传递顺序:首先触发Activity的dispatchTouchEvent然后触发Activity的onUserInteraction然后触发Layou的dispatchTouchEvent然后触发Layout的onInterceptTouchEvent(onTouchevent)然后触发View的dispatch原创 2016-08-19 10:20:21 · 331 阅读 · 0 评论 -
关于Bound Services的常用方式
利用服务播放音乐的实例,大部分采用SDK上的方式,MainActivity:package com.example.androidtest;import com.example.androidtest.myService.LocalBinder;import android.os.Bundle;import android.os.IBinder;import android.app.Act原创 2016-08-19 10:20:15 · 356 阅读 · 0 评论 -
android多线程实例及总结
public class FirActivity extends Activity { static final int LOOPER_QUIT=-1; static final int LOOPER_BACK=1; public Handler handler_fat=new Handler()//主线程handler,用于接收子线程传来的消息,并且主线程默认有Loope原创 2016-08-19 10:20:10 · 888 阅读 · 0 评论 -
关于android的零碎问题的整理
本处为个人日常遇到的问题的汇总,随时更新,转自互联网各处,向问题解决者致敬!关于padding与margin的区别:padding是站在父view的角度描述问题,它规定它里面的内容必须与这个父view边界的距离。margin则是站在自己的角度描述问题,规定自己和其他(上下左右)的view之间的距离,如果同一级只有一个view,那么它的效果基本上就和padding一样了650) this.width原创 2016-08-19 10:20:05 · 258 阅读 · 0 评论 -
关于peoperty animation的理解
关于ValueAnimation的使用:ValueAnimator animation = ValueAnimator.ofObject(//此处的ofObject表示建立一个自定义TypeEvaluator的 ValueAnimator,除此之外还有ofFloat等,分别表示建立一个含FloatEvaluator等的ValueAnimator, new TypeE原创 2016-08-19 10:19:59 · 406 阅读 · 0 评论 -
[Android应用]对GroupView中onInterceptTouchEvent方法的理解
onInterceptTouchEvent(MotionEvent ev)方法是GroupView控件中特有的一个方法,我们可以实现这个方法来截获所有的窗口点击事件来根据事件的不同来对子控件或自身分发事件触发。覆盖这个方法时需要小心注意,因为它和View.onTouchEvent(MotionEvent)有着复杂的关系,我们使用是需要和View.onTouchEvent(MotionEvent)一转载 2016-08-19 10:19:51 · 264 阅读 · 0 评论 -
android 事件处理机制
文一:参考:http://blog.csdn.net/ddna/archive/2010/04/11/5473293.aspxhttp://www.cnblogs.com/rocky_yi/archive/2011/01/21/1941522.html#http://chroya.iteye.com/blog/668297http://www.blogjava.net/lzqdiy/archive转载 2016-08-19 10:19:48 · 227 阅读 · 0 评论 -
关于手势识别
手势识别 public class Gesture implements OnGestureListener { private GestureDetector gestureDetector; public void onTouchEvent(MotionEvent event) { gestureDetector.onTouchEvent(event);原创 2016-08-19 10:20:59 · 360 阅读 · 0 评论