aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin
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 /app/src/main/kotlin
parent23d0e789c71ace6a11206a0d6176bd8318185694 (diff)
downloadfrost-300690cbba810d9270100f34d3372356127ecc93.tar.gz
frost-300690cbba810d9270100f34d3372356127ecc93.tar.bz2
frost-300690cbba810d9270100f34d3372356127ecc93.zip
Add slack and finalize crashlytics
Diffstat (limited to 'app/src/main/kotlin')
-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
3 files changed, 13 insertions, 12 deletions
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