-
-
Notifications
You must be signed in to change notification settings - Fork 598
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'pageToolbarT302397_design' into more_var_A_design
* pageToolbarT302397_design: (39 commits) Fix updating of reading lists after renaming. (#3251) Update kotlin-gradle-plugin version to 1.6.20 (#3250) Fix: update talk page pageTitle after changing the language (#3241) Refactor title functions (#3232) Disable flaky test of EventPlatformClient. (#3249) Prevent possible crash when highlighting text for editing. (#3248) Bump version code (#3247) Article clicks and Edit history analytics wiring (#3234) Change affects to affect (incorrect plural) (#3242) Fix improper scrolling/jumping when composing long Talk message. (#3245) Fix behavior of article overflow menu in split-screen mode. (#3244) Improve OOP logic for analytics events containing state information. (#3240) Localisation updates from https://translatewiki.net. Convert EventPlatformClient to kotlin. (#3239) Localisation updates from https://translatewiki.net. Get the updated value of duration in timed events. (#3237) Add DAO method to get multiple reading lists. (#3224) Fix deserialization of pageId. (#3236) Further optimize API calls to Commons and Wikidata. (#3227) Create constant WikiSite for Commons and Wikidata. (#3230) ... # Conflicts: # app/src/main/res/values-fr/strings.xml # app/src/main/res/values-ja/strings.xml # app/src/main/res/values-qq/strings.xml
- Loading branch information
Showing
141 changed files
with
2,645 additions
and
1,070 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
app/src/main/java/org/wikipedia/analytics/eventplatform/ArticleInteractionEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
package org.wikipedia.analytics.eventplatform | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
import org.wikipedia.auth.AccountUtil | ||
|
||
class ArticleInteractionEvent(private var wikiDb: String, private var pageId: Int) : TimedEvent() { | ||
|
||
fun logLoaded() { | ||
submitEvent("load") | ||
} | ||
|
||
fun logSaveClick() { | ||
submitEvent("save") | ||
} | ||
|
||
fun logLanguageClick() { | ||
submitEvent("language") | ||
} | ||
|
||
fun logFindInArticleClick() { | ||
submitEvent("find_in_article") | ||
} | ||
|
||
fun logThemeClick() { | ||
submitEvent("theme") | ||
} | ||
|
||
fun logContentsClick() { | ||
submitEvent("contents") | ||
} | ||
|
||
fun logMoreClick() { | ||
submitEvent("more") | ||
} | ||
|
||
fun logShareClick() { | ||
submitEvent("share") | ||
} | ||
|
||
fun logTalkPageClick() { | ||
submitEvent("talk_page") | ||
} | ||
|
||
fun logEditHistoryClick() { | ||
submitEvent("edit_history") | ||
} | ||
|
||
fun logNewTabClick() { | ||
submitEvent("new_tab") | ||
} | ||
|
||
fun logExploreClick() { | ||
submitEvent("explore") | ||
} | ||
|
||
fun logForwardClick() { | ||
submitEvent("forward") | ||
} | ||
|
||
fun logNotificationClick() { | ||
submitEvent("notification") | ||
} | ||
|
||
fun logTabsClick() { | ||
submitEvent("tabs") | ||
} | ||
|
||
fun logSearchWikipediaClick() { | ||
submitEvent("search_wikipedia") | ||
} | ||
|
||
fun logBackClick() { | ||
submitEvent("back") | ||
} | ||
|
||
fun logEditHistoryArticleClick() { | ||
submitEvent("edit_history_from_article") | ||
} | ||
|
||
fun logTalkPageArticleClick() { | ||
submitEvent("talk_page_from_article") | ||
} | ||
|
||
fun logTocSwipe() { | ||
submitEvent("toc_swipe") | ||
} | ||
|
||
fun logCategoriesClick() { | ||
submitEvent("categories") | ||
} | ||
|
||
private fun submitEvent(action: String) { | ||
EventPlatformClient.submit(ArticleInteractionEventImpl(!AccountUtil.isLoggedIn, duration, wikiDb, pageId, action)) | ||
} | ||
|
||
@Suppress("unused") | ||
@Serializable | ||
@SerialName("/analytics/mobile_apps/android_article_toolbar_interaction/1.0.0") | ||
class ArticleInteractionEventImpl(@SerialName("is_anon") private val isAnon: Boolean, | ||
@SerialName("time_spent_ms") private var timeSpentMs: Int, | ||
@SerialName("wiki_db") private var wikiDb: String, | ||
@SerialName("page_id") private var pageId: Int, | ||
private val action: String) : | ||
MobileAppsEvent("android.article_toolbar_interaction") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
app/src/main/java/org/wikipedia/analytics/eventplatform/EditHistoryInteractionEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package org.wikipedia.analytics.eventplatform | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
import org.wikipedia.auth.AccountUtil | ||
|
||
class EditHistoryInteractionEvent(private var wikiDb: String, private var pageId: Int) : | ||
TimedEvent() { | ||
|
||
fun logShowHistory() { | ||
submitEvent("show_history") | ||
} | ||
|
||
fun logRevision() { | ||
submitEvent("revision_view") | ||
} | ||
|
||
fun logCompare1() { | ||
submitEvent("compare1") | ||
} | ||
|
||
fun logCompare2() { | ||
submitEvent("compare2") | ||
} | ||
|
||
fun logThankTry() { | ||
submitEvent("thank_try") | ||
} | ||
|
||
fun logThankSuccess() { | ||
submitEvent("thank_success") | ||
} | ||
|
||
fun logThankFail() { | ||
submitEvent("thank_fail") | ||
} | ||
|
||
private fun submitEvent(action: String) { | ||
EventPlatformClient.submit(EditHistoryInteractionEventImpl(!AccountUtil.isLoggedIn, duration, wikiDb, pageId, action)) | ||
} | ||
|
||
@Suppress("unused") | ||
@Serializable | ||
@SerialName("/analytics/mobile_apps/android_edit_history_interaction/1.0.0") | ||
class EditHistoryInteractionEventImpl(@SerialName("is_anon") private val isAnon: Boolean, | ||
@SerialName("time_spent_ms") private var timeSpentMs: Int, | ||
@SerialName("wiki_db") private var wikiDb: String, | ||
@SerialName("page_id") private var pageId: Int, | ||
private val action: String) : | ||
MobileAppsEvent("android.edit_history_interaction") | ||
} |
Oops, something went wrong.