diff --git a/modules/app/src/main/res/values-es/strings.xml b/modules/app/src/main/res/values-es/strings.xml index 4de9559a2..1198bcfc6 100644 --- a/modules/app/src/main/res/values-es/strings.xml +++ b/modules/app/src/main/res/values-es/strings.xml @@ -689,6 +689,9 @@ Sobre 9Cards Conoce más sobre el producto y el equipo que esta detrás. + Enviar Feedback + Nos encantaría saber tu opinión sobre 9Cards + 9Cards es un Open Source Android launcher diseñado para Power Android User Visitar 9Cards GitHub diff --git a/modules/app/src/main/res/values/config.xml b/modules/app/src/main/res/values/config.xml index a2e058057..16fd5ea48 100644 --- a/modules/app/src/main/res/values/config.xml +++ b/modules/app/src/main/res/values/config.xml @@ -58,6 +58,10 @@ ${flowup.enabled} ${flowup.apikey} + + ${apptentive.enabled} + ${apptentive.apikey} + default diff --git a/modules/app/src/main/res/values/strings.xml b/modules/app/src/main/res/values/strings.xml index ac95b53ad..864296ddd 100644 --- a/modules/app/src/main/res/values/strings.xml +++ b/modules/app/src/main/res/values/strings.xml @@ -705,6 +705,9 @@ About 9Cards Want to know more about this Open Source project? + Send Feedback + We\'d love to get feedback from you on our app + 9Cards is a free and open source Android launcher designed for and by Android power users Visit 9Cards on GitHub diff --git a/modules/app/src/main/res/xml/preferences_devs_headers.xml b/modules/app/src/main/res/xml/preferences_devs_headers.xml index 7820a4a5b..156e2a749 100644 --- a/modules/app/src/main/res/xml/preferences_devs_headers.xml +++ b/modules/app/src/main/res/xml/preferences_devs_headers.xml @@ -50,6 +50,12 @@ android:key="aboutKey" android:summary="@string/aboutSummary"/> + + + + di.externalServicesProcess.initializeFirebase *> di.externalServicesProcess.initializeStetho *> - di.externalServicesProcess.initializeFlowUp + di.externalServicesProcess.initializeFlowUp *> + di.externalServicesProcess.initializeApptentive def initAllUiActions(): TaskService[Unit] = widgetUiActions.initialize() *> diff --git a/modules/app/src/main/scala/cards/nine/app/ui/preferences/NineCardsPreferencesActivity.scala b/modules/app/src/main/scala/cards/nine/app/ui/preferences/NineCardsPreferencesActivity.scala index 7b9f326dd..8199efd8f 100644 --- a/modules/app/src/main/scala/cards/nine/app/ui/preferences/NineCardsPreferencesActivity.scala +++ b/modules/app/src/main/scala/cards/nine/app/ui/preferences/NineCardsPreferencesActivity.scala @@ -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())) } diff --git a/modules/app/src/main/scala/cards/nine/app/ui/preferences/PreferencesUiActions.scala b/modules/app/src/main/scala/cards/nine/app/ui/preferences/PreferencesUiActions.scala index 0641db3eb..eec179dec 100644 --- a/modules/app/src/main/scala/cards/nine/app/ui/preferences/PreferencesUiActions.scala +++ b/modules/app/src/main/scala/cards/nine/app/ui/preferences/PreferencesUiActions.scala @@ -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} @@ -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() + } diff --git a/modules/app/src/main/scala/cards/nine/app/ui/preferences/commons/NineCardsPreferences.scala b/modules/app/src/main/scala/cards/nine/app/ui/preferences/commons/NineCardsPreferences.scala index 297e9f41c..5420447aa 100644 --- a/modules/app/src/main/scala/cards/nine/app/ui/preferences/commons/NineCardsPreferences.scala +++ b/modules/app/src/main/scala/cards/nine/app/ui/preferences/commons/NineCardsPreferences.scala @@ -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" } diff --git a/modules/app/src/main/scala/cards/nine/process/thirdparty/ExternalServicesProcess.scala b/modules/app/src/main/scala/cards/nine/process/thirdparty/ExternalServicesProcess.scala index 71abd9075..70e17dece 100644 --- a/modules/app/src/main/scala/cards/nine/process/thirdparty/ExternalServicesProcess.scala +++ b/modules/app/src/main/scala/cards/nine/process/thirdparty/ExternalServicesProcess.scala @@ -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 @@ -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 diff --git a/ninecards.properties.default b/ninecards.properties.default index 51ded5fcd..a18aed424 100644 --- a/ninecards.properties.default +++ b/ninecards.properties.default @@ -20,4 +20,8 @@ firebase.clientid= # FlowUp flowup.enabled=false -flowup.apikey= \ No newline at end of file +flowup.apikey= + +# Apptentive +apptentive.enabled= +apptentive.apikey= \ No newline at end of file diff --git a/project/Libraries.scala b/project/Libraries.scala index 5a514b21e..f4812d6e4 100755 --- a/project/Libraries.scala +++ b/project/Libraries.scala @@ -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 { diff --git a/project/ReplacePropertiesGenerator.scala b/project/ReplacePropertiesGenerator.scala index 925eb3786..6a3f3a628 100644 --- a/project/ReplacePropertiesGenerator.scala +++ b/project/ReplacePropertiesGenerator.scala @@ -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") diff --git a/project/Settings.scala b/project/Settings.scala index 6b0380217..655de739f 100644 --- a/project/Settings.scala +++ b/project/Settings.scala @@ -180,6 +180,7 @@ object Settings extends SiteKeys { prettyTime, glide, okHttp, + apptentive, stetho, stethoOkhttp, stethoUrlconnection, diff --git a/project/Versions.scala b/project/Versions.scala index ffd8123ce..b19407568 100755 --- a/project/Versions.scala +++ b/project/Versions.scala @@ -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" }