diff --git a/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt index 051b32353..61b4a194d 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt @@ -46,7 +46,6 @@ import com.pitchedapps.frost.utils.BiometricUtils import com.pitchedapps.frost.utils.EXTRA_COOKIES import com.pitchedapps.frost.utils.L import com.pitchedapps.frost.utils.Prefs -import com.pitchedapps.frost.utils.launchImageActivity import com.pitchedapps.frost.utils.launchNewTask import com.pitchedapps.frost.utils.loadAssets import com.raizlabs.android.dbflow.kotlinextensions.from @@ -99,12 +98,11 @@ class StartActivity : KauBaseActivity() { cookies.isEmpty() -> launchNewTask() // Has cookies but no selected account Prefs.userId == -1L -> launchNewTask(cookies) - else -> launchImageActivity("https://images.pexels.com/photos/374870/pexels-photo-374870.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500", "Hello world\nLong Text\nLSEF") -// else -> startActivity(intentBuilder = { -// putParcelableArrayListExtra(EXTRA_COOKIES, cookies) -// flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP or -// Intent.FLAG_ACTIVITY_SINGLE_TOP -// }) + else -> startActivity(intentBuilder = { + putParcelableArrayListExtra(EXTRA_COOKIES, cookies) + flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP or + Intent.FLAG_ACTIVITY_SINGLE_TOP + }) } } catch (e: Exception) { L._e(e) { "Load start failed" } diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt index 46e53887a..8cf9dfbf1 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt @@ -144,7 +144,7 @@ class ImageActivity : KauBaseActivity() { } private lateinit var binding: ActivityImageBinding - private lateinit var bottomBehavior: BottomSheetBehavior + private var bottomBehavior: BottomSheetBehavior? = null private val baseBackgroundColor = if (Prefs.blackMediaBg) Color.BLACK else Prefs.bgColor.withMinAlpha(235) @@ -260,8 +260,10 @@ class ImageActivity : KauBaseActivity() { val multiplier = max(1f - scrollPercent, 0f) imageFab.alpha = multiplier - imageText.alpha = - multiplier * (if (bottomBehavior.state == BottomSheetBehavior.STATE_COLLAPSED) 0.5f else 1f) + bottomBehavior?.also { + imageText.alpha = + multiplier * (if (it.state == BottomSheetBehavior.STATE_COLLAPSED) 0.5f else 1f) + } imageContainer.setBackgroundColor(baseBackgroundColor.adjustAlpha(multiplier)) if (scrollPercent >= 1) {