sigmabeta
04/11/2016, 8:53 PMsigmabeta
04/11/2016, 8:54 PMsigmabeta
04/11/2016, 8:54 PMkirillrakhman
04/11/2016, 8:59 PMkirillrakhman
04/11/2016, 8:59 PMimangazalievm
04/12/2016, 2:34 AMimangazalievm
04/12/2016, 2:36 AMkittinunf
04/12/2016, 2:57 AMDelegates.observable
is pretty useful. I would be sad if Kotlin were to remove it.thijs
04/12/2016, 5:45 AMnekocode
04/12/2016, 7:16 AMgarethfleming
04/12/2016, 7:26 AMgarethfleming
04/12/2016, 7:28 AMthe_mafia
04/12/2016, 7:30 AMval intent = Intent(_context, AdvActivity::class.java)
i have error Error:Execution failed for task ':app:compileDebugKotlin'. > Compilation error. See log for more details
garethfleming
04/12/2016, 7:31 AMsimon.vergauwen
04/12/2016, 7:31 AMthe_mafia
04/12/2016, 7:34 AMgarethfleming
04/12/2016, 7:38 AMcesards
04/12/2016, 7:51 AMDelegates.observable
. There is the Delegates.vetoable
I don’t understand very well its purpose 😕the_mafia
04/12/2016, 8:06 AMgarethfleming
04/12/2016, 8:10 AMkittinunf
04/12/2016, 8:11 AMDeleagates.observable
as a way to get your job done.
Example,
var items by Delegates.observable(listOf<Item>()) { meta, oldItems, newItems -> adapter.notifyDatasetChanged() }
kittinunf
04/12/2016, 8:13 AMfun onUpdate(data: List<Item>) {
items = data
}
the_mafia
04/12/2016, 8:13 AMpublic class AdvActivity extends AppCompatActivity implements DrawerInterface {...
DrawerInterface you can see at screengarethfleming
04/12/2016, 8:16 AMkittinunf
04/12/2016, 8:17 AMDelegates.vetoable()
is a bit different. You need to return Boolean
out of the lambda block to identify whether you want this type of change to go through. One caveat is the lambda for vetoable()
will be called before the assignment which might or might not be want you expect.garethfleming
04/12/2016, 8:19 AMgarethfleming
04/12/2016, 8:20 AMthe_mafia
04/12/2016, 8:41 AMgarethfleming
04/12/2016, 8:43 AMjohannes.lagos
04/12/2016, 9:38 AMvar tickets by lazy { LinearLayout(this)}