1
0
mirror of https://github.com/AllanWang/Frost-for-Facebook.git synced 2024-11-08 20:12:39 +01:00

Fix support for textless

This commit is contained in:
Allan Wang 2019-07-03 14:07:09 -07:00
parent c5008fb253
commit 0931219b05
No known key found for this signature in database
GPG Key ID: C93E3F9C679D7A56
2 changed files with 10 additions and 10 deletions

View File

@ -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" }

View File

@ -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) {