0
0
mirror of https://github.com/florisboard/florisboard.git synced 2024-09-20 03:52:18 +02:00

chore: Use AndroidVersion

This commit is contained in:
1fexd 2023-05-17 17:52:01 +02:00
parent 6597171011
commit 46cced07c3

View File

@ -16,7 +16,7 @@
package dev.patrickgold.florisboard.lib.snygg.value package dev.patrickgold.florisboard.lib.snygg.value
import android.os.Build import dev.patrickgold.florisboard.lib.android.AndroidVersion
/** /**
* SnyggValue is the base interface for all possible property values a Snygg stylesheet can hold. In general, a Snygg * SnyggValue is the base interface for all possible property values a Snygg stylesheet can hold. In general, a Snygg
@ -107,12 +107,10 @@ object SnyggImplicitInheritValue : SnyggValue, SnyggValueEncoder {
override fun encoder() = this override fun encoder() = this
} }
val isSOrAbove = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S
val SnyggVarValueEncoders = listOfNotNull( val SnyggVarValueEncoders = listOfNotNull(
SnyggSolidColorValue, SnyggSolidColorValue,
if (isSOrAbove) SnyggMaterialYouLightColorValue else null, if (AndroidVersion.ATLEAST_API31_S) SnyggMaterialYouLightColorValue else null,
if (isSOrAbove) SnyggMaterialYouDarkColorValue else null, if (AndroidVersion.ATLEAST_API31_S) SnyggMaterialYouDarkColorValue else null,
//SnyggImageRefValue, //SnyggImageRefValue,
SnyggRectangleShapeValue, SnyggRectangleShapeValue,
SnyggCircleShapeValue, SnyggCircleShapeValue,