当前位置:网站首页>WebView, Scrollview sliding conflict correction
WebView, Scrollview sliding conflict correction
2022-06-30 11:46:00 【xiyangyang8110】
public class MyScrollView extends ScrollView {
private GestureDetector mGestureDetector;
View.OnTouchListener mGestureListener;
public MyScrollView(Context context, AttributeSet attrs) {
super(context, attrs);
mGestureDetector = new GestureDetector(context, new YScrollDetector());
setFadingEdgeLength(0);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
return super.onInterceptTouchEvent(ev) && mGestureDetector.onTouchEvent(ev);
}
// Return false if we're scrolling in the x direction
class YScrollDetector extends GestureDetector.SimpleOnGestureListener {
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
if (Math.abs(distanceY) > Math.abs(distanceX)) {
return true;
}
return false;
}
}
}
边栏推荐
- HMS Core音频编辑服务3D音频技术,助力打造沉浸式听觉盛宴
- 暑假学习记录
- 来聊聊怎么做硬件兼容性检测,快速迁移到openEuler?
- [xi'anjiaotonguniversity] information sharing of the first and second postgraduate entrance examinations
- The latest collection of arouter problems
- Record the memory leak of viewpager + recyclerview once
- 谁还记得「张同学」?
- 【模式识别大作业】
- There are so many kinds of coupons. First distinguish them clearly and then collect the wool!
- Summer vacation study record
猜你喜欢

如何通过GDB分析Native Crash

led背光板的作用是什麼呢?

科普达人丨漫画图解什么是eRDMA?

60 divine vs Code plug-ins!!

HMS Core音频编辑服务3D音频技术,助力打造沉浸式听觉盛宴

国产数据库的黄金周期要来了吗?

The operation and maintenance security gateway (Fortress machine) of Qiming star group once again won the first place!

Wechat Emoji is written into the judgment, and every Emoji you send may become evidence in court

暑假学习记录

wallys/IPQ8074a/2x(4×4 or 8×8) 11AX MU-MIMO DUAL CONCURRENT EMBEDDEDBOARD
随机推荐
一个人就是一本书
Flutter 从零开始 004 按钮组件
It's time for the kotlin coroutine to schedule thread switching to solve the mystery
If it is not listed again, Kuangshi technology will not be able to endure
EMC surge
It is said that with this, the boss opened the test overnight
8 lines of code to achieve quick sorting, easy to understand illustrations!
Summer vacation study record
Set up your own website (13)
Our company has used this set of general solutions for 7 years, and has opened up dozens of systems, a stable batch!
EMC-浪涌
Boost研究:Boost Log
Oracle netsuite helps TCM bio understand data changes and make business development more flexible
孔松(信通院)-数字化时代云安全能力建设及趋势
Esp32-c3 introductory tutorial basic part ⑫ - mass production burning device configuration and serial number, NVS partition confirmation, NVS partition generation program, CSV to bin
对象映射 - Mapping.Mapster
"War" caused by a bottle of water
Xu Lei expressed three thanks for the most difficult 618 in 19 years
PointDistiller:面向高效紧凑3D检测的结构化知识蒸馏
Using cookie technology to realize historical browsing records and control the number of displays