Android 侧滑显示控件 MaterialDrawer

码农软件 · 软件分类 · Android UI 组件 · 2019-04-25 10:12:45

软件介绍

MaterialDrawer 是一个类似 Google 官方 NavigationView 侧滑显示控件, 个人认为 NavigationView 并没有 MaterialDrawer 实用, 因为 NavigationView 自由度不是很好, 很多都写死了不可以自由定义布局, 而 MaterialDrawer 能够实现跟 NavigationView 一样的效果, 同时还支持自定义效果, 自由度非常高。

效果图:

Image

Image

使用示例

//if you want to update the items at a later time it is recommended to keep it in a variablePrimaryDrawerItem item1 = new PrimaryDrawerItem().withName(R.string.drawer_item_home);SecondaryDrawerItem item2 = new SecondaryDrawerItem().withName(R.string.drawer_item_settings);//create the drawer and remember the `Drawer` result objectDrawer result = new DrawerBuilder()
    .withActivity(this)
    .withToolbar(toolbar)
    .addDrawerItems(
        item1,        new DividerDrawerItem(),
        item2,        new SecondaryDrawerItem().withName(R.string.drawer_item_settings)
    )
    .withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() {        @Override
        public boolean onItemClick(View view, int position, IDrawerItem drawerItem) {            // do something with the clicked item :D
        }
    })
    .build();

本文地址:https://codercto.com/soft/d/4341.html

图形程序开发人员指南

图形程序开发人员指南

Michael Abrash / 前导工作室 / 机械工业出版社 / 1998 / 128

Michael Abrash's classic Graphics Programming Black Book is a compilation of Michael's previous writings on assembly language and graphics programming (including from his "Graphics Programming" column......一起来看看 《图形程序开发人员指南》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具