Skip to content
This repository has been archived by the owner on May 8, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1195 from 47deg/javi-1159-apptentive
Browse files Browse the repository at this point in the history
Apptentive
  • Loading branch information
Javi Pacheco authored Dec 22, 2016
2 parents 8419b4b + 3a2614e commit f3ff984
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 4 deletions.
3 changes: 3 additions & 0 deletions modules/app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,9 @@
<string name="aboutTitle">Sobre 9Cards</string>
<string name="aboutSummary">Conoce más sobre el producto y el equipo que esta detrás.</string>

<string name="sendFeedbackTitle">Enviar Feedback</string> <!-- Pending review language -->
<string name="sendFeedbackSummary">Nos encantaría saber tu opinión sobre 9Cards</string> <!-- Pending review language -->

<string name="about_header_open_source">9Cards es un Open Source Android launcher diseñado para Power Android User</string>

<string name="about_github">Visitar 9Cards GitHub</string> <!-- Pending review language -->
Expand Down
4 changes: 4 additions & 0 deletions modules/app/src/main/res/values/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
<string name="flowup_enabled" translatable="false">${flowup.enabled}</string>
<string name="flowup_apikey" translatable="false">${flowup.apikey}</string>

<!-- Apptentive -->
<string name="apptentive_enabled" translatable="false">${apptentive.enabled}</string>
<string name="apptentive_apikey" translatable="false">${apptentive.apikey}</string>

<!-- Dimen -->
<string name="dimen_name" translatable="false">default</string>

Expand Down
3 changes: 3 additions & 0 deletions modules/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,9 @@
<string name="aboutTitle">About 9Cards</string>
<string name="aboutSummary">Want to know more about this Open Source project?</string>

<string name="sendFeedbackTitle">Send Feedback</string> <!-- Pending review language -->
<string name="sendFeedbackSummary">We\'d love to get feedback from you on our app</string> <!-- Pending review language -->

<string name="about_header_open_source">9Cards is a free and open source Android launcher designed for and by Android power users</string>

<string name="about_github">Visit 9Cards on GitHub</string>
Expand Down
6 changes: 6 additions & 0 deletions modules/app/src/main/res/xml/preferences_devs_headers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@
android:key="aboutKey"
android:summary="@string/aboutSummary"/>

<PreferenceScreen
android:icon="@drawable/icon_preferences_help"
android:title="@string/sendFeedbackTitle"
android:key="feedbackKey"
android:summary="@string/sendFeedbackSummary"/>

<PreferenceScreen
android:icon="@drawable/icon_preferences_help"
android:title="@string/helpTitle"
Expand Down
6 changes: 6 additions & 0 deletions modules/app/src/main/res/xml/preferences_headers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
android:key="aboutKey"
android:summary="@string/aboutSummary"/>

<PreferenceScreen
android:icon="@drawable/icon_preferences_help"
android:title="@string/sendFeedbackTitle"
android:key="feedbackKey"
android:summary="@string/sendFeedbackSummary"/>

<PreferenceScreen
android:icon="@drawable/icon_preferences_help"
android:title="@string/helpTitle"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ class LauncherJobs(
di.externalServicesProcess.initializeCrashlytics *>
di.externalServicesProcess.initializeFirebase *>
di.externalServicesProcess.initializeStetho *>
di.externalServicesProcess.initializeFlowUp
di.externalServicesProcess.initializeFlowUp *>
di.externalServicesProcess.initializeApptentive

def initAllUiActions(): TaskService[Unit] =
widgetUiActions.initialize() *>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ class NineCardsPreferencesActivity
findPreference(AboutPreferences.name)
.setOnPreferenceClickListener(preferenceClick(AboutPreferences.name, new AboutFragment()))

findPreference(FeedbackPreferences.name).setOnPreferenceClickListener(
preferenceActionClick(() => ui.goToFeedback().resolveAsync()))

findPreference(HelpPreferences.name).setOnPreferenceClickListener(preferenceActionClick(() =>
ui.goToHelp().resolveAsync()))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import cards.nine.app.ui.commons.ops.UiOps._
import cards.nine.commons.services.TaskService._
import macroid.extras.ResourcesExtras._
import cards.nine.app.ui.commons.SafeUi._
import com.apptentive.android.sdk.Apptentive
import com.fortysevendeg.ninecardslauncher.R
import macroid.{ActivityContextWrapper, Ui}

Expand Down Expand Up @@ -36,4 +37,7 @@ class PreferencesUiActions(dom: PreferencesDOM)(implicit contextWrapper: Activit
def goToHelp(): TaskService[Unit] =
uiOpenUrlIntent(resGetString(R.string.ninecards_help)).toService()

def goToFeedback(): TaskService[Unit] =
Ui(Apptentive.showMessageCenter(contextWrapper.bestAvailable)).toService()

}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ case object WizardInlinePreferences extends NineCardsPreferences {
override val name: String = "wizardInlineKey"
}

case object FeedbackPreferences extends NineCardsPreferences {
override val name: String = "feedbackKey"
}

case object AboutPreferences extends NineCardsPreferences {
override val name: String = "aboutKey"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import cards.nine.commons.CatchAll
import cards.nine.commons.contexts.ContextSupport
import cards.nine.commons.services.TaskService
import cards.nine.commons.services.TaskService._
import com.apptentive.android.sdk.Apptentive
import com.crashlytics.android.Crashlytics
import com.crashlytics.android.core.CrashlyticsCore
import com.facebook.stetho.Stetho
Expand Down Expand Up @@ -94,6 +95,14 @@ class ExternalServicesProcess
}
}.toService()

def initializeApptentive(implicit contextSupport: ContextSupport): TaskService[Unit] =
Ui {
if (readFlag(R.string.apptentive_enabled)) {
AppLog.info("Initializing Apptentive")
Apptentive.register(contextSupport.application, getString(R.string.apptentive_apikey))
}
}.toService()

def readFirebaseToken: TaskService[String] = TaskService {
CatchAll[TokenFirebaseException] {
FirebaseInstanceId.getInstance().getToken
Expand Down
6 changes: 5 additions & 1 deletion ninecards.properties.default
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ firebase.clientid=

# FlowUp
flowup.enabled=false
flowup.apikey=
flowup.apikey=

# Apptentive
apptentive.enabled=
apptentive.apikey=
1 change: 1 addition & 0 deletions project/Libraries.scala
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ object Libraries {
lazy val stethoOkhttp = "com.facebook.stetho" % "stetho-okhttp3" % stethoV
lazy val stethoUrlconnection = "com.facebook.stetho" % "stetho-urlconnection" % stethoV
lazy val crashlytics = "com.crashlytics.sdk.android" % "crashlytics" % crashlyticsV
lazy val apptentive = "com.apptentive" % "apptentive-android" % apptentiveV
}

object performance {
Expand Down
4 changes: 3 additions & 1 deletion project/ReplacePropertiesGenerator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ object ReplacePropertiesGenerator {
"firebase.gcm.senderid" -> "",
"firebase.clientid" -> "",
"flowup.enabled" -> "false",
"flowup.apikey" -> "")
"flowup.apikey" -> "",
"apptentive.enabled" -> "false",
"apptentive.apikey" -> "")

lazy val propertiesFileName = sys.env.getOrElse("9CARDS_PROPERTIES", "ninecards.properties")

Expand Down
1 change: 1 addition & 0 deletions project/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ object Settings extends SiteKeys {
prettyTime,
glide,
okHttp,
apptentive,
stetho,
stethoOkhttp,
stethoUrlconnection,
Expand Down
3 changes: 2 additions & 1 deletion project/Versions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ object Versions {
val mockServerV = "3.9.2"
val stethoV = "1.3.1"
val crashlyticsV = "2.5.2"
val apptentiveV = "3.3.0"
val jodaTimeV = "2.9.2"
val gfcTimeUUIDV = "0.0.6"
val monixV = "2.1.1"
val catsV = "0.8.1"
val flowUpV= "0.2.4"
val flowUpV= "0.2.5"
}

0 comments on commit f3ff984

Please sign in to comment.