public class BaseActivity extends Activity implements OnTouchListener {
public ProgressDialog progressDialog;
public String states;
public RequestQueue mQueue;
/** 触摸时按下的点 **/
PointF downP = new PointF();
/** 触摸时当前的点 **/
PointF curP = new PointF();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
}
@Override
protected void onResume() {
super.onResume();
}
@Override
public boolean onTouchEvent(MotionEvent event) {
curP.x = event.getX();
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
downP.x = event.getX();
break;
case MotionEvent.ACTION_MOVE:
if (curP.x- downP.x > 500) {
Log.i("TEST", "move-=-=-=--=-");
finish();
}
break;
case MotionEvent.ACTION_UP:
break;
default:
break;
}
return true;
}
@Override
protected void onPause() {
super.onPause();
}
@Override
protected void onDestroy() {
super.onDestroy();
}
}
public class BackScrollView extends ScrollView {
/** 触摸时按下的点 **/
PointF downP = new PointF();
/** 触摸时当前的点 **/
PointF curP = new PointF();
public BackScrollView(Context context) {
super(context);
}
public BackScrollView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
public BackScrollView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
curP.x = event.getX();
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
downP.x = event.getX();
Log.i("TEST", "downP.x-=-=-=--=-" + downP.x);
break;
case MotionEvent.ACTION_MOVE:
Log.i("TEST", "downP.x-=-=-=--=-" + curP.x);
if (downP.x < 200) {
if (curP.x - downP.x > 500) {
return false;
}
}
break;
case MotionEvent.ACTION_UP:
break;
default:
break;
}
return super.onTouchEvent(event);
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有