Kotlin / anko

Pleasant Android application development
Apache License 2.0
15.89k stars 1.29k forks source link

Bad lambda receiver type in verticalLayout's in 0.10.6 #673

Closed Android-s14 closed 6 years ago

Android-s14 commented 6 years ago

Unless I misunderstood the change and it was intentional, the signature for the verticalLayout family of methods looks like this:

inline fun ViewManager.verticalLayout(theme: Int = 0, init: (@AnkoViewDslMarker LinearLayout).() -> Unit)

instead of:

inline fun ViewManager.verticalLayout(theme: Int = 0, init: (@AnkoViewDslMarker _LinearLayout).() -> Unit)

Having the basic LinearLayout there most notably prevents us from using the lparams() methods.

What leads me to think this is a bug is the fact that the linearLayout methods are still fine.

wschurman commented 6 years ago

Looks like the blame rev is https://github.com/Kotlin/anko/pull/616/commits/60761efa2274f26b000ae090eeb1c8bf23e5b0e1. To fix it CustomViews will have to be placed separately within each SDK library since _LinearLayout is only available inside each (unless there's some trickery someone knows of).

cc @4u7