当前位置:网站首页>Coordinatorlayout appbarrayout recyclerview item exposure buried point misalignment analysis
Coordinatorlayout appbarrayout recyclerview item exposure buried point misalignment analysis
2022-07-03 04:52:00 【Baiyun City Lord Haoda】
Problem description
Coordinatorlayout ( Coordinator layout ) And AppBarLayout Realization topbar The effect of sliding zoom ,
RecyclerView Monitor when sliding stops The first and last visible item Report the exposure point
(findFirstVisibleItemPosition findLastVisibleItemPosition)
However, the reported buried point data is different from what users really see item Not in conformity with , The exposure buried point is inaccurate .
Question why
The height of the user's visible field of view (768)

RecyclerView Calculated height of 1104

Analysis of the source code AppBarLayout redefined heightMeasureSpec MeasureSpec scale size by 1653

The real boundary of the interface is at the bottom of the mobile screen

Solution
findLastVisibleItemPosition Value Start Decrement cycle to findFirstVisibleItemPosition , Judge again in turn item Whether it is the visual field area visible to the user
viewpager.getY()+item.getY() An area smaller than the screen height and considered visible to the user

Nuclear new code :

边栏推荐
- Mobile terminal - uniapp development record (public request encapsulation)
- Integration of Android high-frequency interview questions (including reference answers)
- First + only! Alibaba cloud's real-time computing version of Flink passed the stability test of big data products of the Institute of ICT
- MySQL winter vacation self-study 2022 12 (3)
- 论文阅读_ICD编码_MSMN
- 并发操作-内存交互操作
- [SQL injection point] location and judgment of the injection point
- Shuttle + Alluxio 加速内存Shuffle起飞
- Introduction to message queuing (MQ)
- MPM model and ab pressure test
猜你喜欢

Youdao cloud notes

M1 Pro install redis

"Niuke brush Verilog" part II Verilog advanced challenge

Silent authorization login and registration of wechat applet
![[luatos sensor] 2 air pressure bmp180](/img/88/2a6caa5fec95e54e3fb09c74ba8ae6.jpg)
[luatos sensor] 2 air pressure bmp180

【XSS绕过-防护策略】理解防护策略,更好的绕过

JVM原理简介
![[XSS bypass - protection strategy] understand the protection strategy and better bypass](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[XSS bypass - protection strategy] understand the protection strategy and better bypass

Analysis of proxy usage of ES6 new feature

Apache MPM model and ab stress test
随机推荐
论文阅读_中文医疗模型_ eHealth
Keepalived热备与HAProxy
Notes | numpy-10 Iterative array
Market status and development prospects of the global IOT active infrared sensor industry in 2022
Sdl2 + OpenGL glsl practice (Continued)
Introduction to JVM principle
Market status and development prospect prediction of global fermentation acid industry in 2022
Handling record of electric skateboard detained by traffic police
[luatos sensor] 2 air pressure bmp180
Thesis reading_ Chinese medical model_ eHealth
Shuttle + Alluxio 加速内存Shuffle起飞
Esp32-c3 learning and testing WiFi (II. Wi Fi distribution - smart_config mode and BlueIf mode)
文献阅读_基于多模态数据语义融合的旅游在线评论有用性识别研究(中文文献)
The programmer resigned and was sentenced to 10 months for deleting the code. JD came home and said that it took 30000 to restore the database. Netizen: This is really a revenge
联发科技2023届提前批IC笔试(题目)
Number of uniform strings of leetcode simple problem
Truncated sentences of leetcode simple questions
Apache MPM model and ab stress test
Market status and development prospect prediction of global SoC Test Platform Industry in 2022
Analysis of proxy usage of ES6 new feature