Skip to content
This repository was archived by the owner on Jul 13, 2020. It is now read-only.
This repository was archived by the owner on Jul 13, 2020. It is now read-only.

Inlcude doesn't set LayoutParams from the XML #149

Closed
@cypressious

Description

@cypressious

Because in the implementation of include

inline fun <T: View> ViewManager.include(layoutId: Int, init: T.() -> Unit): T {
    @Suppress("UNCHECKED_CAST")
    return ankoView({ ctx -> ctx.layoutInflater.inflate(layoutId, null) as T }) { init() }
}

null is passed as the second parameter, layout parameters from the XML are not applied. I propose to add an overload where the receiver is of type ViewGroup and use the three argument version of inflate to add the parent container like so: inflate(layoutId, this, false)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions