aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-01-07 16:45:41 -0500
committerGitHub <noreply@github.com>2018-01-07 16:45:41 -0500
commitad97b4ff946b4ba3a3f7ac880575eed9de810166 (patch)
tree80d343aa4b9d2db6d768b1de504bb89716059e32 /app/src/main
parentafe7437e0a0f6c315d383e0b6133b13a461c92af (diff)
downloadfrost-ad97b4ff946b4ba3a3f7ac880575eed9de810166.tar.gz
frost-ad97b4ff946b4ba3a3f7ac880575eed9de810166.tar.bz2
frost-ad97b4ff946b4ba3a3f7ac880575eed9de810166.zip
Fix start activity (#607)
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt8
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/IntroActivity.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/views/FrostVideoViewer.kt3
3 files changed, 10 insertions, 3 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt
index f9da7073..c0f4eb85 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt
@@ -1,12 +1,15 @@
package com.pitchedapps.frost
+import android.content.Intent
import android.os.Bundle
import ca.allanwang.kau.internal.KauBaseActivity
+import ca.allanwang.kau.utils.startActivity
import com.pitchedapps.frost.activities.LoginActivity
import com.pitchedapps.frost.activities.MainActivity
import com.pitchedapps.frost.activities.SelectorActivity
import com.pitchedapps.frost.dbflow.loadFbCookiesAsync
import com.pitchedapps.frost.facebook.FbCookie
+import com.pitchedapps.frost.utils.EXTRA_COOKIES
import com.pitchedapps.frost.utils.L
import com.pitchedapps.frost.utils.Prefs
import com.pitchedapps.frost.utils.launchNewTask
@@ -25,7 +28,10 @@ class StartActivity : KauBaseActivity() {
L._d { "Cookies: ${cookies.joinToString("\t")}" }
if (cookies.isNotEmpty()) {
if (Prefs.userId != -1L)
- launchNewTask<MainActivity>(cookies)
+ startActivity<MainActivity>(intentBuilder = {
+ putParcelableArrayListExtra(EXTRA_COOKIES, cookies)
+ flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
+ })
else
launchNewTask<SelectorActivity>(cookies)
} else
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/IntroActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/IntroActivity.kt
index 9babd431..8be9c847 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/activities/IntroActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/IntroActivity.kt
@@ -134,7 +134,7 @@ class IntroActivity : KauBaseActivity(), ViewPager.PageTransformer, ViewPager.On
}
override fun finish() {
- launchNewTask<MainActivity>(cookies())
+ launchNewTask<MainActivity>(cookies(), false)
super.finish()
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostVideoViewer.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostVideoViewer.kt
index 2a7c519e..1dc401a5 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostVideoViewer.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostVideoViewer.kt
@@ -84,7 +84,8 @@ class FrostVideoViewer @JvmOverloads constructor(
fun setVideo(url: String, repeat: Boolean = false) {
val formattedUrl = url.formattedFbUrl
- L.d { "Load video view; repeat: $repeat" }
+ L.d { "Load video; repeat: $repeat" }
+ L._d { "Url\t\t\t$url\nformatted\t$formattedUrl" }
animate().alpha(1f).setDuration(FrostVideoView.ANIMATION_DURATION).start()
video.setVideoURI(Uri.parse(formattedUrl))
video.repeat = repeat