Skip to content

Commit

Permalink
Merge branch 'release/v0.2.2' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
edipo2s committed Dec 31, 2016
2 parents 9d13b6b + ad96a0f commit 96f4edb
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 14 deletions.
5 changes: 3 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ android {
'LICENSE.txt', 'NOTICE.txt', 'README.txt', '.readme']
defaultConfig {
applicationId "com.ediposouza.teslesgendstracker"
minSdkVersion prepareRelease ? 16 : 21
minSdkVersion prepareToRelease ? 16 : 21
targetSdkVersion 25
versionCode appVersionCode
versionName appVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

buildConfigField("boolean", "ENABLE_LOGS_IN_RELEASE", "false")
buildConfigField("boolean", "PREPARE_TO_RELEASE", "$prepareToRelease")
buildConfigField("String", "MIXPANEL_TOKEN", '"eb99af1dad563cbaaf02f008b28e321f"')
buildConfigField("String", "GCM_SENDER", '"597127048287"')
vectorDrawables.useSupportLibrary true
Expand Down Expand Up @@ -58,7 +59,7 @@ ext {
icePickVersion = "3.2.+"
okIOVersion = "1.10.+"
okHttpVersion = "3.4.+"
playServicesVersion = prepareRelease ? "10.0.1" : "9.8.0"
playServicesVersion = prepareToRelease ? "10.0.1" : "9.8.0"
supportLibraryVersion = "25.1.0"
threetenabpVersion = "1.0.+"

Expand Down
2 changes: 1 addition & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#}

## TES Legends Tracker
-keepclassmembers class com.ediposouza.teslesgendstracker.interactor.FirebaseParsers.*Parser { *; }
-keepclassmembers class com.ediposouza.teslesgendstracker.interactor.FirebaseParsers$* { *; }

## Kotlin
-dontwarn kotlin.**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class App : Application() {
}

private fun initializeDependencies() {
Timber.plant(LoggerManager())
MetricsManager.initialize(this)
AndroidThreeTen.init(this)
FirebaseDatabase.getInstance().apply {
Expand All @@ -47,7 +48,6 @@ class App : Application() {
reference.child(BaseInteractor.NODE_PATCHES).keepSynced(sync)
}
}
Timber.plant(LoggerManager())
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class DecksFragment : BaseFragment(), SearchView.OnQueryTextListener {
val anim = ActivityOptionsCompat.makeCustomAnimation(context, R.anim.slide_up, R.anim.slide_down)
startActivityForResult(context.intentFor<NewDeckActivity>(), RC_NEW_DECK, anim.toBundle())
}
postDelayed({ show() }, DateUtils.SECOND_IN_MILLIS * 2)
postDelayed({ if (this@DecksFragment.isAdded) show() }, DateUtils.SECOND_IN_MILLIS * 2)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class NewDeckCardsListFragment : CardsAllFragment() {

override fun configRecycleView() {
super.configRecycleView()
configLoggedViews()
isFragmentSelected = true
cards_recycler_view.setPadding(0, 0, 0, 0)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ import android.os.Bundle
import com.crashlytics.android.Crashlytics
import com.crashlytics.android.answers.*
import com.ediposouza.teslesgendstracker.BuildConfig
import com.ediposouza.teslesgendstracker.util.MetricAction
import com.ediposouza.teslesgendstracker.util.MetricScreen
import com.ediposouza.teslesgendstracker.util.MetricsConstants
import com.ediposouza.teslesgendstracker.data.Card
import com.google.firebase.analytics.FirebaseAnalytics
import com.google.firebase.auth.FirebaseUser
import com.google.firebase.crash.FirebaseCrash
import com.mixpanel.android.mpmetrics.MixpanelAPI
import io.fabric.sdk.android.Fabric
import timber.log.Timber

/**
* Created by ediposouza on 08/12/16.
Expand All @@ -25,7 +23,12 @@ object MetricsManager : MetricsConstants() {
var mixpanelAnalytics: MixpanelAPI? = null

fun initialize(context: Context) {
Fabric.with(context, Answers(), Crashlytics())
if (BuildConfig.PREPARE_TO_RELEASE) {
Fabric.with(context, Answers(), Crashlytics())
} else {
Fabric.with(context, Answers())
Timber.w("Crashlytics not initialized")
}
answers = Answers.getInstance()
firebaseAnalytics = FirebaseAnalytics.getInstance(context)
mixpanelAnalytics = MixpanelAPI.getInstance(context, BuildConfig.MIXPANEL_TOKEN)
Expand Down Expand Up @@ -82,7 +85,7 @@ object MetricsManager : MetricsConstants() {

private fun identifyUser(user: FirebaseUser?) {
val userId = user?.uid
if (Fabric.isInitialized()) {
if (Fabric.isInitialized() && BuildConfig.PREPARE_TO_RELEASE) {
Crashlytics.setUserIdentifier(userId)
Crashlytics.setUserName(user?.displayName)
Crashlytics.setUserEmail(user?.email)
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

buildscript {
ext {
appVersionName = "0.2.1"
appVersionCode = 3
appVersionName = "0.2.2"
appVersionCode = 4

kotlin_version = "1.0.6"
prepareRelease = false
prepareToRelease = true
}

repositories {
Expand Down

0 comments on commit 96f4edb

Please sign in to comment.