Skip to content

How use kotlin-observable at pure java !!? #3

@CMingTseng

Description

@CMingTseng

Dear Sir

i want create general library -- use at java & kotlin final at Android !!

at Android i have google databinding library --- ObservableList/ObservableArrayList

https://developer.android.google.cn/reference/android/databinding/ObservableArrayList?hl=zh-cn

but it maybe not full support ( aar file ??!! )

at java i have ObservableList

now want use kotlin

i create a ObservableListWrapper

like this

val all_hours = ObservableListWrapper( ArrayList())

i can use

all_hours.onAdd += { anchor, index -> println("Show glob all_hours add $anchor __at $index") }

let me get all_hours notify change -- add

but at Java

onAdd --> getOnAdd()

but += ? <---- how to replace ?

THX

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions