Skip to content

Instantly share code, notes, and snippets.

@mnirfan
Last active March 20, 2025 08:34
Show Gist options
  • Select an option

  • Save mnirfan/2266dfbe54a6e25a22fad43d519e38cb to your computer and use it in GitHub Desktop.

Select an option

Save mnirfan/2266dfbe54a6e25a22fad43d519e38cb to your computer and use it in GitHub Desktop.
set informations based on props passed from the element
import android.content.Context
import android.view.View
import android.view.accessibility.AccessibilityEvent
import com.lynx.tasm.event.LynxCustomEvent
import com.lynx.tasm.behavior.LynxContext
+import com.lynx.tasm.behavior.LynxProp
import com.lynx.tasm.behavior.ui.view.AndroidView
import com.lynx.tasm.behavior.ui.view.UISimpleView
class RadioButton(context: LynxContext) : UISimpleView<AndroidView>(context) {
override fun createView(context: Context?): AndroidView {
...
}
+ @LynxProp(name = "checked")
+ fun setChecked(value: Boolean) {
+ mChecked = value
+ }
+
+ @LynxProp(name = "disabled")
+ fun setDisabled(value: Boolean) {
+ mDisabled = value
+ }
+
+ @LynxProp(name = "text")
+ fun setText(value: String) {
+ mText = value
+ }
private fun emitEvent(name: String, value: Map<String, Any>?) {
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment