aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-06-03 22:50:52 -0700
committerAllan Wang <me@allanwang.ca>2017-06-03 22:50:52 -0700
commit300690cbba810d9270100f34d3372356127ecc93 (patch)
treea2f631ebb110e627fa0ec42bdee64dd9d1cb4657
parent23d0e789c71ace6a11206a0d6176bd8318185694 (diff)
downloadfrost-300690cbba810d9270100f34d3372356127ecc93.tar.gz
frost-300690cbba810d9270100f34d3372356127ecc93.tar.bz2
frost-300690cbba810d9270100f34d3372356127ecc93.zip
Add slack and finalize crashlytics
-rw-r--r--.travis.yml9
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt11
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/ContextUtils.kt7
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt7
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}"
+ - "<https://github.com/AllanWang/Frost-for-Facebook-APK-Builder/releases/tag/v%{build_number}|APK Download>"
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