GithubHelp home page GithubHelp logo

aaaliua / advancedmaterialdrawer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from madcyph3r/advancedmaterialdrawer

0.0 2.0 0.0 12.24 MB

A Material Drawer implementation (Like gMail App)

License: Apache License 2.0

Java 100.00%

advancedmaterialdrawer's Introduction

AdvancedMaterialDrawer

Android Arsenal

A Material Drawer implementation (Like gMail App)

Based on neokree MaterialDrawer (https://github.com/neokree/MaterialNavigationDrawer). Big thanks to neokree, without him this library would not be possible.

API

API

Different from neokree MaterialDrawer and some features

  • Unlimit Head-Items (Accounts), (see first screenshot, it has 5 Head-Items)
  • Every Head-Item can has his own menu
  • Head-Item listener for avatar or background click
  • Add and remove Head-Items at runtime
  • Themeing
  • Labels
  • Normal Sections (with Fragment/Activty start or own onClick listener)
  • Bottom-Sections (see second screenshot)
  • and many other things, like set your own fragment on start and so on

Example APK (Lib-Version 1.0.5)

https://github.com/madcyph3r/AdvancedMaterialDrawer/raw/master/example-release.apk

How to import (my own repo)

repositories {
    maven {
            url "http://dl.bintray.com/madcyph3r/maven/"
        }
}

dependencies {
    compile(group: 'de.madcyph3r', name: 'materialDrawer', version: '1.0.5', ext: 'aar')
}

Usage

See the example apk and the example code. It has 24 examples with explanations, how to use the library. It's really not difficult. But here is a small example, with one Head-Item. It looks like screenshot three, only in black color.

public class OneHeadItem extends MaterialNavigationDrawer {

    MaterialNavigationDrawer drawer = null;

    @Override
    public int headerType() {
        // set type. you get the available constant from MaterialNavigationDrawer class
        return MaterialNavigationDrawer.DRAWERHEADER_HEADITEMS;
    }

    // called from onCreate(), make your view init here or in your fragment.
    @Override
    public void init(Bundle savedInstanceState) {

        drawer = this;

        MaterialMenu menu = new MaterialMenu();

        // first section is loaded
        MaterialSection section1 = this.newSection("Section 1", this.getResources().getDrawable(R.drawable.ic_favorite_black_36dp), new FragmentIndex(), false, menu);
        MaterialSection section2 = this.newSection("Section 2", this.getResources().getDrawable(R.drawable.ic_list_black_36dp), new FragmentIndex(), false, menu);

        // use bitmap and make a circle photo
        final Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.app_drawer_icon);
        final RoundedCornersDrawable drawableAppIcon = new RoundedCornersDrawable(getResources(), bitmap);

        // create Head Item
        MaterialHeadItem headItem = new MaterialHeadItem(this, "F HeadItem", "F Subtitle", drawableAppIcon, R.drawable.mat5, menu, 0);

        // add head Item (menu will be loaded automatically)
        this.addHeadItem(headItem);
    }
}

Others

  • If you found an issues, then open a ticket.
  • If you like the library, press the star ;)
  • A Wiki with small intruductions will come

Screenshots

screenshot

screenshot

screenshot

screenshot

screenshot

screenshot

advancedmaterialdrawer's People

Contributors

madcyph3r avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.