From 300690cbba810d9270100f34d3372356127ecc93 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 3 Jun 2017 22:50:52 -0700 Subject: Add slack and finalize crashlytics --- .travis.yml | 9 +++++++++ app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt | 11 ++++------- .../main/kotlin/com/pitchedapps/frost/utils/ContextUtils.kt | 7 +++++++ app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt | 7 ++----- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index a79ab0a0..124157b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,15 @@ script: - "./gradlew assembleReleaseTest" notifications: email: false + slack: + rooms: + - pitchedapps:G5OB9U1vsDxy9mxt0Nt6gbFu#frost-for-facebook + on_success: always + on_failure: always + template: + - "Frost Build <%{build_url}|#%{build_number}> (<%{compare_url}|%{commit}>) %{result} in %{duration}" + - "%{commit_subject}" + - "" sudo: false cache: directories: diff --git a/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt index f4ffd2b1..931d6df7 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt @@ -79,7 +79,7 @@ class MainActivity : AppCompatActivity() { Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) .setAction("Action", null).show() } - viewPager.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener{ + viewPager.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener { override fun onGlobalLayout() { viewPager.viewTreeObserver.removeOnGlobalLayoutListener(this) updateTitleListener() @@ -142,16 +142,13 @@ class MainActivity : AppCompatActivity() { R.id.action_settings -> { // startActivity(Intent(this, LoginActivity::class.java)) // finish() + L.e("Settings") + throw IllegalArgumentException("Test") } R.id.action_changelog -> Changelog.show(this) R.id.action_call -> launchNewTask(LoginActivity::class.java) R.id.action_db -> adapter.pages.saveAsync(this) - R.id.action_restart -> { - finish(); - overridePendingTransition(0, 0); //No transitions - startActivity(intent); - overridePendingTransition(0, 0); - } + R.id.action_restart -> restart() else -> return super.onOptionsItemSelected(item) } return true diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/ContextUtils.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/ContextUtils.kt index b87eaa8f..1cc0bf64 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/ContextUtils.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/ContextUtils.kt @@ -38,4 +38,11 @@ fun Context.launchWebOverlay(url: String) { fun WebOverlayActivity.url(): String { return intent.extras?.getString(ARG_URL) ?: FbTab.FEED.url +} + +fun Activity.restart() { + finish() + overridePendingTransition(0, 0) //No transitions + startActivity(intent); + overridePendingTransition(0, 0) } \ No newline at end of file diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt index 63fbaffb..3d5cf1cb 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt @@ -20,10 +20,7 @@ internal class CrashReportingTree : Timber.Tree() { override fun log(priority: Int, tag: String?, message: String?, t: Throwable?) { if (priority == Log.VERBOSE || priority == Log.DEBUG) return - if (message != null) { - Log.println(priority, tag ?: "Frost", message) -// Crashlytics.log(priority, tag ?: "Frost", message) - } -// if (t != null) Crashlytics.logException(t) + if (message != null) Crashlytics.log(priority, tag ?: "Frost", message) + if (t != null) Crashlytics.logException(t) } } \ No newline at end of file -- cgit v1.2.3