From ad97b4ff946b4ba3a3f7ac880575eed9de810166 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 7 Jan 2018 16:45:41 -0500 Subject: Fix start activity (#607) --- app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt | 8 +++++++- .../main/kotlin/com/pitchedapps/frost/activities/IntroActivity.kt | 2 +- .../main/kotlin/com/pitchedapps/frost/views/FrostVideoViewer.kt | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) (limited to 'app/src/main') 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(cookies) + startActivity(intentBuilder = { + putParcelableArrayListExtra(EXTRA_COOKIES, cookies) + flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK + }) else launchNewTask(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(cookies()) + launchNewTask(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 -- cgit v1.2.3