Skip to content

Commit

Permalink
Add some tracking for page type change
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedre committed May 28, 2018
1 parent 47e8b67 commit 76a7d4a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import android.os.Bundle
import android.support.v4.view.ViewPager
import android.support.v7.app.AppCompatActivity
import android.view.LayoutInflater
import com.crashlytics.android.answers.Answers
import com.crashlytics.android.answers.CustomEvent
import com.quran.labs.androidquran.QuranApplication
import com.quran.labs.androidquran.QuranDataActivity
import com.quran.labs.androidquran.R
Expand All @@ -24,6 +26,8 @@ class PageSelectActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
(application as QuranApplication).applicationComponent.inject(this)

Answers.getInstance().logCustom(CustomEvent("pageSelectionActivityVisited"))

setContentView(R.layout.page_select)

val display = windowManager.defaultDisplay
Expand Down Expand Up @@ -69,7 +73,8 @@ class PageSelectActivity : AppCompatActivity() {
val pageType = quranSettings.pageType
if (pageType != type) {
quranSettings.pageType = type

Answers.getInstance().logCustom(
CustomEvent("pageTypeChanged").putCustomAttribute("pageType", type))
val intent = Intent(this, QuranDataActivity::class.java).apply {
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK)
}
Expand Down

0 comments on commit 76a7d4a

Please sign in to comment.