当前位置:网站首页>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 :
边栏推荐
- Shell script Basics - basic grammar knowledge
- Oracle SQL table data loss
- Youdao cloud notes
- 【SQL注入】联合查询(最简单的注入方法)
- Number of 1 in binary (simple difficulty)
- Leetcode simple question: check whether the string is an array prefix
- Current market situation and development prospect prediction of global direct energy deposition 3D printer industry in 2022
- Market status and development prospect prediction of the global fire hose industry in 2022
- Notes | numpy-09 Broadcast
- data2vec! New milestone of unified mode
猜你喜欢
Interface frequency limit access
Leetcode simple problem delete an element to strictly increment the array
4 years of experience to interview test development, 10 minutes to end, ask too
论文阅读_中文NLP_ELECTRA
Learn to use the idea breakpoint debugging tool
Leetcode simple question: the key with the longest key duration
ZABBIX monitoring of lamp architecture (2): ZABBIX basic operation
First + only! Alibaba cloud's real-time computing version of Flink passed the stability test of big data products of the Institute of ICT
Apache MPM model and ab stress test
Cross platform plug-in flutter for displaying local notifications_ local_ notifications
随机推荐
UiPath实战(08) - 选取器(Selector)
论文阅读_中文NLP_ELECTRA
Notes | numpy-07 Slice and index
Market status and development prospect prediction of the global fire extinguisher industry in 2022
文献阅读_基于多模态数据语义融合的旅游在线评论有用性识别研究(中文文献)
4 years of experience to interview test development, 10 minutes to end, ask too
Market status and development prospect prediction of global SoC Test Platform Industry in 2022
Do you know UVs in modeling?
Summary of training competition (Lao Li's collection of questions)
JDBC database operation
Leetcode simple problem delete an element to strictly increment the array
Thesis reading_ Chinese medical model_ eHealth
论文阅读_中文医疗模型_ eHealth
@RequestMapping
Market status and development prospect prediction of global colorimetric cup cover industry in 2022
Notes | numpy-08 Advanced index
2022 P cylinder filling test content and P cylinder filling simulation test questions
C primre plus Chapter 10 question 6 inverted array
2022 a special equipment related management (elevator) analysis and a special equipment related management (elevator) simulation test
Learn to use the idea breakpoint debugging tool