mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2024-12-22 08:37:24 +00:00
commit
6f095de81d
@ -1,5 +1,10 @@
|
||||
# Changelog
|
||||
|
||||
## 0.0.21
|
||||
|
||||
* Upfill `UIKitWidth`
|
||||
* New extension `UIKitModifier#applyWhenScreenSizeIs`
|
||||
|
||||
## 0.0.20
|
||||
|
||||
* Remove type of button from `DefaultButton` and add companion to `UIKitButton` to be able to use `uk-button` class
|
||||
|
@ -9,4 +9,4 @@ android.enableJetifier=true
|
||||
# Project data
|
||||
|
||||
group=dev.inmo
|
||||
version=0.0.20
|
||||
version=0.0.21
|
||||
|
@ -18,3 +18,5 @@ sealed class UIKitScreenSizeModifier(val name: String) {
|
||||
modifier
|
||||
)
|
||||
}
|
||||
|
||||
fun UIKitModifier.applyWhenScreenSizeIs(size: UIKitScreenSizeModifier) = size.modify(this)
|
||||
|
@ -3,8 +3,9 @@ package dev.inmo.jsuikit.modifiers
|
||||
sealed class UIKitWidth(classname: String) : UIKitModifier {
|
||||
override val classes: Array<String> = arrayOf("uk-width-$classname")
|
||||
|
||||
object Full : UIKitWidth("1-1")
|
||||
object Auto : UIKitWidth("auto")
|
||||
object Expand : UIKitWidth("expand")
|
||||
object Full : UIKitWidth("1-1")
|
||||
|
||||
object Half : UIKitWidth("1-2")
|
||||
|
||||
@ -12,22 +13,70 @@ sealed class UIKitWidth(classname: String) : UIKitModifier {
|
||||
object TwoThird : UIKitWidth("2-3")
|
||||
|
||||
object OneFourth : UIKitWidth("1-4")
|
||||
val TwoFourth get() = Half
|
||||
object ThreeFourth : UIKitWidth("3-4")
|
||||
val FourFourth get() = Full
|
||||
|
||||
object OneFifth : UIKitWidth("1-5")
|
||||
object TwoFifth : UIKitWidth("2-5")
|
||||
object ThreeFifth : UIKitWidth("3-5")
|
||||
object FourFifth : UIKitWidth("4-5")
|
||||
val FiveFifth get() = Full
|
||||
|
||||
object OneSixth : UIKitWidth("1-6")
|
||||
object FiveSixth : UIKitWidth("5-6")
|
||||
|
||||
sealed class Child(suffix: String) : UIKitWidth("child-$suffix") {
|
||||
object Full : Child("1-1")
|
||||
|
||||
object Half : Child("1-2")
|
||||
|
||||
object OneThird : Child("1-3")
|
||||
object TwoThird : Child("2-3")
|
||||
|
||||
object OneFourth : Child("1-4")
|
||||
object ThreeFourth : Child("3-4")
|
||||
|
||||
object OneFifth : Child("1-5")
|
||||
object TwoFifth : Child("2-5")
|
||||
object ThreeFifth : Child("3-5")
|
||||
object FourFifth : Child("4-5")
|
||||
|
||||
object OneSixth : Child("1-6")
|
||||
object FiveSixth : Child("5-6")
|
||||
|
||||
object Auto : Child("auto")
|
||||
object Expand : Child("expand")
|
||||
|
||||
companion object {
|
||||
|
||||
val TwoFourth get() = Half
|
||||
val TwoSixth get() = OneThird
|
||||
val ThreeSixth get() = Half
|
||||
val FourSixth get() = TwoThird
|
||||
object FiveSixth : UIKitWidth("5-6")
|
||||
val FourFourth get() = Full
|
||||
val FiveFifth get() = Full
|
||||
val SixSixth get() = Full
|
||||
}
|
||||
}
|
||||
|
||||
sealed class Fixed(suffix: String) : UIKitWidth("fixed-$suffix") {
|
||||
|
||||
object Small : Fixed("small")
|
||||
object Medium : Fixed("medium")
|
||||
object Large : Fixed("large")
|
||||
object XLarge : Fixed("xlarge")
|
||||
object XXLarge : Fixed("2xlarge")
|
||||
|
||||
}
|
||||
|
||||
override fun toString() = classes.first()
|
||||
|
||||
companion object {
|
||||
|
||||
val TwoFourth get() = Half
|
||||
val TwoSixth get() = OneThird
|
||||
val ThreeSixth get() = Half
|
||||
val FourSixth get() = TwoThird
|
||||
val FourFourth get() = Full
|
||||
val FiveFifth get() = Full
|
||||
val SixSixth get() = Full
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user