Unverified Commit 5154d4ff authored by Rafael Kellermann Streit's avatar Rafael Kellermann Streit Committed by GitHub

Merge branch 'develop' into search_click

parents 64069aa2 9b4af327
...@@ -16,8 +16,8 @@ android { ...@@ -16,8 +16,8 @@ android {
applicationId "chat.rocket.android" applicationId "chat.rocket.android"
minSdkVersion versions.minSdk minSdkVersion versions.minSdk
targetSdkVersion versions.targetSdk targetSdkVersion versions.targetSdk
versionCode 2043 versionCode 2048
versionName "2.6.1" versionName "3.0.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true multiDexEnabled true
...@@ -152,6 +152,8 @@ dependencies { ...@@ -152,6 +152,8 @@ dependencies {
implementation libraries.livedataKtx implementation libraries.livedataKtx
implementation 'com.google.code.findbugs:jsr305:3.0.2'
// Proprietary libraries // Proprietary libraries
playImplementation libraries.fcm playImplementation libraries.fcm
playImplementation libraries.firebaseAnalytics playImplementation libraries.firebaseAnalytics
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
673693445664
673693445664
package chat.rocket.android.analytics package chat.rocket.android.analytics
import chat.rocket.android.analytics.event.AuthenticationEvent class AnswersAnalytics : Analytics
import chat.rocket.android.analytics.event.ScreenViewEvent \ No newline at end of file
import chat.rocket.android.analytics.event.SubscriptionTypeEvent
class AnswersAnalytics : Analytics {
override fun logLogin(event: AuthenticationEvent, loginSucceeded: Boolean) {
// Do absolutely nothing
}
override fun logSignUp(event: AuthenticationEvent, signUpSucceeded: Boolean) {
// Do absolutely nothing
}
override fun logScreenView(event: ScreenViewEvent) {
// Do absolutely nothing
}
override fun logMessageSent(event: SubscriptionTypeEvent, serverUrl: String) {
// Do absolutely nothing
}
override fun logMediaUploaded(event: SubscriptionTypeEvent, mimeType: String) {
// Do absolutely nothing
}
override fun logReaction(event: SubscriptionTypeEvent) {
// Do absolutely nothing
}
override fun logServerSwitch(serverUrl: String, serverCount: Int) {
// Do absolutely nothing
}
}
package chat.rocket.android.analytics package chat.rocket.android.analytics
import android.content.Context import android.content.Context
import chat.rocket.android.analytics.event.AuthenticationEvent
import chat.rocket.android.analytics.event.ScreenViewEvent
import chat.rocket.android.analytics.event.SubscriptionTypeEvent
import javax.inject.Inject import javax.inject.Inject
class GoogleAnalyticsForFirebase @Inject constructor(val context: Context) : class GoogleAnalyticsForFirebase @Inject constructor(val context: Context) : Analytics
Analytics { \ No newline at end of file
override fun logLogin(event: AuthenticationEvent, loginSucceeded: Boolean) {
// Do absolutely nothing
}
override fun logSignUp(event: AuthenticationEvent, signUpSucceeded: Boolean) {
// Do absolutely nothing
}
override fun logScreenView(event: ScreenViewEvent) {
// Do absolutely nothing
}
override fun logMessageSent(event: SubscriptionTypeEvent, serverUrl: String) {
// Do absolutely nothing
}
override fun logMediaUploaded(event: SubscriptionTypeEvent, mimeType: String) {
// Do absolutely nothing
}
override fun logReaction(event: SubscriptionTypeEvent) {
// Do absolutely nothing
}
override fun logServerSwitch(serverUrl: String, serverCount: Int) {
// Do absolutely nothing
}
}
...@@ -9,24 +9,25 @@ ...@@ -9,24 +9,25 @@
<application <application
android:name=".app.RocketChatApplication" android:name=".app.RocketChatApplication"
tools:replace="android:name"
android:allowBackup="true" android:allowBackup="true"
android:fullBackupContent="@xml/backup_config" android:fullBackupContent="@xml/backup_config"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config" android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"> android:supportsRtl="true"
tools:replace="android:name">
<activity <activity
android:name=".authentication.ui.AuthenticationActivity" android:name=".authentication.ui.AuthenticationActivity"
android:configChanges="orientation" android:configChanges="orientation"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/AuthenticationTheme" android:theme="@style/AppTheme"
android:windowSoftInputMode="adjustResize"> android:windowSoftInputMode="adjustResize">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
...@@ -40,6 +41,7 @@ ...@@ -40,6 +41,7 @@
<data <data
android:host="auth" android:host="auth"
android:scheme="rocketchat" /> android:scheme="rocketchat" />
<data <data
android:host="go.rocket.chat" android:host="go.rocket.chat"
android:path="/auth" android:path="/auth"
...@@ -49,7 +51,7 @@ ...@@ -49,7 +51,7 @@
<activity <activity
android:name=".server.ui.ChangeServerActivity" android:name=".server.ui.ChangeServerActivity"
android:theme="@style/AuthenticationTheme" /> android:theme="@style/AppTheme" />
<activity <activity
android:name=".main.ui.MainActivity" android:name=".main.ui.MainActivity"
......
...@@ -12,7 +12,7 @@ interface Analytics { ...@@ -12,7 +12,7 @@ interface Analytics {
* @param event The [AuthenticationEvent] used to log in. * @param event The [AuthenticationEvent] used to log in.
* @param loginSucceeded True if successful logged in, false otherwise. * @param loginSucceeded True if successful logged in, false otherwise.
*/ */
fun logLogin(event: AuthenticationEvent, loginSucceeded: Boolean) fun logLogin(event: AuthenticationEvent, loginSucceeded: Boolean) {}
/** /**
* Logs the sign up event. * Logs the sign up event.
...@@ -20,14 +20,14 @@ interface Analytics { ...@@ -20,14 +20,14 @@ interface Analytics {
* @param event The [AuthenticationEvent] used to sign up. * @param event The [AuthenticationEvent] used to sign up.
* @param signUpSucceeded True if successful signed up, false otherwise. * @param signUpSucceeded True if successful signed up, false otherwise.
*/ */
fun logSignUp(event: AuthenticationEvent, signUpSucceeded: Boolean) fun logSignUp(event: AuthenticationEvent, signUpSucceeded: Boolean) {}
/** /**
* Logs the screen view event. * Logs the screen view event.
* *
* @param event The [ScreenViewEvent] to log. * @param event The [ScreenViewEvent] to log.
*/ */
fun logScreenView(event: ScreenViewEvent) fun logScreenView(event: ScreenViewEvent) {}
/** /**
* Logs the message sent event. * Logs the message sent event.
...@@ -35,7 +35,7 @@ interface Analytics { ...@@ -35,7 +35,7 @@ interface Analytics {
* @param event The [SubscriptionTypeEvent] to log. * @param event The [SubscriptionTypeEvent] to log.
* @param serverUrl The server URL to log. * @param serverUrl The server URL to log.
*/ */
fun logMessageSent(event: SubscriptionTypeEvent, serverUrl: String) fun logMessageSent(event: SubscriptionTypeEvent, serverUrl: String) {}
/** /**
* Logs the media upload event. * Logs the media upload event.
...@@ -43,14 +43,14 @@ interface Analytics { ...@@ -43,14 +43,14 @@ interface Analytics {
* @param event The [SubscriptionTypeEvent] to log. * @param event The [SubscriptionTypeEvent] to log.
* @param mimeType The mime type of the media uploaded to log. * @param mimeType The mime type of the media uploaded to log.
*/ */
fun logMediaUploaded(event: SubscriptionTypeEvent, mimeType: String) fun logMediaUploaded(event: SubscriptionTypeEvent, mimeType: String) {}
/** /**
* Logs the reaction event. * Logs the reaction event.
* *
* @param event The [SubscriptionTypeEvent] to log. * @param event The [SubscriptionTypeEvent] to log.
*/ */
fun logReaction(event: SubscriptionTypeEvent) fun logReaction(event: SubscriptionTypeEvent) {}
/** /**
* Logs the server switch event. * Logs the server switch event.
...@@ -58,5 +58,10 @@ interface Analytics { ...@@ -58,5 +58,10 @@ interface Analytics {
* @param serverUrl The server URL to log. * @param serverUrl The server URL to log.
* @param serverCount The number of server(s) the use own. * @param serverCount The number of server(s) the use own.
*/ */
fun logServerSwitch(serverUrl: String, serverCount: Int) fun logServerSwitch(serverUrl: String, serverCount: Int) {}
/**
* Logs the admin opening.
*/
fun logOpenAdmin() {}
} }
...@@ -64,4 +64,10 @@ class AnalyticsManager @Inject constructor( ...@@ -64,4 +64,10 @@ class AnalyticsManager @Inject constructor(
analytics.forEach { it.logServerSwitch(serverUrl, accounts.size) } analytics.forEach { it.logServerSwitch(serverUrl, accounts.size) }
} }
} }
fun logOpenAdmin() {
if (analyticsTrackingInteractor.get()) {
analytics.forEach { it.logOpenAdmin() }
}
}
} }
...@@ -2,13 +2,22 @@ package chat.rocket.android.analytics.event ...@@ -2,13 +2,22 @@ package chat.rocket.android.analytics.event
sealed class ScreenViewEvent(val screenName: String) { sealed class ScreenViewEvent(val screenName: String) {
// Authentication
object OnBoarding : ScreenViewEvent("OnBoardingFragment")
object Server : ScreenViewEvent("ServerFragment")
object LoginOptions : ScreenViewEvent("LoginOptionsFragment")
object Login : ScreenViewEvent("LoginFragment")
object TwoFa : ScreenViewEvent("TwoFAFragment")
object SignUp : ScreenViewEvent("SignupFragment")
object RegisterUsername : ScreenViewEvent("RegisterUsernameFragment")
object ResetPassword : ScreenViewEvent("ResetPasswordFragment")
object About : ScreenViewEvent("AboutFragment") object About : ScreenViewEvent("AboutFragment")
object ChatRoom : ScreenViewEvent("ChatRoomFragment") object ChatRoom : ScreenViewEvent("ChatRoomFragment")
object ChatRooms : ScreenViewEvent("ChatRoomsFragment") object ChatRooms : ScreenViewEvent("ChatRoomsFragment")
object CreateChannel : ScreenViewEvent("CreateChannelFragment") object CreateChannel : ScreenViewEvent("CreateChannelFragment")
object FavoriteMessages : ScreenViewEvent("FavoriteMessagesFragment") object FavoriteMessages : ScreenViewEvent("FavoriteMessagesFragment")
object Files : ScreenViewEvent("FilesFragment") object Files : ScreenViewEvent("FilesFragment")
object Login : ScreenViewEvent("LoginFragment")
object MemberBottomSheet : ScreenViewEvent("MemberBottomSheetFragment") object MemberBottomSheet : ScreenViewEvent("MemberBottomSheetFragment")
object Members : ScreenViewEvent("MembersFragment") object Members : ScreenViewEvent("MembersFragment")
object Mentions : ScreenViewEvent("MentionsFragment") object Mentions : ScreenViewEvent("MentionsFragment")
...@@ -17,10 +26,5 @@ sealed class ScreenViewEvent(val screenName: String) { ...@@ -17,10 +26,5 @@ sealed class ScreenViewEvent(val screenName: String) {
object PinnedMessages : ScreenViewEvent("PinnedMessagesFragment") object PinnedMessages : ScreenViewEvent("PinnedMessagesFragment")
object Preferences : ScreenViewEvent("PreferencesFragment") object Preferences : ScreenViewEvent("PreferencesFragment")
object Profile : ScreenViewEvent("ProfileFragment") object Profile : ScreenViewEvent("ProfileFragment")
object RegisterUsername : ScreenViewEvent("RegisterUsernameFragment")
object ResetPassword : ScreenViewEvent("ResetPasswordFragment")
object Server : ScreenViewEvent("ServerFragment")
object Settings : ScreenViewEvent("SettingsFragment") object Settings : ScreenViewEvent("SettingsFragment")
object SignUp : ScreenViewEvent("SignupFragment")
object TwoFa : ScreenViewEvent("TwoFAFragment")
} }
package chat.rocket.android.authentication.di package chat.rocket.android.authentication.di
import androidx.lifecycle.LifecycleOwner
import chat.rocket.android.authentication.presentation.AuthenticationNavigator import chat.rocket.android.authentication.presentation.AuthenticationNavigator
import chat.rocket.android.authentication.ui.AuthenticationActivity import chat.rocket.android.authentication.ui.AuthenticationActivity
import chat.rocket.android.dagger.qualifier.ForAuthentication import chat.rocket.android.core.lifecycle.CancelStrategy
import chat.rocket.android.dagger.scope.PerActivity import chat.rocket.android.dagger.scope.PerActivity
import dagger.Module import dagger.Module
import dagger.Provides import dagger.Provides
import kotlinx.coroutines.experimental.Job
@Module @Module
class AuthenticationModule { class AuthenticationModule {
@Provides @Provides
@PerActivity @PerActivity
fun provideAuthenticationNavigator(activity: AuthenticationActivity) = AuthenticationNavigator(activity) fun provideAuthenticationNavigator(activity: AuthenticationActivity) =
AuthenticationNavigator(activity)
@Provides
@PerActivity
fun provideJob() = Job()
@Provides
@PerActivity
fun provideLifecycleOwner(activity: AuthenticationActivity): LifecycleOwner = activity
@Provides
@PerActivity
fun provideCancelStrategy(owner: LifecycleOwner, jobs: Job): CancelStrategy =
CancelStrategy(owner, jobs)
} }
\ No newline at end of file
...@@ -3,34 +3,18 @@ package chat.rocket.android.authentication.login.di ...@@ -3,34 +3,18 @@ package chat.rocket.android.authentication.login.di
import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.LifecycleOwner
import chat.rocket.android.authentication.login.presentation.LoginView import chat.rocket.android.authentication.login.presentation.LoginView
import chat.rocket.android.authentication.login.ui.LoginFragment import chat.rocket.android.authentication.login.ui.LoginFragment
import chat.rocket.android.core.lifecycle.CancelStrategy
import chat.rocket.android.dagger.scope.PerFragment import chat.rocket.android.dagger.scope.PerFragment
import dagger.Module import dagger.Module
import dagger.Provides import dagger.Provides
import kotlinx.coroutines.experimental.Job
@Module @Module
class LoginFragmentModule { class LoginFragmentModule {
@Provides @Provides
@PerFragment @PerFragment
fun provideJob() = Job() fun loginView(frag: LoginFragment): LoginView = frag
@Provides @Provides
@PerFragment @PerFragment
fun loginView(frag: LoginFragment): LoginView { fun provideLifecycleOwner(frag: LoginFragment): LifecycleOwner = frag
return frag
}
@Provides
@PerFragment
fun provideLifecycleOwner(frag: LoginFragment): LifecycleOwner {
return frag
}
@Provides
@PerFragment
fun provideCancelStrategy(owner: LifecycleOwner, jobs: Job): CancelStrategy {
return CancelStrategy(owner, jobs)
}
} }
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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