Skip to content

Commit

Permalink
Merge pull request #53 from MakinGiants/release/1.5.3
Browse files Browse the repository at this point in the history
Release 1.5.3
  • Loading branch information
danielgomezrico committed Apr 26, 2018
2 parents 1e36f86 + 755566f commit 9eeee65
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 34 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ app/newrelic.properties
app/google-services.json
captures/

gradle.properties

nimbledroid.properties

# Created by https://www.gitignore.io
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 1.5.2 # 1.5.3
- Sdk to 27
- Update dependencies:
+ Firebase
+ Ads
+ Kotlin
+ Support Library

# 1.5.1
- Update kotlin 1.1.51
Expand Down
17 changes: 9 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'io.fabric'
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'spoon'
apply from: '../jacoco.gradle'

def appId = "com.makingiants.android.banjotuner"
def appVersionName = "1.5.2"
def appVersionCode = 111
def appVersionName = "1.5.3"
def appVersionCode = 112

android {
compileSdkVersion setup.targetSdk
Expand Down Expand Up @@ -60,7 +59,7 @@ android {
}
}
}

}

def excludeAnnotations = {
Expand All @@ -69,11 +68,12 @@ def excludeAnnotations = {

dependencies {
compile "com.android.support:appcompat-v7:${deps.supportLib}"
compile "com.google.android.gms:play-services-ads:${deps.playServices}"

compile "org.jetbrains.kotlin:kotlin-stdlib:$deps.kotlin"

compile('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') { transitive = true }
// Ads/Crash
compile 'com.crashlytics.sdk.android:crashlytics:2.9.1'
compile "com.google.firebase:firebase-core:${deps.firebase}"
compile "com.google.firebase:firebase-ads:${deps.firebase}"

testCompile 'junit:junit:4.12'
testCompile "org.jetbrains.kotlin:kotlin-stdlib:$deps.kotlin"
Expand All @@ -99,4 +99,5 @@ spoon {
grantAllPermissions = true
}

apply plugin: 'com.google.gms.google-services' // Firebase

apply plugin: 'com.google.gms.google-services'
3 changes: 0 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />

<activity
android:name="com.google.android.gms.ads.AdActivity"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.makingiants.android.banjotuner

import android.content.Context
import android.os.Bundle
import android.support.annotation.VisibleForTesting
import android.support.v4.view.ViewCompat
Expand All @@ -9,10 +10,12 @@ import android.view.View
import android.view.animation.Animation
import android.view.animation.AnimationUtils
import android.widget.Button
import android.widget.RadioGroup
import android.widget.ToggleButton
import com.crashlytics.android.Crashlytics
import com.google.android.gms.ads.AdRequest
import com.google.android.gms.ads.AdView
import com.google.android.gms.ads.MobileAds
import com.google.firebase.analytics.FirebaseAnalytics
import io.fabric.sdk.android.Fabric
import java.io.IOException
Expand All @@ -38,11 +41,18 @@ class EarActivity : AppCompatActivity(), View.OnClickListener {
AnimationUtils.loadAnimation(this, R.anim.shake_animation)
}

private val adsRunnable by lazy { SetupAdsRunnable(adsView, this) }

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Fabric.with(this, Crashlytics())

Fabric.with(Fabric.Builder(this)
.kits(Crashlytics())
.debuggable(true) // Enables Crashlytics debugger
.build())

firebaseAnalytics.logEvent("screenview", Bundle().apply { putString("name", "ear") })

setContentView(R.layout.activity_ear_ads)

soundsRadioGroup.setOnCheckedChangeListener { radioGroup, i ->
Expand Down Expand Up @@ -98,18 +108,27 @@ class EarActivity : AppCompatActivity(), View.OnClickListener {
}
}

class AdSetupRunnable(adsView: AdView) : Runnable {
val weakAdsView = WeakReference(adsView)

/**
* Setup the ads in a runnable helping to not lose frames when the view is been created
* ([onCreate]), ads process takes time to finish.
*/
class SetupAdsRunnable(adsView: AdView, context: Context) : Runnable {
private val weakAdsView = WeakReference(adsView)
private val weakContext = WeakReference(context)

override fun run() {
val adRequest: AdRequest
if (BuildConfig.DEBUG) {
adRequest = AdRequest.Builder()
weakContext.get()?.let {
MobileAds.initialize(it, it.resources.getString(R.string.ads_unit_id_banner))
}

val adRequest = if (BuildConfig.DEBUG) {
AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.addTestDevice("027c6ee5571a8376")
.build()
} else {
adRequest = AdRequest.Builder().build()
AdRequest.Builder().build()
}

weakAdsView.get()?.loadAd(adRequest)
Expand Down
12 changes: 7 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
buildscript {

apply from: "dependencies.gradle"

repositories {
Expand All @@ -8,13 +7,16 @@ buildscript {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3' //2.2.3 and 2.3.0+ breaks jacoco support
classpath 'com.android.tools.build:gradle:2.1.3' // because 2.2.3 and 2.3.0+ breaks jacoco support
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$deps.kotlin"

classpath 'io.fabric.tools:gradle:1.24.2'
classpath "com.google.gms:google-services:$deps.googleGsm" // Firebase
// Firebase
classpath 'com.google.gms:google-services:3.2.1'
classpath 'io.fabric.tools:gradle:1.25.1'

// Extras
classpath 'com.stanfy.spoon:spoon-gradle-plugin:1.2.2'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.15.0'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0'
}
}

Expand Down
15 changes: 8 additions & 7 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
ext {
deps = [kotlin : "1.2.21",
supportLib : "27.0.2",
googleGsm : "3.1.0",
playServices: "11.8.0",
jacoco : "0.7.9"]

setup = [targetSdk : 26,
deps = [kotlin : "1.2.40",
supportLib: "27.1.1",
firebase : "12.0.1",
jacoco : "0.7.9"]

setup = [targetSdk : 27,
minSdk : 14,
buildTools: "26.0.1"]
buildTools: "27.0.3"]

}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Mon May 29 10:29:50 COT 2017
#Wed Apr 25 11:50:48 BRT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
4 changes: 2 additions & 2 deletions scripts/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ DEPS_FILE="$ANDROID_HOME/android-dependencies-installed"

if [ ! -e $DEPS_FILE ]; then

for I in android-26 \
build-tools-26.0.1 \
for I in android-27 \
build-tools-27.0.3 \
tool \
extra-android-m2repository \
extra-android-support \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DEPS_FILE="$ANDROID_HOME/android-dependencies-installed"
if [ ! -e $DEPS_FILE ]; then

for I in android-26 \
build-tools-25.0.3 \
build-tools-26.0.1 \
tool \
extra-android-m2repository \
extra-android-support \
Expand Down

0 comments on commit 9eeee65

Please sign in to comment.