zsmb13 / MaterialDrawerKt

A Kotlin DSL wrapper around the mikepenz/MaterialDrawer library.
Apache License 2.0
518 stars 41 forks source link

actionBarDrawerToggle expecting ActionBarDrawerToggle instead of Boolean #46

Closed Quintasan closed 7 years ago

Quintasan commented 7 years ago

Not sure if this is an actual bug but the original library has the following code:

new DrawerBuilder()
    .withActivity(this)
    .withTranslucentStatusBar(false)
        .withActionBarDrawerToggle(false)
    .addDrawerItems(
        //pass your items here
    )
    .build();

The following code complains about type mismatch:

result = drawer {
            translucentStatusBar = false
            actionBarDrawerToggle = false
            primaryItem("Home") {}
            primaryItem("Users") {}
            secondaryItem("Settings") {}
        }

What am I doing wrong?

zsmb13 commented 7 years ago

Hey, that setting is available through the actionBarDrawerToggleEnabled property.

It had to have a different name because the original library uses overloaded functions here, but there can't be multiple properties with different types in Kotlin. I'll add this to the documentation somewhere.