aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt12
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt8
2 files changed, 10 insertions, 10 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt
index 051b3235..61b4a194 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<LoginActivity>()
// Has cookies but no selected account
Prefs.userId == -1L -> launchNewTask<SelectorActivity>(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<MainActivity>(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<MainActivity>(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 46e53887..8cf9dfbf 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<View>
+ private var bottomBehavior: BottomSheetBehavior<View>? = 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) {