Create a custom View/ViewGroup class in Anko DSL
问题 I want to create a custom View which is just a wrapper of some Android Views. I looked into creating a custom ViewGroup which manages the layout of it's child views, but I don't need such complexity. What I basically want to do is something like: class MainActivity verticalLayout { textView { text = "Something that comes above the swipe" } swipeLayout { } } class SwipeLayout linearLayout { textView { text = "Some text" } textView { text = "Another text" } } The reason is that I'd like to move