当前位置:网站首页>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 :

边栏推荐
- Current market situation and development prospect forecast of the global fire boots industry in 2022
- Shell script -- condition judgment
- Notes | numpy-10 Iterative array
- MC Layer Target
- Review the configuration of vscode to develop golang
- Introduction to JVM principle
- Blog building tool recommendation (text book delivery)
- 2022 P cylinder filling test content and P cylinder filling simulation test questions
- Market status and development prospects of the global IOT active infrared sensor industry in 2022
- [BMZCTF-pwn] 20-secret_ file
猜你喜欢

关于开学的准备与专业认知
![[PCL self study: filtering] introduction and use of various filters in PCL (continuously updated)](/img/36/53886b9d3b98f744be2b6aa6b5d3eb.jpg)
[PCL self study: filtering] introduction and use of various filters in PCL (continuously updated)

Do you know UVs in modeling?

Auman Galaxy new year of the tiger appreciation meeting was held in Beijing - won the double certification of "intelligent safety" and "efficient performance" of China Automotive Research Institute

Career planning of counter attacking College Students

JVM原理简介

JDBC database operation

Basic use of Metasploit penetration testing framework

ZABBIX monitoring of lamp architecture (3): zabbix+mysql (to be continued)

移动端——uniapp开发记录(公共请求request封装)
随机推荐
Network security textual research recommendation
Notes | numpy-08 Advanced index
Interface frequency limit access
移动端——uniapp开发记录(公共请求request封装)
Current market situation and development prospect forecast of global UV sensitive resin 3D printer industry in 2022
Market status and development prospect prediction of global SoC Test Platform Industry in 2022
[BMZCTF-pwn] 20-secret_ file
General undergraduate college life pit avoidance Guide
MC Layer Target
[luatos sensor] 1 light sensing bh1750
Notes | numpy-09 Broadcast
Market status and development prospect prediction of the global fire alarm sensor industry in 2022
论文阅读_中文NLP_ELECTRA
stm32逆向入门
[set theory] binary relation (example of binary relation on a | binary relation on a)
Market status and development prospects of the global automatic tea picker industry in 2022
7. Integrated learning
[SQL injection point] location and judgment of the injection point
The simple problem of leetcode: dismantling bombs
【工具跑SQL盲注】