Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
c1389ae9
Commit
c1389ae9
authored
Oct 09, 2018
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds analytics when opening the admin panel.
parent
5a472099
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
0 deletions
+21
-0
Analytics.kt
app/src/main/java/chat/rocket/android/analytics/Analytics.kt
+5
-0
AnalyticsManager.kt
...in/java/chat/rocket/android/analytics/AnalyticsManager.kt
+6
-0
AdminPanelWebViewFragment.kt
...ndroid/webview/adminpanel/ui/AdminPanelWebViewFragment.kt
+6
-0
AnswersAnalytics.kt
...ay/java/chat/rocket/android/analytics/AnswersAnalytics.kt
+2
-0
GoogleAnalyticsForFirebase.kt
...at/rocket/android/analytics/GoogleAnalyticsForFirebase.kt
+2
-0
No files found.
app/src/main/java/chat/rocket/android/analytics/Analytics.kt
View file @
c1389ae9
...
...
@@ -59,4 +59,9 @@ interface Analytics {
* @param serverCount The number of server(s) the use own.
*/
fun
logServerSwitch
(
serverUrl
:
String
,
serverCount
:
Int
)
/**
* Logs the admin opening.
*/
fun
logOpenAdmin
()
}
app/src/main/java/chat/rocket/android/analytics/AnalyticsManager.kt
View file @
c1389ae9
...
...
@@ -64,4 +64,10 @@ class AnalyticsManager @Inject constructor(
analytics
.
forEach
{
it
.
logServerSwitch
(
serverUrl
,
accounts
.
size
)
}
}
}
fun
logOpenAdmin
()
{
if
(
analyticsTrackingInteractor
.
get
())
{
analytics
.
forEach
{
it
.
logOpenAdmin
()
}
}
}
}
app/src/main/java/chat/rocket/android/webview/adminpanel/ui/AdminPanelWebViewFragment.kt
View file @
c1389ae9
...
...
@@ -10,9 +10,11 @@ import android.webkit.WebViewClient
import
androidx.appcompat.app.AppCompatActivity
import
androidx.fragment.app.Fragment
import
chat.rocket.android.R
import
chat.rocket.android.analytics.AnalyticsManager
import
chat.rocket.android.util.extensions.inflate
import
chat.rocket.android.util.extensions.ui
import
kotlinx.android.synthetic.main.fragment_admin_panel_web_view.*
import
javax.inject.Inject
private
const
val
BUNDLE_WEB_PAGE_URL
=
"web_page_url"
private
const
val
BUNDLE_USER_TOKEN
=
"user_token"
...
...
@@ -20,6 +22,8 @@ private const val BUNDLE_USER_TOKEN = "user_token"
class
AdminPanelWebViewFragment
:
Fragment
()
{
private
lateinit
var
webPageUrl
:
String
private
lateinit
var
userToken
:
String
@Inject
lateinit
var
analyticsManager
:
AnalyticsManager
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
...
...
@@ -42,6 +46,8 @@ class AdminPanelWebViewFragment : Fragment() {
super
.
onViewCreated
(
view
,
savedInstanceState
)
setupToolbar
()
setupWebView
()
analyticsManager
.
logOpenAdmin
()
}
private
fun
setupToolbar
()
{
...
...
app/src/play/java/chat/rocket/android/analytics/AnswersAnalytics.kt
View file @
c1389ae9
...
...
@@ -65,4 +65,6 @@ class AnswersAnalytics : Analytics {
.
putCustomAttribute
(
"server_url"
,
serverUrl
)
.
putCustomAttribute
(
"server_count"
,
serverCount
)
)
override
fun
logOpenAdmin
()
=
Answers
.
getInstance
().
logCustom
(
CustomEvent
(
"open_admin"
))
}
app/src/play/java/chat/rocket/android/analytics/GoogleAnalyticsForFirebase.kt
View file @
c1389ae9
...
...
@@ -58,4 +58,6 @@ class GoogleAnalyticsForFirebase @Inject constructor(val context: Context) :
putInt
(
"server_count"
,
serverCount
)
})
}
override
fun
logOpenAdmin
()
=
firebaseAnalytics
.
logEvent
(
"open_admin"
,
null
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment