I am currently working on a little scala DSL for Android (https://github.com/bertderbecker/scalandroid).
val drawerLayout = new SDrawerLayout {
openDrawerFrom = SGravity.LEFT
fitsSystemWindows = true
navigationView = new SNavigationView {
println(parent) //None - the parent of the drawerlayout
// I want that the parent is the drawerlayout
layout = SLayout.NAVI_HEADER_DEFAULT
fitsSystemWindows = true
}
}
How can I tell the SNavigationView to use the SDrawerLayout as its parent, not the parent of the DrawerLayout?
So, more generally, I want to have a class foo (0) , which takes a foo (-1) as an implicit parameter and within you can define a foo (+1), which will take the foo (0) from the beginning as an implicit parameter.
So foo is "recursive".
What I want is:
class foo()(implicit parent: foo) {
parent = this
val f = new Foo { //takes this as its parent
}
}