Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ChatFragment : BaseFragment() {
val lastVisiblePosition = manager.findLastVisibleItemPosition()
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で対処しませんか?

}
}
}
Expand Down