Skip to content

人気ルームの一覧を作る - #264

Merged
chigichan24 merged 7 commits into
developmentfrom
120-popular-room
May 13, 2018
Merged

人気ルームの一覧を作る#264
chigichan24 merged 7 commits into
developmentfrom
120-popular-room

Conversation

@mori-atsushi

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

Copy link
Copy Markdown
Collaborator

close #260
DiffUtilをいい感じにするとより良い感じになるはず

@chigichan24 chigichan24 left a comment

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.

挙動は大丈夫そうです.

.map { convertToViewModel(it) }
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ response ->
response.forEachIndexed { index, viewModel ->

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.

もうこれDiffUtilにぶん投げるんですね.おk.

response.forEachIndexed { index, viewModel ->
when (index) {
in 0..(this.roomViewModels.size - 1) ->
if (isChanged(this.roomViewModels[index], viewModel)) {

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.

private fun isChanged() 使わなくなってるはずなんで消してくださいー

.observeOn(AndroidSchedulers.mainThread())
)
.subscribe({
it.first.run {

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.

it.firstit.second可能なら意味の分かる名前で置いて処理してほしい.

binding.joinedRoomRecycler.adapter = adapter
binding.joinedRoomRecycler.layoutManager = LinearLayoutManager(this)
binding.joinedRoomRecycler.run {
this.isNestedScrollingEnabled = false

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.

なんか下と似たことしてるのでまとめたい.

val result: String,
val user: User?,
val room: Room?,
val rooms: List<Room>?,

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.

roomsはserializedNameに入れてもう少し中身が分かるプロパティ名にしません?roomsだと,なんかjoined_rooms \sunseteq rooms みたいな印象を与える.

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 merged commit 6c5e829 into development May 13, 2018
@chigichan24
chigichan24 deleted the 120-popular-room branch May 13, 2018 04:57
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 participants