mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-11 06:44:09 +01:00
fixes and cleanup after rebase
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
53b5db4f19
commit
cca35c32af
@ -50,6 +50,7 @@ import androidx.appcompat.widget.SearchView.SearchAutoComplete
|
|||||||
import androidx.appcompat.widget.SwitchCompat
|
import androidx.appcompat.widget.SwitchCompat
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.content.res.ResourcesCompat
|
import androidx.core.content.res.ResourcesCompat
|
||||||
|
import androidx.core.graphics.ColorUtils
|
||||||
import androidx.core.graphics.drawable.DrawableCompat
|
import androidx.core.graphics.drawable.DrawableCompat
|
||||||
import androidx.core.view.ViewCompat
|
import androidx.core.view.ViewCompat
|
||||||
import androidx.core.view.children
|
import androidx.core.view.children
|
||||||
@ -538,14 +539,6 @@ class ViewThemeUtils @Inject constructor(private val theme: ServerTheme, private
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun progressColor(context: Context, color: Int): Int {
|
|
||||||
val lightness = when (isDarkMode(context)) {
|
|
||||||
true -> PROGRESS_LIGHTNESS_DARK_THEME
|
|
||||||
false -> PROGRESS_LIGHTNESS_LIGHT_THEME
|
|
||||||
}
|
|
||||||
return colorUtil.setLightness(color, lightness)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun colorEditText(editText: EditText) {
|
fun colorEditText(editText: EditText) {
|
||||||
withScheme(editText) { scheme ->
|
withScheme(editText) { scheme ->
|
||||||
// TODO check API-level compatibility
|
// TODO check API-level compatibility
|
||||||
@ -667,19 +660,6 @@ class ViewThemeUtils @Inject constructor(private val theme: ServerTheme, private
|
|||||||
return drawable
|
return drawable
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun progressColor(context: Context, color: Int): Int {
|
|
||||||
val hsl = FloatArray(HSL_SIZE)
|
|
||||||
ColorUtils.RGBToHSL(Color.red(color), Color.green(color), Color.blue(color), hsl)
|
|
||||||
|
|
||||||
if (isDarkMode(context)) {
|
|
||||||
hsl[INDEX_LIGHTNESS] = LIGHTNESS_DARK_THEME
|
|
||||||
} else {
|
|
||||||
hsl[INDEX_LIGHTNESS] = LIGHTNESS_LIGHT_THEME
|
|
||||||
}
|
|
||||||
|
|
||||||
return ColorUtils.HSLToColor(hsl)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun calculateDisabledColor(color: Int, opacity: Float): Int {
|
private fun calculateDisabledColor(color: Int, opacity: Float): Int {
|
||||||
return Color.argb(
|
return Color.argb(
|
||||||
(Color.alpha(color) * opacity).roundToInt(),
|
(Color.alpha(color) * opacity).roundToInt(),
|
||||||
|
Loading…
Reference in New Issue
Block a user