diff options
author | Allan Wang <me@allanwang.ca> | 2019-09-22 22:47:07 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2019-09-22 22:47:07 -0700 |
commit | 142b95f0ae82a849b1e9ef390a2a068b4c792be6 (patch) | |
tree | 10e7cfbca87fdc3ad904d5b0f38e493d088496e1 /app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt | |
parent | 981d6ffb409a501e6efcf4fe0cbe719e192beee7 (diff) | |
download | frost-142b95f0ae82a849b1e9ef390a2a068b4c792be6.tar.gz frost-142b95f0ae82a849b1e9ef390a2a068b4c792be6.tar.bz2 frost-142b95f0ae82a849b1e9ef390a2a068b4c792be6.zip |
Optimize imports and update changelog
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt index c2f28a4b..d725acd9 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt @@ -242,11 +242,11 @@ fun View.frostSnackbar(@StringRes text: Int, builder: Snackbar.() -> Unit = {}) @SuppressLint("RestrictedApi") private inline fun frostSnackbar(crossinline builder: Snackbar.() -> Unit): Snackbar.() -> Unit = { builder() - //hacky workaround, but it has proper checks and shouldn't crash + // hacky workaround, but it has proper checks and shouldn't crash ((view as? FrameLayout)?.getChildAt(0) as? SnackbarContentLayout)?.apply { messageView.setTextColor(Prefs.textColor) actionView.setTextColor(Prefs.accentColor) - //only set if previous text colors are set + // only set if previous text colors are set view.setBackgroundColor(Prefs.bgColor.withAlpha(255).colorToForeground(0.1f)) } } @@ -316,10 +316,10 @@ inline val String.isIndirectImageUrl: Boolean */ inline val String?.isIndependent: Boolean get() { - if (this == null || length < 5) return false // ignore short queries - if (this[0] == '#' && !contains('/')) return false // ignore element values - if (startsWith("http") && !isFacebookUrl) return true // ignore non facebook urls - if (dependentSegments.any { contains(it) }) return false // ignore known dependent segments + if (this == null || length < 5) return false // ignore short queries + if (this[0] == '#' && !contains('/')) return false // ignore element values + if (startsWith("http") && !isFacebookUrl) return true // ignore non facebook urls + if (dependentSegments.any { contains(it) }) return false // ignore known dependent segments return true } |