IntercepteTouchRelativeLayout.java
1.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.xdy.ui.viewgroup;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.RelativeLayout;
/**
* 拦截Touch事件到下层Fragment
* Created by Administrator on 2017/4/5.
*/
public class IntercepteTouchRelativeLayout extends RelativeLayout implements View.OnTouchListener {
public IntercepteTouchRelativeLayout(Context context) {
super(context);
setOnTouchListener(this);
}
public IntercepteTouchRelativeLayout(Context context, AttributeSet attrs) {
super(context, attrs);
setOnTouchListener(this);
}
public IntercepteTouchRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
setOnTouchListener(this);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
return super.onTouchEvent(event);
}
@Override
public boolean onTouch(View v, MotionEvent event) {
return true;
}
}