Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject RecycledViewPool by using Dagger2 #662

Merged
merged 2 commits into from
Feb 10, 2018

Conversation

chibatching
Copy link
Contributor

@chibatching chibatching commented Feb 10, 2018

Issue

  • no issue

Overview (Required)

  • Share RecycledViewPool by using Dagger module
    • ViewModel must not reference a view instance. It may cause memory leaking.

Links

Screenshot

Before After

import io.github.droidkaigi.confsched2018.presentation.MainActivity

@Module interface MainActivityBuilder {
@ContributesAndroidInjector(modules = [MainActivityModule::class])
@ContributesAndroidInjector(modules = [MainActivityModule::class, RecycledViewPoolModule::class])

Choose a reason for hiding this comment

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

⚠️ Exceeded max line length (100)

Copy link
Contributor

Choose a reason for hiding this comment

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

This is unrelated to the PR but I'm curious what tool you're using for the automatic code reviews. Looking to implement something similar for my projects. Thanks.

@jmatsu
Copy link
Contributor

jmatsu commented Feb 10, 2018

👀

import dagger.Module
import dagger.Provides

// Share RecycledViewPool between content fragments of ViewPager.
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@jmatsu jmatsu left a comment

Choose a reason for hiding this comment

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

LGTM!

@jmatsu jmatsu merged commit 2e0ddf7 into DroidKaigi:master Feb 10, 2018
@chibatching chibatching deleted the share_view_pool_via_daggaer branch February 10, 2018 07:51
@chibatching
Copy link
Contributor Author

Thanks! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants