android处理双击事件(2)
android:padding="0px"
/>
<Button
android:background="@android:color/transparent"
android:layout_height="30dip"
android:layout_width="50dip"
android:id="@+id/rightDown"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_margin="0px"
android:padding="0px"
/>
</RelativeLayout>
activity:
Java代码
import android.content.Context;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.Button;
import android.widget.Toast;
public class AboutActivity extends Activity {
private Button leftUp;
private Button rightUp;
private Button leftDown;
private Button rightDown;
private ButtonOnTouchListener listener = new ButtonOnTouchListener();
private Context mContext;
//计算点击的次数
private int count;
//第一次点击的时间 long型
private long firstClick;
//最后一次点击的时间
private long lastClick;
//第一次点击的button的id
private int firstId;
//调试环境是否开启
private boolean isDebugOpen = false;
//日志环境是否开启
private boolean isLogOpen = false;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about);
相关新闻>>
- 发表评论
-
- 最新评论 更多>>