A Kotlin DSL wrapper around the mikepenz/MaterialDrawer library.

Overview

MaterialDrawerKt

Build Status Bintray Awesome Kotlin Badge Android Arsenal

Create navigation drawers in your Activities and Fragments without having to write any XML, in pure Kotlin code, with access to all the features of the original library: all sorts of menu items, badges, account headers, and more.

This library is a Kotlin DSL wrapper around the mikepenz/MaterialDrawer library, and features:

  • Access to all of the original library's features with a nice, concise API
  • Fixes for the couple of inconsistencies of the original API
  • Detailed code comments for conveninent in-IDE documentation lookup (Ctrl+Q on Windows, โŒƒJ on Mac)

Sample app

You can find the sample app in the Play Store, and its source code in the app module of the project.

Setup

The library is hosted on mavenCentral(). To use it, add the following to your module level build.gradle file's dependencies:

implementation 'co.zsmb:materialdrawer-kt:3.0.0'

// required support lib modules
implementation "androidx.appcompat:appcompat:${versions.appcompat}"
implementation "androidx.recyclerview:recyclerview:${versions.recyclerView}"
implementation "androidx.annotation:annotation:${versions.annotation}"
implementation "com.google.android.material:material:${versions.material}"
implementation "androidx.constraintlayout:constraintlayout:${versions.constraintLayout}"

In general, you don't have to include the original library separately. (See the note in the FAQ.)

If you want to use the pre-Kotlin version of the base library for some reason, you can use the last 2.x release of the library found here.

If you're not using AndroidX yet, you can use the last 1.x release of the library found here.

Basic usage

Just as a general note, try using the in-IDE documentation when you're in doubt about anything. It's much more detailed than the original library's docs, this was one of the design goals of the library. The IntelliJ/Android Studio shortcut for bringing up the docs about a function is Ctrl+Q on Windows, and โŒƒJ on Mac.

To add a navigation drawer, you just have to add the following to your Activity's onCreate function:

drawer {}

This will give you an empty sheet that you can drag in from the left side of the screen. You can add menu items to it like this:

drawer {
    primaryItem("Home") {}
    divider {}
    primaryItem("Users") {}
    secondaryItem("Settings") {}
}

For all the available types of menu items, see the "Drawer item types" in the sample app.

You can modify properties of the drawer inside the drawer {} block, and properties of the menu items in their respective blocks:

drawer {
    headerViewRes = R.layout.header
    closeOnClick = false
    
    primaryItem("Home") {
        icon = R.drawable.ic_home
    }
    divider {}
    primaryItem("Users") {
        icon = R.drawable.ic_user
    }
    secondaryItem("Settings") {
        icon = R.drawable.ic_settings
        selectable = false
    }
}

Note that most of these properties are non-readable, and can only be used for setting these values. This is why these properties are marked as deprecated, and will cause build errors. The rest should be safe to use to read back any values you've set, if you had to do that for whatever reason.

For a complete reference of the wrapper methods and properties, see the list in the wiki.

Advanced features

Account headers

Creating an account header with profile entries can be done like so:

drawer {
    accountHeader { 
        profile("Samantha", "[email protected]") {
            icon = "http://some.site/samantha.png"
        }
        profile("Laura", "[email protected]") { 
            icon = R.drawable.profile_laura
        }
    }
    
    primaryItem("Home")
}

Note that loading images from URLs requires additional setup, see the Image loading section of this document or the DrawerApplication class in the sample app for guidance.

Footers

You can add items to an always visible, sticky footer in by nesting them inside a footer block:

drawer {
    footer {
        primaryItem("Primary item")
        secondaryItem("Secondary item")
    }
}

Listeners

Listeners can be added to both individual drawer items and the entire drawer. Some examples:

drawer {
    primaryItem("Item 1")
    primaryItem("Item 2") {
        // Called only when this item is clicked
        onClick { _ ->
            Log.d("DRAWER", "Click.")
            false
        }
    }

    // Called when any drawer item is clicked
    onItemClick { _, position, _ ->
        Log.d("DRAWER", "Item $position clicked")
        false
    }
    
    onOpened { 
        Log.d("DRAWER", "Navigation drawer opened")
    }
}

More examples in the "Listeners" section of the sample app.

Badges

Add badges to drawer items, and customize them with this syntax:

drawer {
    primaryItem {
        badge("111") {
            cornersDp = 0
            color = 0xFF0099FF
            colorPressed = 0xFFCC99FF
        }
    }
}

You can see more examples in the "Badges" section of the sample app.

Conversion from original

This is a rough guide to how the original API's features are converted to the DSL, for those who are already familiar with the original library.

Builders

Builders are replaced by functions that are named without the "Builder" suffix.

DrawerBuilder()
    .withActivity(this)
    .build()

... is replaced with ...

drawer { 

}

DrawerItems

Calls to XyzDrawerItem classes are replaced with functions as well. The "Drawer" word is omitted from the function's name. Note that properties like names and descriptions of the drawer items become parameters of these functions.

For example:

PrimaryDrawerItem().withName("Item name")

... is replaced with ...

primaryItem("Item name") {

}

with functions

Calls to .withXyz() functions are replaced with properties that you can set. For a complete reference of the wrapper methods and properties, see the list in the wiki.

Very few of these are readable. If you want to read these at build time for some reason, check the documentation. Non-readable properties should be deprecated and not compile, but if they do, they will throw a NonReadablePropertyException if you attempt to read their value.

For an example...

AccountHeaderBuilder()
    .withActivity(this)
    .withHeaderBackground(R.color.colorPrimary)
    .build()

... is replaced with ...

accountHeader {
    headerBackgroundRes = R.color.colorPrimary 
}

Note that overloaded functions are replaced with multiple properties, distinguished by suffixes. For example, the above withHeaderBackground function's three overloads can be set through the following properties:

Parameter type Property name
Int headerBackground
headerBackgroundRes
Drawable headerBackgroundDrawable
ImageHolder headerBackgroundImage

There may be defaults without suffixes for what's assumed to be the most popular use case.

Listeners

Adding simple listeners to drawers (or individual drawer items) are done with onXyz function calls, which take lambdas as parameters. For example:

DrawerBuilder()
        .withActivity(this)
        .withOnDrawerItemClickListener(object : Drawer.OnDrawerItemClickListener {
            override fun onItemClick(view: View, position: Int, drawerItem: IDrawerItem<out Any?, out RecyclerView.ViewHolder>?): Boolean {
                Log.d("DRAWER", "Clicked!")
                return true
            }
        })
        .build()

... is replaced with ...

drawer {
    onItemClick { view, position, drawerItem -> 
        Log.d("DRAWER", "Clicked!")
        true
    }
}

Complex listeners

Listeners that originally have multiple callbacks have been broken up into individual functions:

DrawerBuilder()
        .withActivity(this)
        .withOnDrawerListener(object : Drawer.OnDrawerListener {
            override fun onDrawerSlide(drawerView: View?, slideOffset: Float) {
                Log.d("DRAWER", "Sliding")
            }

            override fun onDrawerClosed(drawerView: View?) {
                Log.d("DRAWER", "Closed")
            }

            override fun onDrawerOpened(drawerView: View?) {
                Log.d("DRAWER", "Opened")
            }
        })
        .build()

... is replaced with ...

drawer { 
    onSlide { _, _ ->
        Log.d("DRAWER", "Sliding")
    }
    onClosed {
        Log.d("DRAWER", "Closed")
    }
    onOpened {
        Log.d("DRAWER", "Opened")
    }
}

Image loading

Since the MaterialDrawer library doesn't include its own image loading solution, you have to set one up yourself. You have to do this before the first time MaterialDrawer has to load an image, for example, in your Application's onCreate method.

With the original library, this setup looks like this (Picasso is just used as an example):

DrawerImageLoader.init(object: AbstractDrawerImageLoader() {
    override fun placeholder(ctx: Context, tag: String?): Drawable {
        return DrawerUIUtils.getPlaceHolder(ctx)
    }

    override fun set(imageView: ImageView, uri: Uri, placeholder: Drawable?, tag: String?) {
        Picasso.with(imageView.context)
                .load(uri)
                .placeholder(placeholder)
                .into(imageView)
    }

    override fun cancel(imageView: ImageView) {
        Picasso.with(imageView.context)
                .cancelRequest(imageView)
    }
})

This can be replaced by the following:

drawerImageLoader {
    placeholder { ctx, tag ->
        DrawerUIUtils.getPlaceHolder(ctx)
    }
    set { imageView, uri, placeholder, tag ->
        Picasso.with(imageView.context)
                .load(uri)
                .placeholder(placeholder)
                .into(imageView)
    }
    cancel { imageView ->
        Picasso.with(imageView.context)
                .cancelRequest(imageView)
    }
}

FAQ

I want to use features of the base library that haven't made it to this one yet

If the base library gets features and they aren't ported to this wrapper yet, you can include that as a dependency in addition to this one, and use the two together. For these purposes, the internal DrawerBuilder that this library uses is exposed through a property, and you can access it like so:

drawer {
    builder.withKeepStickyItemsVisible(true)
}

The internal AccountHeaderBuilder is exposed in the same way:

accountHeader {
    builder.withHeightDp(20)
}

As for drawer items, you can just use the original API's calls on the items that are returned:

val item = primaryItem("Hello") {
    icon = R.drawable.profile
}
item.withBadge("10")
primaryItem("Hello") {
    icon = R.drawable.profile
}.withBadge("10")

License

Copyright 2020 Marton Braun

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Targeting API 28 results in crash - Invalid Layer Save Flag - only ALL_SAVE_FLAGS is allowed

    Targeting API 28 results in crash - Invalid Layer Save Flag - only ALL_SAVE_FLAGS is allowed

        java.lang.IllegalArgumentException: Invalid Layer Save Flag - only ALL_SAVE_FLAGS is allowed
            at android.graphics.Canvas.checkValidSaveFlags(Canvas.java:378)
            at android.graphics.Canvas.saveLayer(Canvas.java:455)
            at com.mikepenz.materialdrawer.view.BezelImageView.onDraw(BezelImageView.java:213)
    

    this is related to issue #2293 of MaterialDrawer.

    opened by queiroz 7
  • Getting null on actionBarDrawerToggle

    Getting null on actionBarDrawerToggle

    Hi I am getting result.actionBarDrawerToggle must not be null. when I set .isDrawerIndicatorEnabled = true

            super.onCreate(savedInstanceState)
    
            setContentView(R.layout.activity_main)
            setSupportActionBar(toolbar)
    
    
            initViews()
            getAuthToken()
    
            initDrawer(savedInstanceState)
    
            result = drawer {
                savedInstance = savedInstanceState
    
                toolbar = [email protected]
                translucentStatusBar = false
    
                buildViewOnly = true
                generateMiniDrawer = true
    
                showOnFirstLaunch = true
    
                headerResult = accountHeader {
                    selectionListEnabledForSingleProfile = false
    
                    savedInstance = savedInstanceState
                    translucentStatusBar = false
                    background = R.drawable.header_bg
    
                    mProfile = profile(App.prefs.firstName + " " + App.prefs.lastName, App.prefs.authEmail) {
                        iconUri = Helper.drawableToUri(this@MainActivity, R.mipmap.ic_launcher_circle)
                    }
    
                    profileSetting("Logout") {
                        iicon = GoogleMaterial.Icon.gmd_exit_to_app
                        onClick { _ ->
                            logout()
                            false
                        }
                    }
                }
    
                sectionHeader("Available Tools")
    
                ToolsDataService.tools.forEach {
                    primaryItem(it.name) {
                        icon = it.menuResource
                        onClick { _ ->
                            startActivity(Intent(this@MainActivity, it.activity))
                            true
                        }
                    }
                }
    
                divider()
    
                actionBarDrawerToggleAnimated = true
                actionBarDrawerToggleEnabled = true
            }
    
            supportActionBar!!.setDisplayHomeAsUpEnabled(false)
            result.actionBarDrawerToggle.isDrawerIndicatorEnabled = true
    
    
    
            val miniResult = result.miniDrawer
            val firstWidth = UIUtils.convertDpToPixel(300f, this).toInt()
            val secondWidth = UIUtils.convertDpToPixel(72f, this).toInt()
            // Create and build our CrossFader
            val crossFader = Crossfader<CrossFadeSlidingPaneLayout>()
                    .withContent(cross_fader)
                    .withFirst(result.slider, firstWidth)
                    .withSecond(miniResult.build(this), secondWidth)
                    .withSavedInstance(savedInstanceState)
                    .build()
    
    
            miniResult.withCrossFader(CrossfadeWrapper(crossFader))
    
            // Define a shadow (this is only for normal LTR layouts, if you have a RTL app you need to define the other one)
            crossFader.getCrossFadeSlidingPaneLayout().setShadowResourceLeft(R.drawable.material_drawer_shadow_left)
    
    opened by ChaosPower 5
  • How to get rid of the switch icon

    How to get rid of the switch icon

    I am trying to align the profile account header (picture, email, name) to the center and I am not able to get rid of the switch icon that is on the right. Since I am using a custom view, Every time I try to delete a view, it throws an exception since It can't find it.

    Is there a way to have more control of how the profile account header is drawn?

    question 
    opened by jorgevalbuena56 4
  • Update the dependencies

    Update the dependencies

    It may also be worthwhile to have the user include the original dependency anyways since they can update it directly while still using your bindings rather than wait for you to update the lib with the newer material drawer version.

    opened by AllanWang 4
  • expandable item bug: sub items added twice

    expandable item bug: sub items added twice

    hi. I get duplicate sub-items for an expandable item. am I doing something wrong? here is my code:

    expandableItem {
                    nameRes = R.string.moreInfo
                    icon = R.drawable.ic_more_info
    
                    attachItem(secondaryItem {
                        nameRes = R.string.officialSite
                    })
    

    and here is the outcome capture _2018-08-02-17-26-56_01

    opened by or-dvir 3
  • Builder object doesn't seem to be accessible?

    Builder object doesn't seem to be accessible?

    The FAQ states the following:

    I want to use features of the base library that haven't made it to this one yet

    If the base library gets features and they aren't ported to this wrapper yet, you can include that as a dependency in addition to this one, and use the two together. For these purposes, the internal DrawerBuilder that this library uses is exposed through a property, and you can access it like so:

    drawer { builder.withKeepStickyItemsVisible(true) }

    However, I get the following error when trying to do this in Android Studio:

    screen shot 2018-06-12 at 11 20 00

    What am I doing wrong? ๐Ÿ˜„

    bug 
    opened by sandyscoffable 3
  • Add/Remove after initialize

    Add/Remove after initialize

    How add/Remove items after initialize using KtLib?? Has issues talk ifself but no found Drawer.Result as explained in issue i read.

    I try using this form mDrawer.addItem( mPrimaryItem )

    Sorry my english and Thanks for Lib.

    question 
    opened by dev12-SC 3
  • Image not loading via URL in Accoundheader

    Image not loading via URL in Accoundheader

    Hi,

    Hi, I have the following problem. The iconurl in profiles will not load. I get a empty circle.

    profile ("Name of Profile") { iconUrl = "https://imageURL.here" nameShown = true }

    question 
    opened by androidseb25 2
  • Support for Androidx

    Support for Androidx

    Basically just pushed the refactor button (check 9ce3555), also update the version of some other dependencies (check fff8586 for those changes) This however (and quite obviously) breaks the public api, as it now requires androidx, due to this major incompatibilty i suggest updating the version to 2.0.0 (as done in 23e1150)

    opened by TheKingOfAtlantis 2
  • Replace

    Replace "kotlin-stdlib-jre7" dependency with "kotlin-stdlib-jdk7"

    Hi! When using MaterialDrawerKt with Android Studio 3.1.2, I'm getting a build warning: "kotlin-stdlib-jre7 is deprecated. Please use kotlin-stdlib-jdk7 instead". Hopefully it should be a trivial fix, thanks!

    opened by valsinats42 2
  • Switch item onClick listeners not called

    Switch item onClick listeners not called

    I'd like to launch a fragment when the text of a switch item is clicked (and toggle the switch when the switch itself is clicked). However, it seems that when the item is bound the click listener set here is overridden.

    switchItem {"Switch 1"
        selectable = true
        onClick { view ->
            Log.d("Drawer", "Clicked!")
            false
        }
    }
    switchItem {"Switch 2"
        selectable = false
        onClick { item ->
            Log.d("Drawer", "Clicked!")
            false
        }
    }
    

    The onClick function is not called in either of these cases. It seems there was an old issue that suggests it is possible, but I'm not sure how to do it. Any ideas? https://github.com/mikepenz/MaterialDrawer/issues/321

    question 
    opened by johnwilde 2
  • Embedded not work in fragment

    Embedded not work in fragment

    Embedded drawer works fine when created in activity. But with the same code in Fragment i get error "The specified child already has a parent. You must call removeView() on the child's parent first."

    opened by shuhratjon 0
  • Expanded secondary items are not collapsed on main expandable item closed

    Expanded secondary items are not collapsed on main expandable item closed

    Hi, first of all thanks for this awesome library. I have a menu structure in which there are 2 levels of menu items (a > b > c). Scenario is as follows: Whenever menu item c is expanded and closed item a, then closed drawer. And when reopening menu items inside c is still opened and sometimes the menu items in c is misplaced into another sub level of menu item. How can we collapse all menu items when drawer is closed?

    opened by sudheeshde 0
  • How use iconic with MaterialDrawerKt

    How use iconic with MaterialDrawerKt

    Which dependencies and which version should I use to use iconic and font awesome with MaterialDrawerKt? Like this part: https://github.com/mikepenz/MaterialDrawer#android-iconics-support

    opened by MohammadRezaei92 0
  • Add the same drawer to multiple activities

    Add the same drawer to multiple activities

    Hello y'all,

    I would like to add the drawer currently in MainActivity to Activities which are collapsable items. But I can't seem to find any tips on the web, should I do this by inheritance, if so, how or should I do this with fragments, and if so could you give me an example?

    This is MainActivity :

    class MainActivity : AppCompatActivity() {
        private lateinit var result: Drawer
        private lateinit var headerResult: AccountHeader
    
        override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)
            setContentView(R.layout.activity_main)
            setSupportActionBar(toolbar)
    
            result = drawer {
                toolbar = [email protected]
                hasStableIds = true
                savedInstance = savedInstanceState
                showOnFirstLaunch = true
    
                headerResult = accountHeader {
                    savedInstance = savedInstanceState
                    translucentStatusBar = true
    
    
    
                        profile("CampusID", "[email protected]") {
                            iconUrl = "https://avatars3.githubusercontent.com/u/887462?v=3&s=460"
                            identifier = 101
    
                        }
                }
                sectionHeader("CampusiD"){
                    divider= false
                }
    
    
                expandableItem("Mes infos") {
                   // iicon = MaterialDesignIconic.Icon.gmi_collection_case_play
                    identifier = 19
                    selectable = false
                    secondaryItem("Planning") {
                        level = 2
                        identifier = 2002
                        selectable = false
                        onClick(openActivity(PlanningActivity::class) )
                    }
                    secondaryItem("Relevรฉs de notes") {
                        level = 2
                        identifier = 2003
                        selectable = false
                        onClick(openActivity(NotesActivity::class) )
                    }
    
                    secondaryItem("Trombinoscope") {
                        level = 2
                        identifier = 2004
                        selectable = false
                        onClick(openActivity(TrombinoscopeActivity::class) )
                    }
    
                    secondaryItem("Messages") {
                        level = 2
                        identifier = 2005
                        selectable = false
                        onClick(openActivity(MessagesActivity::class) )
                    }
                }
    
                divider()
    
                expandableItem("Vie Etudiante") {
                    // iicon = MaterialDesignIconic.Icon.gmi_collection_case_play
                    identifier = 20
                    selectable = false
                    secondaryItem("Offres de stage") {
                        level = 2
                        identifier = 2006
                        selectable = false
                        onClick(openActivity(StagesActivity::class) )
                    }
                    secondaryItem("Petites Annonces") {
                        level = 2
                        identifier = 2007
                        selectable = false
                        onClick(openActivity(AnnoncesActivity::class) )
                    }
    
                    secondaryItem("Messages globaux") {
                        level = 2
                        identifier = 2008
                        selectable = false
                        onClick(openActivity(MessagesGlobauxActivity::class) )
                    }
                }
    
                divider()
    
                expandableItem("Demandes Administratives") {
                    // iicon = MaterialDesignIconic.Icon.gmi_collection_case_play
                    identifier = 21
                    selectable = false
                    secondaryItem("Convention de stage") {
                        level = 2
                        identifier = 2009
                        selectable = false
                        onClick(openActivity(ConventionStageActivity::class) )
                    }
                    secondaryItem("Certificat de scolaritรฉ") {
                        level = 2
                        identifier = 2010
                        selectable = false
                        onClick(openActivity(CertificatScolariteActivity::class) )
                    }
                }
    
                divider()
    
                primaryItem("Paramรจtres"){
                    onClick(openActivity(ParametresActivity::class) )
                }
    
                divider()
    
                primaryItem("Contact") {
                    onClick(openActivity(ContactActivity::class))
                }
    
                divider()
            }
        }
    
        private fun <T : Activity> openActivity(activity: KClass<T>): (View?) -> Boolean = {
            startActivity(Intent(this@MainActivity, activity.java))
            false
        }
    
        override fun onSaveInstanceState(outState: Bundle) {
            result.saveInstanceState(outState)
            headerResult.saveInstanceState(outState)
            super.onSaveInstanceState(outState)
        }
    
        override fun onBackPressed() {
            if (result.isDrawerOpen)
                result.closeDrawer()
            else
                super.onBackPressed()
        }
    
    }
    

    This is an example of a sub-activity :

    class PlanningActivity : AppCompatActivity() {
    
        override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)
            setContentView(R.layout.activity_planning)
        }
    }
    

    Thanking you in advance.

    opened by phfrc 0
  • Selected on item does not work

    Selected on item does not work

    when declaring an item, selected is never listened to. It always puts the first item as selected no matter what I set (trueor false).

    I rebuild the drawer on each activity change (even if I know that fragments are better, bear with me) taking care to set selected on the item in relation to the Activity i'm building. Still it does not work.

    Demo

    CKDon1XHH4

    Code

    
            drawer {
                toolbar = localToolbar
                onClosed { drawerClosedStream.onNext(0) }
                primaryItem(R.string.title_activity_tracking) {
                    onClick { _ ->
                        drawerClicksStream.onNext(AppConstants.Activities.TRACKING)
                        false
                    }
                    selected = origin == AppConstants.Activities.TRACKING
                }
                divider { }
                primaryItem(R.string.title_activity_manager) {
                    onClick { _ ->
                        drawerClicksStream.onNext(AppConstants.Activities.MANAGER)
                        false
                    }
                    selected = origin == AppConstants.Activities.MANAGER
                }
                primaryItem(R.string.title_activity_pin_manager) {
                    onClick { _ ->
                        drawerClicksStream.onNext(AppConstants.Activities.PIN)
                        false
                    }
                    selected = origin == AppConstants.Activities.PIN
                }
                divider { }
                secondaryItem(R.string.title_activity_settings) {
                    onClick { _ ->
                        drawerClicksStream.onNext(AppConstants.Activities.SETTINGS)
                        false
                    }
                    selected = origin == AppConstants.Activities.SETTINGS
                }
                secondaryItem("Help") { selectable = false }
                footer {
                }
            }
    
    
    
    opened by Polyterative 0
Releases(3.0.0)
  • 3.0.0(Jan 1, 2020)

  • 3.0.0-rc01(Aug 7, 2019)

    This RC release is built upon the brand new Kotlin rewrite of the base library, specifically v7.0.0-rc04 - see the base library releases here. It includes some API and some implementation changes to track changes of the base library. It also features some API additions for things that were missing before.

    Source code(tar.gz)
    Source code(zip)
  • 2.0.1(Oct 8, 2018)

  • 2.0.0(Sep 22, 2018)

    This is the first AndroidX release of the library! If you're not using AndroidX, stick to 1.x versions.

    Changes:

    • Updated to AndroidX 1.0.0 dependencies
    • Updated to 6.1.0 of the base library
    Source code(tar.gz)
    Source code(zip)
  • 1.3.7(Sep 22, 2018)

    This is the last release of the library that depends on the old support libraries, newer releases will be using androidx, just like the base library.

    Changes in this version:

    • attachItem fixes (slightly related: #73)
    • Kotlin version updated to 1.2.70
    • Support library version updated to 28.0.0
    • Build tools updated to 28.0.2

    Gradle dependencies to use this version:

    implementation 'co.zsmb:materialdrawer-kt:1.3.7'
    
    // required support libraries
    implementation "com.android.support:appcompat-v7:${versions.supportLib}"
    implementation "com.android.support:recyclerview-v7:${versions.supportLib}"
    implementation "com.android.support:support-annotations:${versions.supportLib}"
    implementation "com.android.support:design:${versions.supportLib}"
    
    Source code(tar.gz)
    Source code(zip)
  • 1.3.6(Jul 22, 2018)

  • 1.3.5(Jun 20, 2018)

    • Update to base library version 6.0.8

    • Builder property visibility fix (#71)

    • Kotlin stdlib dependency fix (#69 )

    • Updated support library to 27.1.1

    • Updated Kotlin version to 1.2.50

    • Updated Android Gradle plugin to 3.1.3

    Source code(tar.gz)
    Source code(zip)
  • 1.3.4(Apr 2, 2018)

  • 1.3.3(Feb 8, 2018)

  • 1.3.2(Feb 4, 2018)

  • 1.3.1(Jan 28, 2018)

  • 1.3.0(Jan 27, 2018)

    After some inactivity since last year, here's another update! Let's see what's included.

    Internal improvements and small breaking changes

    This section is only relevant if you've been extending this DSL to use it with your own custom drawer items.

    The build method of the drawer items is now in their base class (AbstractDrawerItemKt), and has internal visibility. The builder classes (ending in Kt also now take a generic parameter which is the type of the item that they can build. This greatly decreases the number of repeated lines in the library's implementation, and makes creating DSL builders for new drawer items much shorter - for drawer items that don't introduce new properties, the builders are one liners now.

    To replace your old code that relied on the aforementioned build method, you can use the generic createItem method instead (see here). To see an example of this upgrade, you can look at this commit, specifically the CustomPrimaryDrawerItemKt or the OverflowMenuDrawerItemKt class.

    Version updates

    As always, this update has some version bumps to the latest versions of various dependencies.

    • Base library version updated to 6.0.3 (see the release notes there to see what's new)
    • Kotlin version updated to 1.2.21
    • Support library updated to 27.0.2
    • Gradle plugin updated to 3.0.1

    Other improvements

    Source code(tar.gz)
    Source code(zip)
  • 1.2.2(Nov 18, 2017)

  • 1.2.1(Nov 4, 2017)

  • 1.2.0(Oct 31, 2017)

    ๐ŸŽƒ Spooky Halloween update ๐Ÿ‘ป

    This release includes many version updates following up on Google's recent wave of releases as well as the new major version of the base library.

    Important changes:

    • The support libraries used by the library are now included as implementation details thanks to the new Gradle plugin, so you have to provide the necessary libraries yourself separately (see the README for details).
    • API change: the positionBasedStateManagement of DrawerBuilderKt is now a deprecated no-op. The underlying FastAdapter class no longer has this option, so any calls to this should just be removed.

    Boring changes:

    • Sample app updated to use new library version as well as new Iconics packages

    New versions of stuff in no particular order:

    • Kotlin version 1.1.51
    • Build tools 27.0.0
    • Compile SDK 27
    • Target SDK 27
    • Support library 27.0.0
    • Gradle plugin 3.0.0
    • Gradle wrapper 4.1
    • MaterialDrawer (base library) 6.0.0
    Source code(tar.gz)
    Source code(zip)
  • 1.1.1(Sep 6, 2017)

  • 1.1.0(Aug 25, 2017)

  • 1.0.6(Jul 30, 2017)

  • 1.0.5(Jul 2, 2017)

  • 1.0.4(Jun 18, 2017)

  • 1.0.3(Jun 13, 2017)

  • 1.0.2(May 20, 2017)

  • 1.0.1(May 10, 2017)

Owner
Mรกrton Braun
Android Developer Advocate @GetStream, GDE for Kotlin & Android, Android Tech Editor @raywenderlich, Instructor @bmeaut.
Mรกrton Braun
A lightweight Kotlin friendly wrapper around Couchbase lite for Android.

CouchBaseKtx ?? Work In-Progress ?? A lightweight Kotlin friendly wrapper around Couchbase-lite for Android Read up a little bit of documentation abou

Jaya Surya Thotapalli 5 Feb 15, 2022
SavedStateFlow - A Kotlin StateFlow wrapper around SavedStateHandle

SavedStateFlow SavedStateFlow is a Kotlin StateFlow wrapper around SavedStateHan

Andrew Steinmetz 13 Aug 4, 2022
Kotlin-client-dsl - A kotlin-based dsl project for a (Client) -> (Plugin) styled program

kotlin-client-dsl a kotlin-based dsl project for a (Client) -> (Plugin) styled p

jackson 3 Dec 10, 2022
Create an application with Kotlin/JVM and Kotlin/JS, and explore features around code sharing, serialization, server- and client

Practical Kotlin Multiplatform on the Web ๋ณธ ์ €์žฅ์†Œ๋Š” ์ฝ”ํ‹€๋ฆฐ ๋ฉ€ํ‹ฐํ”Œ๋žซํผ ๊ธฐ๋ฐ˜ ์›น ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์›Œํฌ์ˆ(๊ฐ•์ขŒ)์„ ์œ„ํ•ด ์ž‘์„ฑ๋œ ํ…œํ”Œ๋ฆฟ ํ”„๋กœ์ ํŠธ๊ฐ€ ์žˆ๋Š” ๊ณณ์ž…๋‹ˆ๋‹ค. ์›Œํฌ์ˆ ๊ณผ์ •์—์„œ ์ฝ”ํ‹€๋ฆฐ ๋ฉ€ํ‹ฐํ”Œ๋žซํผ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ํ”„๋ก ํŠธ์—”๋“œ(front-end)๋Š” Ko

SpringRunner 14 Nov 5, 2022
Create an application with Kotlin/JVM and Kotlin/JS, and explore features around code sharing, serialization, server- and client

Building a Full Stack Web App with Kotlin Multiplatform ๋ณธ ์ €์žฅ์†Œ๋Š” INFCON 2022์—์„œ ์ฝ”ํ‹€๋ฆฐ ๋ฉ€ํ‹ฐํ”Œ๋žซํผ ๊ธฐ๋ฐ˜ ์›น ํ”„๋กœ๊ทธ๋ž˜๋ฐ ํ•ธ์ฆˆ์˜จ๋žฉ์„ ์œ„ํ•ด ์ž‘์„ฑ๋œ ํ…œํ”Œ๋ฆฟ ํ”„๋กœ์ ํŠธ๊ฐ€ ์žˆ๋Š” ๊ณณ์ž…๋‹ˆ๋‹ค. ํ•ธ์ฆˆ์˜จ ๊ณผ์ •์—์„œ ์ฝ”ํ‹€๋ฆฐ ๋ฉ€ํ‹ฐํ”Œ๋žซํผ์„

Arawn Park 19 Sep 8, 2022
A Lightweight PDF Viewer Android library which only occupies around 125kb while most of the Pdf viewer occupies up to 16MB space.

Pdf Viewer For Android A Simple PDF Viewer library which only occupies around 125kb while most of the Pdf viewer occupies upto 16MB space. How to inte

Rajat 362 Dec 29, 2022
A simple Kotlin multi-platform abstraction around the javax.inject annotations.

Inject A simple Kotlin multi-platform abstraction around the javax.inject annotations. This allows using the annotations in Kotlin common code so that

Christopher 43 Aug 17, 2022
Small Kafka Playground to play around with Test Containers, and KotlinX Coroutines bindings while reading Kafka Definite Guide V2

KafkaPlayground Small playground where I'm playing around with Kafka in Kotlin and the Kafka SDK whilst reading the Kafka book Definite Guide from Con

Simon Vergauwen 34 Dec 30, 2022
Develop an API that moves a rover around on a grid

Mars Rover Kata Develop an API that moves a rover around on a grid. Rules: You are given the initial starting 2D point (x,y) of a rover and the direct

Alvaro Martin Rodriguez 1 Dec 17, 2021
DocuBox is a cloud based file storing app where you can securely store and access your documents from anywhere around the world

DocuBox is an android app ??in which you can securely upload your files on the cloudโ€“ from family pictures and audio recordings to spreadsheets, presentations and other confidential documents.

Vaibhav Jaiswal 26 Jan 3, 2023
The most complete and powerful data-binding library and persistence infra for Kotlin 1.3, Android & Splitties Views DSL, JavaFX & TornadoFX, JSON, JDBC & SQLite, SharedPreferences.

Lychee (ex. reactive-properties) Lychee is a library to rule all the data. ToC Approach to declaring data Properties Other data-binding libraries Prop

Mike 112 Dec 9, 2022
Lightweight Kotlin DSL dependency injection library

Warehouse DSL Warehouse is a lightweight Kotlin DSL dependency injection library this library has an extremely faster learning curve and more human fr

Osama Raddad 18 Jul 17, 2022
Kotlin parser library with an easy-to-use DSL

Pratt Library for parsing expressions and a beautiful Kotlin DSL Just define your operators and operands with the Kotlin DSL and the parser is ready!

furetur 9 Oct 17, 2022
A light weight Compose Animation library to choreograph low level Animation API through Kotlin DSL.

Koreography Choreograph your Compose Animation ?? ?? A lightweight Compose Animation utility library to choreograph low-level Animation API (https://d

Sagar Viradiya 107 Jan 8, 2023
Android + Kotlin + Github Actions + ktlint + Detekt + Gradle Kotlin DSL + buildSrc = โค๏ธ

kotlin-android-template ?? A simple Github template that lets you create an Android/Kotlin project and be up and running in a few seconds. This templa

Nicola Corti 1.5k Jan 3, 2023
๐Ÿ”“ Kotlin version of the popular google/easypermissions wrapper library to simplify basic system permissions logic on Android M or higher.

EasyPermissions-ktx Kotlin version of the popular googlesample/easypermissions wrapper library to simplify basic system permissions logic on Android M

Madalin Valceleanu 326 Dec 23, 2022
Android AsyncTask wrapper library, written in Kotlin

KillerTask This is a Kotlin Android library to create async background tasks. Inspired by TinyTask, but more beautiful and easy to use for Kotlin Andr

Inaka 26 Oct 3, 2022
{ } Declarative Kotlin DSL for choreographing Android transitions

Transition X Kotlin DSL for choreographing Android Transitions TransitionManager makes it easy to animate simple changes to layout without needing to

Arunkumar 520 Dec 16, 2022
Kotlin Dsl for Android RecyclerView

KRecyclerDsl Kotlin Dsl for Android RecyclerView Exemple Sample project recyclerView.adapter = dataClassAdapter<MyView, MyDataClass>(R.layout.my_view,

Thomas Girard 14 Mar 31, 2019