aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin
diff options
context:
space:
mode:
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