DroidKaigi / conference-app-2018

The Official Conference App for DroidKaigi 2018 Tokyo
Apache License 2.0
1.35k stars 332 forks source link

Share RecycledViewPool between view pager content fragments #660

Closed chibatching closed 6 years ago

chibatching commented 6 years ago

Issue

Overview (Required)

Problem

I'm not sure it is appropriate to keep RecyclerViewPool on SessionsViewModel. I think there are three options.

  1. Share through SessionsViewModel (This PR is) or other new ViewModel.
  2. Keep pool on SessionFragment and each content Fragment get from it.
  3. Keep pool on ViewPager and pass pool from ViewPager to content Fragment

Do you have any advice to give to?

Links

-

Screenshot

Before After
takahirom commented 6 years ago

πŸ†’

takahirom commented 6 years ago

We try this πŸ‘

takahirom commented 6 years ago

@chibatching This is very useful pull request for all apps πŸ‘ Sorry When merged I was high. I think this is leaking. Because ViewModel can exist across the recreation of Activity. And probably RecyclerViewPool have views that have activity SessionFragment or MainActivity should have that. Probably we should create an interface for that. image

chibatching commented 6 years ago

You may be right. I''ll check and fix later! Thanks!

takahirom commented 6 years ago

@chibatching ThanksπŸ™

chibatching commented 6 years ago

I fixed at #662 πŸ™