-
-
Save kshvkantg/2d2704ae8a422bc65c6c4eabb0419fb4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ProductObservable() : BaseObservable(){ | |
constructor(weight : String?) : this() { | |
this.weight = weight | |
} | |
@SerializedName("weight") | |
@get:Bindable | |
var weight: String? = null | |
set(value) { | |
field = value | |
weightError = if (field.isNullOrEmpty() || (field | |
?: "0.00").toDouble() == 0.00 | |
) "Required*" else null | |
notifyPropertyChanged(BR.weightError) | |
notifyPropertyChanged(BR.weight) | |
} | |
@get:Bindable | |
var weightError: String? = null | |
set(value) { | |
field = value | |
notifyPropertyChanged(BR.weightError) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment