This repository has been archived by the owner on May 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1201 from 47deg/javi-1139-disable-analytics
Added Google Analytics preference
- Loading branch information
Showing
20 changed files
with
119 additions
and
5 deletions.
There are no files selected for viewing
Binary file added
BIN
+928 Bytes
modules/app/src/main/res/drawable-hdpi/icon_preferences_analytics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+345 Bytes
modules/app/src/main/res/drawable-hdpi/icon_preferences_feedback.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+650 Bytes
modules/app/src/main/res/drawable-mdpi/icon_preferences_analytics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+228 Bytes
modules/app/src/main/res/drawable-mdpi/icon_preferences_feedback.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.1 KB
modules/app/src/main/res/drawable-xhdpi/icon_preferences_analytics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+316 Bytes
modules/app/src/main/res/drawable-xhdpi/icon_preferences_feedback.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.48 KB
modules/app/src/main/res/drawable-xxhdpi/icon_preferences_analytics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+427 Bytes
modules/app/src/main/res/drawable-xxhdpi/icon_preferences_feedback.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.85 KB
modules/app/src/main/res/drawable-xxxhdpi/icon_preferences_analytics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+544 Bytes
modules/app/src/main/res/drawable-xxxhdpi/icon_preferences_feedback.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<PreferenceCategory android:title="@string/analyticsPrefTitle"> | ||
|
||
<CheckBoxPreference | ||
android:key="analyticsEnabled" | ||
android:defaultValue="true" | ||
android:title="@string/analyticsEnabledPrefTitle"/> | ||
|
||
<Preference | ||
android:summary="@string/analyticsEnabledPrefSummary"/> | ||
|
||
</PreferenceCategory> | ||
|
||
</PreferenceScreen> |
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
17 changes: 17 additions & 0 deletions
17
modules/app/src/main/scala/cards/nine/app/ui/preferences/analytics/AnalyticsFragment.scala
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,17 @@ | ||
package cards.nine.app.ui.preferences.analytics | ||
|
||
import android.os.Bundle | ||
import cards.nine.app.ui.preferences.commons.PreferenceChangeListenerFragment | ||
import com.fortysevendeg.ninecardslauncher.R | ||
|
||
class AnalyticsFragment extends PreferenceChangeListenerFragment { | ||
|
||
override def onCreate(savedInstanceState: Bundle): Unit = { | ||
super.onCreate(savedInstanceState) | ||
withActivity { activity => | ||
Option(activity.getActionBar) foreach (_.setTitle(getString(R.string.analyticsPrefTitle))) | ||
} | ||
addPreferencesFromResource(R.xml.preferences_analytics) | ||
} | ||
|
||
} |
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
25 changes: 25 additions & 0 deletions
25
modules/services/src/main/scala/cards/nine/services/track/impl/DisableTrackServices.scala
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,25 @@ | ||
package cards.nine.services.track.impl | ||
|
||
import cards.nine.commons.services.TaskService | ||
import cards.nine.commons.services.TaskService._ | ||
import cards.nine.models.TrackEvent | ||
import cards.nine.models.types.MomentCategory | ||
import cards.nine.services.track.TrackServices | ||
import monix.eval.Task | ||
|
||
class DisableTrackServices extends TrackServices { | ||
|
||
override def trackEvent(event: TrackEvent): TaskService[Unit] = TaskService { | ||
val categoryName = event.category match { | ||
case MomentCategory(moment) => s"WIDGET_${moment.name}" | ||
case _ => event.category.name | ||
} | ||
|
||
Task(Right(println(s"""Event no tracked | ||
| Action ${event.action.name} | ||
| Category $categoryName | ||
| Label ${event.label.getOrElse("")} | ||
| Screen ${event.screen.name} | ||
| Value ${event.value.map(_.value).getOrElse(0)}""".stripMargin))) | ||
} | ||
} |