mirror of
https://github.com/AllanWang/Frost-for-Facebook.git
synced 2024-11-09 20:42:34 +01:00
Clean up and add event logging
This commit is contained in:
parent
1b74d78f83
commit
50a7b483b9
@ -121,7 +121,7 @@
|
|||||||
<ConfirmationsSetting value="0" id="Add" />
|
<ConfirmationsSetting value="0" id="Add" />
|
||||||
<ConfirmationsSetting value="0" id="Remove" />
|
<ConfirmationsSetting value="0" id="Remove" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
@ -239,6 +239,8 @@ class MainActivity : BaseActivity() {
|
|||||||
primaryItem(FbTab.GROUPS)
|
primaryItem(FbTab.GROUPS)
|
||||||
primaryItem(FbTab.PAGES)
|
primaryItem(FbTab.PAGES)
|
||||||
primaryItem(FbTab.SAVED)
|
primaryItem(FbTab.SAVED)
|
||||||
|
divider()
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,12 +24,13 @@ class SettingsActivity : KPrefActivity() {
|
|||||||
items(Theme.values().map { this@SettingsActivity.string(it.textRes) })
|
items(Theme.values().map { this@SettingsActivity.string(it.textRes) })
|
||||||
itemsDisabledIndices(Theme.CUSTOM.ordinal)
|
itemsDisabledIndices(Theme.CUSTOM.ordinal)
|
||||||
itemsCallbackSingleChoice(item.pref, {
|
itemsCallbackSingleChoice(item.pref, {
|
||||||
_, _, which, _ ->
|
_, _, which, text ->
|
||||||
if (item.pref != which) {
|
if (item.pref != which) {
|
||||||
item.pref = which
|
item.pref = which
|
||||||
reload()
|
reload()
|
||||||
setFrostTheme(true)
|
setFrostTheme(true)
|
||||||
themeExterior()
|
themeExterior()
|
||||||
|
frostAnswersCustom("Theme") { putCustomAttribute("Count", text.toString()) }
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
})
|
})
|
||||||
|
@ -18,6 +18,7 @@ import com.pitchedapps.frost.facebook.FACEBOOK_COM
|
|||||||
import com.pitchedapps.frost.facebook.FB_URL_BASE
|
import com.pitchedapps.frost.facebook.FB_URL_BASE
|
||||||
import com.pitchedapps.frost.facebook.FbTab
|
import com.pitchedapps.frost.facebook.FbTab
|
||||||
import com.pitchedapps.frost.utils.L
|
import com.pitchedapps.frost.utils.L
|
||||||
|
import com.pitchedapps.frost.utils.frostAnswersCustom
|
||||||
import com.pitchedapps.frost.utils.frostNotification
|
import com.pitchedapps.frost.utils.frostNotification
|
||||||
import org.jetbrains.anko.doAsync
|
import org.jetbrains.anko.doAsync
|
||||||
import org.jsoup.Jsoup
|
import org.jsoup.Jsoup
|
||||||
@ -39,7 +40,7 @@ class NotificationService : JobService() {
|
|||||||
|
|
||||||
override fun onStartJob(params: JobParameters?): Boolean {
|
override fun onStartJob(params: JobParameters?): Boolean {
|
||||||
future = doAsync {
|
future = doAsync {
|
||||||
debugNotification("Load notifs")
|
// debugNotification("Load notifs")
|
||||||
loadFbCookiesSync().forEach {
|
loadFbCookiesSync().forEach {
|
||||||
data ->
|
data ->
|
||||||
L.i("Handle notifications for $data")
|
L.i("Handle notifications for $data")
|
||||||
@ -59,6 +60,7 @@ class NotificationService : JobService() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (notifCount > 0) saveNotificationTime(NotificationModel(data.id, latestEpoch))
|
if (notifCount > 0) saveNotificationTime(NotificationModel(data.id, latestEpoch))
|
||||||
|
frostAnswersCustom("Notifications") { putCustomAttribute("Count", notifCount) }
|
||||||
summaryNotification(data.id, notifCount)
|
summaryNotification(data.id, notifCount)
|
||||||
}
|
}
|
||||||
L.d("Finished notifications")
|
L.d("Finished notifications")
|
||||||
@ -69,7 +71,6 @@ class NotificationService : JobService() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val ARG_ID = "arg_id"
|
|
||||||
val epochMatcher: Regex by lazy { Regex(":([0-9]*),") }
|
val epochMatcher: Regex by lazy { Regex(":([0-9]*),") }
|
||||||
val notifIdMatcher: Regex by lazy { Regex("notif_id\":([0-9]*),") }
|
val notifIdMatcher: Regex by lazy { Regex("notif_id\":([0-9]*),") }
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ import android.widget.TextView
|
|||||||
import ca.allanwang.kau.utils.*
|
import ca.allanwang.kau.utils.*
|
||||||
import com.afollestad.materialdialogs.MaterialDialog
|
import com.afollestad.materialdialogs.MaterialDialog
|
||||||
import com.crashlytics.android.answers.Answers
|
import com.crashlytics.android.answers.Answers
|
||||||
|
import com.crashlytics.android.answers.CustomEvent
|
||||||
import com.pitchedapps.frost.*
|
import com.pitchedapps.frost.*
|
||||||
import com.pitchedapps.frost.dbflow.CookieModel
|
import com.pitchedapps.frost.dbflow.CookieModel
|
||||||
import com.pitchedapps.frost.facebook.FB_URL_BASE
|
import com.pitchedapps.frost.facebook.FB_URL_BASE
|
||||||
@ -142,3 +143,9 @@ fun frostAnswers(action: Answers.() -> Unit) {
|
|||||||
//TODO add opt out toggle
|
//TODO add opt out toggle
|
||||||
Answers.getInstance().action()
|
Answers.getInstance().action()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun frostAnswersCustom(name: String, action: CustomEvent.() -> Unit = {}) {
|
||||||
|
frostAnswers {
|
||||||
|
logCustom(CustomEvent("Frost $name").apply { action() })
|
||||||
|
}
|
||||||
|
}
|
@ -6,7 +6,7 @@
|
|||||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||||
# Specifies the JVM arguments used for the daemon process.
|
# Specifies the JVM arguments used for the daemon process.
|
||||||
# The setting is particularly useful for tweaking memory settings.
|
# The setting is particularly useful for tweaking memory settings.
|
||||||
org.gradle.jvmargs=-Xmx1536m
|
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||||
# When configured, Gradle will run in incubating parallel mode.
|
# When configured, Gradle will run in incubating parallel mode.
|
||||||
# This option should only be used with decoupled projects. More details, visit
|
# This option should only be used with decoupled projects. More details, visit
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||||
@ -20,7 +20,7 @@ VERSION_CODE=2
|
|||||||
VERSION_NAME=0.2
|
VERSION_NAME=0.2
|
||||||
ANDROID_SUPPORT_LIBS=26.0.0-alpha1
|
ANDROID_SUPPORT_LIBS=26.0.0-alpha1
|
||||||
|
|
||||||
KAU=f41eb8b14f
|
KAU=eef0a98de4
|
||||||
MATERIAL_DRAWER=5.9.2
|
MATERIAL_DRAWER=5.9.2
|
||||||
MATERIAL_DRAWER_KT=1.0.2
|
MATERIAL_DRAWER_KT=1.0.2
|
||||||
IICON_GOOGLE=3.0.1.0
|
IICON_GOOGLE=3.0.1.0
|
||||||
|
Loading…
Reference in New Issue
Block a user