Unverified Commit 2b4fee28 authored by Lucio Maciel's avatar Lucio Maciel Committed by GitHub

Merge pull request #1633 from RocketChat/fix/analyticsManager-not-initialized

[FIX] Analytics manager not initialized
parents a6937fca 4661662c
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
] ]
) )
......
...@@ -2,6 +2,7 @@ package chat.rocket.android.members.di ...@@ -2,6 +2,7 @@ package chat.rocket.android.members.di
import chat.rocket.android.members.ui.MembersFragment import chat.rocket.android.members.ui.MembersFragment
import chat.rocket.android.dagger.scope.PerFragment import chat.rocket.android.dagger.scope.PerFragment
import chat.rocket.android.members.ui.MemberBottomSheetFragment
import dagger.Module import dagger.Module
import dagger.android.ContributesAndroidInjector import dagger.android.ContributesAndroidInjector
...@@ -11,4 +12,9 @@ abstract class MembersFragmentProvider { ...@@ -11,4 +12,9 @@ abstract class MembersFragmentProvider {
@ContributesAndroidInjector(modules = [MembersFragmentModule::class]) @ContributesAndroidInjector(modules = [MembersFragmentModule::class])
@PerFragment @PerFragment
abstract fun provideMembersFragment(): MembersFragment abstract fun provideMembersFragment(): MembersFragment
@ContributesAndroidInjector()
@PerFragment
abstract fun provideMemberBottomSheetFragment(): MemberBottomSheetFragment
} }
\ No newline at end of file
...@@ -11,6 +11,7 @@ import chat.rocket.android.analytics.event.ScreenViewEvent ...@@ -11,6 +11,7 @@ import chat.rocket.android.analytics.event.ScreenViewEvent
import chat.rocket.android.util.extensions.content import chat.rocket.android.util.extensions.content
import chat.rocket.android.util.extensions.textContent import chat.rocket.android.util.extensions.textContent
import com.google.android.material.bottomsheet.BottomSheetDialogFragment import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import dagger.android.support.AndroidSupportInjection
import kotlinx.android.synthetic.main.fragment_member_bottom_sheet.* import kotlinx.android.synthetic.main.fragment_member_bottom_sheet.*
import javax.inject.Inject import javax.inject.Inject
...@@ -51,6 +52,7 @@ class MemberBottomSheetFragment : BottomSheetDialogFragment() { ...@@ -51,6 +52,7 @@ class MemberBottomSheetFragment : BottomSheetDialogFragment() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
AndroidSupportInjection.inject(this)
val bundle = arguments val bundle = arguments
if (bundle != null) { if (bundle != null) {
......
{
"formatVersion": 1,
"database": {
"version": 1,
"identityHash": "5d591429a85289a5fe608ab2c4d77b0b",
"entities": [
{
"tableName": "Emoji",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`shortname` TEXT NOT NULL, `shortnameAlternates` TEXT NOT NULL, `unicode` TEXT NOT NULL, `category` TEXT NOT NULL, `count` INTEGER NOT NULL, `siblings` TEXT NOT NULL, `fitzpatrick` TEXT NOT NULL, `url` TEXT, `isDefault` INTEGER NOT NULL, PRIMARY KEY(`shortname`))",
"fields": [
{
"fieldPath": "shortname",
"columnName": "shortname",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "shortnameAlternates",
"columnName": "shortnameAlternates",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "unicode",
"columnName": "unicode",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "category",
"columnName": "category",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "count",
"columnName": "count",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "siblings",
"columnName": "siblings",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "fitzpatrick",
"columnName": "fitzpatrick",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "isDefault",
"columnName": "isDefault",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"shortname"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
}
],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"5d591429a85289a5fe608ab2c4d77b0b\")"
]
}
}
\ No newline at end of file
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