Commit bc27c6f5 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Another fix for analyticsManager not initialized

parent 4a2cf20f
package chat.rocket.android.about.di
import chat.rocket.android.about.ui.AboutFragment
import dagger.Module
import dagger.android.ContributesAndroidInjector
@Module
abstract class AboutFragmentProvider {
@ContributesAndroidInjector()
abstract fun provideAboutFragment(): AboutFragment
}
...@@ -10,6 +10,7 @@ import chat.rocket.android.R ...@@ -10,6 +10,7 @@ import chat.rocket.android.R
import chat.rocket.android.analytics.AnalyticsManager import chat.rocket.android.analytics.AnalyticsManager
import chat.rocket.android.analytics.event.ScreenViewEvent import chat.rocket.android.analytics.event.ScreenViewEvent
import chat.rocket.android.main.ui.MainActivity import chat.rocket.android.main.ui.MainActivity
import dagger.android.support.AndroidSupportInjection
import kotlinx.android.synthetic.main.app_bar.* import kotlinx.android.synthetic.main.app_bar.*
import kotlinx.android.synthetic.main.fragment_about.* import kotlinx.android.synthetic.main.fragment_about.*
import javax.inject.Inject import javax.inject.Inject
...@@ -20,6 +21,11 @@ class AboutFragment : Fragment() { ...@@ -20,6 +21,11 @@ class AboutFragment : Fragment() {
@Inject @Inject
lateinit var analyticsManager: AnalyticsManager lateinit var analyticsManager: AnalyticsManager
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
AndroidSupportInjection.inject(this)
}
override fun onCreateView( override fun onCreateView(
inflater: LayoutInflater, inflater: LayoutInflater,
container: ViewGroup?, container: ViewGroup?,
...@@ -36,8 +42,10 @@ class AboutFragment : Fragment() { ...@@ -36,8 +42,10 @@ class AboutFragment : Fragment() {
private fun setupViews() { private fun setupViews() {
text_version_name.text = BuildConfig.VERSION_NAME text_version_name.text = BuildConfig.VERSION_NAME
text_build_number.text = getString(R.string.msg_build, BuildConfig.VERSION_CODE, text_build_number.text = getString(
BuildConfig.GIT_SHA, BuildConfig.FLAVOR) R.string.msg_build, BuildConfig.VERSION_CODE,
BuildConfig.GIT_SHA, BuildConfig.FLAVOR
)
} }
private fun setupToolbar() { private fun setupToolbar() {
......
package chat.rocket.android.dagger.module package chat.rocket.android.dagger.module
import chat.rocket.android.about.di.AboutFragmentProvider
import chat.rocket.android.authentication.di.AuthenticationModule import chat.rocket.android.authentication.di.AuthenticationModule
import chat.rocket.android.authentication.login.di.LoginFragmentProvider import chat.rocket.android.authentication.login.di.LoginFragmentProvider
import chat.rocket.android.authentication.registerusername.di.RegisterUsernameFragmentProvider import chat.rocket.android.authentication.registerusername.di.RegisterUsernameFragmentProvider
...@@ -58,6 +59,7 @@ abstract class ActivityBuilder { ...@@ -58,6 +59,7 @@ abstract class ActivityBuilder {
CreateChannelProvider::class, CreateChannelProvider::class,
ProfileFragmentProvider::class, ProfileFragmentProvider::class,
SettingsFragmentProvider::class, SettingsFragmentProvider::class,
AboutFragmentProvider::class,
PreferencesFragmentProvider::class PreferencesFragmentProvider::class
] ]
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment