Skip to content

チャットが2行以上になると、最後までスクロールされないバグ修正 - #268

Merged
chigichan24 merged 1 commit into
developmentfrom
267-chat-scroll
May 13, 2018
Merged

chigichan24 merged 1 commit into
developmentfrom
267-chat-scroll

Conversation

@mori-atsushi

@mori-atsushi mori-atsushi commented May 8, 2018

Copy link
Copy Markdown
Collaborator

close #267

うーん…って感じ

val lastListPosition = adapter.itemCount - 1
if (lastListPosition - 1 == lastVisiblePosition) {
binding.chatList.smoothScrollToPosition(lastListPosition)
binding.chatList.smoothScrollToPosition(lastListPosition + 1)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここらへん算数すぎて泣きたくなる.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

というか範囲外を参照することで下までスクロールされるのまじか...

@chigichan24 chigichan24 May 9, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

拡張関数としてsmoothScrolltoLastPositionみたいなのつくってせめてラップしましょう!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

算数できないの?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

了解

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

うーん、lastListPositionが結局adapter経由でしかわからないので、あまり綺麗にならなさそう
このあたりちゃんとViewModelに持ってくるべきな気がしてきた
でも、とりあえず下までスクロールされる形でリリースしたいので、一旦マージして別Issueで対処しませんか?

@chigichan24

Copy link
Copy Markdown
Member

別Issueを立てといてください

@chigichan24
chigichan24 merged commit 0504622 into development May 13, 2018
@chigichan24
chigichan24 deleted the 267-chat-scroll branch May 13, 2018 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

チャットが2行以上になると、最後までスクロールされないバグ

2 participants