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

边栏推荐
- Market status and development prospect prediction of global SoC Test Platform Industry in 2022
- [BMZCTF-pwn] 18-RCTF-2017-Recho
- Integration of Android high-frequency interview questions (including reference answers)
- After job hopping at the end of the year, I interviewed more than 30 companies in two weeks and finally landed
- Small sample target detection network with attention RPN and multi relationship detector (provide source code, data and download)
- Mobile terminal - uniapp development record (public request encapsulation)
- On typescript and grammar
- Shell script Basics - basic grammar knowledge
- Market status and development prospect prediction of the global fire hose industry in 2022
- 2022 tea master (intermediate) examination questions and tea master (intermediate) examination skills
猜你喜欢

逆袭大学生的职业规划

Prepare for 2022 and welcome the "golden three silver four". The "summary of Android intermediate and advanced interview questions in 2022" is fresh, so that your big factory interview can go smoothly

stm32逆向入门
![[USACO 2009 Dec S]Music Notes](/img/e6/282a8820becdd24d63dcff1b81fcaf.jpg)
[USACO 2009 Dec S]Music Notes

Thesis reading_ Chinese medical model_ eHealth

2022 t elevator repair simulation examination question bank and t elevator repair simulation examination question bank

Uipath practice (08) - selector

移动端——uniapp开发记录(公共请求request封装)

Integration of Android high-frequency interview questions (including reference answers)

Network security textual research recommendation
随机推荐
Pyqt control part (II)
Market status and development prospect prediction of the near infrared sensor industry of the global Internet of things in 2022
ZABBIX monitoring of lamp architecture (2): ZABBIX basic operation
I stepped on a foundation pit today
Caijing 365 stock internal reference: what's the mystery behind the good father-in-law paying back 50 million?
Mobile terminal - uniapp development record (public request encapsulation)
Web security - CSRF (token)
Do you know UVs in modeling?
普通本科大学生活避坑指南
The current market situation and development prospect of the global gluten tolerance test kit industry in 2022
Market status and development prospects of the global IOT active infrared sensor industry in 2022
论文阅读_中文NLP_ELECTRA
Learn to use the idea breakpoint debugging tool
[BMZCTF-pwn] 18-RCTF-2017-Recho
Keepalived热备与HAProxy
论文阅读_中文医疗模型_ eHealth
带有注意力RPN和多关系检测器的小样本目标检测网络(提供源码和数据及下载)...
Hj35 serpentine matrix
论文阅读_ICD编码_MSMN
Current market situation and development prospect forecast of the global fire boots industry in 2022