Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

RecyclerView is scrolling to top, while user is scrolling down (bad anchorPosition?)

オープン
#229 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
kotlin
領域
mobile

調査の方向性

まず、下方向に連続してスクロールしながら codelab で問題を再現し、その後 GithubRemoteMediator のロードログと報告された anchorPosition の変化を調べます。anchorPosition が 81 から 41 に戻る理由を特定し、スクロールによって以前の要素にジャンプしなくなったことを確認します。

索引モデルが issue の本文から書いたものです。

説明

After continuously scrolling down, after a while RecyclerView is switching his position to some element which was before, resulting in not smooth displaying of elements in it.
I only change NETWORK_PAGE_SIZE to 20, and switch to latest versions of:
roomVersion = '2.4.3'
pagingVersion = '3.1.1'

I added logs to GithubRemoteMediator, when scrolling down, there is:

15:21:54.884 RemoteMediator           D  load, type: REFRESH, state.pages.size: 0, anchorPosition: null
15:21:55.935 RemoteMediator           D  load, type: PREPEND, state.pages.size: 1, anchorPosition: null
15:21:55.999 RemoteMediator           D  load, type: APPEND, state.pages.size: 1, anchorPosition: 3
15:21:56.918 RemoteMediator           D  load, type: APPEND, state.pages.size: 1, anchorPosition: 0
15:21:57.748 RemoteMediator           D  load, type: APPEND, state.pages.size: 1, anchorPosition: 0
15:22:02.064 RemoteMediator           D  load, type: APPEND, state.pages.size: 2, anchorPosition: 40
15:22:04.697 RemoteMediator           D  load, type: APPEND, state.pages.size: 2, anchorPosition: 30
15:22:08.322 RemoteMediator           D  load, type: APPEND, state.pages.size: 4, anchorPosition: 81
15:22:10.000 RemoteMediator           D  load, type: APPEND, state.pages.size: 2, anchorPosition: 41

As You can see, anchorPosition after element 81 is going to be 41, which result in RecyclerView most likely going to that element.

主要言語
Kotlin
スター
509
フォーク
268
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

android/codelab-android-paging のほかの issue

android/codelab-android-paging の issue をすべて見る

似ている issue

Kotlin の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。