All Projects → heinrichreimer → Material Drawer

heinrichreimer / Material Drawer

Licence: mit
Custom drawer implementation for Material design apps.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Material Drawer

Material Intro
A simple material design app intro with cool animations and a fluent API.
Stars: ✭ 1,718 (+181.18%)
Mutual labels:  jitpack, material-design, material-components
Quasar
Quasar Framework - Build high-performance VueJS user interfaces in record time
Stars: ✭ 20,090 (+3188.05%)
Mutual labels:  material-design, material-components
Android Issue Reporter
A powerful and simple library to open issues on GitHub directly from your app.
Stars: ✭ 115 (-81.18%)
Mutual labels:  jitpack, material-design
Svelte Materialify
A Material UI Design Component library for Svelte heavily inspired by vuetify.
Stars: ✭ 351 (-42.55%)
Mutual labels:  material-design, material-components
Materialbanner
A library that provides an implementation of the banner widget from the Material design.
Stars: ✭ 241 (-60.56%)
Mutual labels:  material-design, material-components
Material Components Web
Modular and customizable Material Design UI components for the web
Stars: ✭ 15,931 (+2507.36%)
Mutual labels:  material-design, material-components
Taptargetview
An implementation of tap targets from the Material Design guidelines for feature discovery.
Stars: ✭ 5,114 (+736.99%)
Mutual labels:  material-design, material-components
React Md
React material design - An accessible React component library built from the Material Design guidelines in Sass
Stars: ✭ 2,284 (+273.81%)
Mutual labels:  material-design, material-components
Material Components Ios
[In maintenance mode] Modular and customizable Material Design UI components for iOS
Stars: ✭ 4,484 (+633.88%)
Mutual labels:  material-design, material-components
Material Viewpagerindicator
Dot-based Android ViewPager indicator with Material Design animations.
Stars: ✭ 511 (-16.37%)
Mutual labels:  jitpack, material-design
Android Iconics
Android-Iconics - Use any icon font, or vector (.svg) as drawable in your application.
Stars: ✭ 4,916 (+704.58%)
Mutual labels:  material-design, material-components
Material Backdrop
A simple solution for implementing Backdrop pattern for Android
Stars: ✭ 221 (-63.83%)
Mutual labels:  material-design, material-components
Material Admin
Free Material Admin Template
Stars: ✭ 219 (-64.16%)
Mutual labels:  material-design, material-components
Bottomsheet
BottomSheet dialog library for Android
Stars: ✭ 219 (-64.16%)
Mutual labels:  material-design, material-components
Angular Mdc Web
Angular wrapper for Material Design (Web) Components
Stars: ✭ 542 (-11.29%)
Mutual labels:  material-design, material-components
Elm Mdc
Elm port of the Material Components for the Web CSS/JS library
Stars: ✭ 338 (-44.68%)
Mutual labels:  material-design, material-components
Material Components Android
Modular and customizable Material Design UI components for Android
Stars: ✭ 13,128 (+2048.61%)
Mutual labels:  material-design, material-components
React Material Components Web
React wrapper of Google's Material Components Web
Stars: ✭ 184 (-69.89%)
Mutual labels:  material-design, material-components
Android Mdc Theming
Sample code used for a series of Medium posts on Material Components for Android
Stars: ✭ 388 (-36.5%)
Mutual labels:  material-design, material-components
Light
🍭 The usual Snackbar, but elegant
Stars: ✭ 542 (-11.29%)
Mutual labels:  material-design, material-components

Icon

material-drawer

Android Arsenal JitPack Build Status License

Custom drawer implementation for Material design apps.

Demo

A demo app is available on Google Play:

Get it on Google Play

Screenshots

material-drawer material-drawer material-drawer
Fixed items Select profile Custom theme

Dependency

material-drawer is available on jitpack.io

Gradle dependency:

repositories {
    // ...
    maven { url 'https://jitpack.io' }
}
dependencies {
    compile 'com.heinrichreimersoftware:material-drawer:2.3.3'
}

Get the latest dependency at jitpack.io.

How-To-Use

Step 1: Let your Activity extend DrawerActivity:

public class MainActivity extends DrawerActivity {}

Step 2: Set your content:

setContentView(R.layout.activity_main);

Step 3: Add a profile:

addProfile(
        new DrawerProfile()
                .setRoundedAvatar((BitmapDrawable)getResources().getDrawable(R.drawable.profile_avatar))
                .setBackground(getResources().getDrawable(R.drawable.profile_cover))
                .setName(getString(R.string.profile_name))
                .setDescription(getString(R.string.profile_description))
                .setOnProfileClickListener(new DrawerProfile.OnProfileClickListener() {
                    @Override
                    public void onClick(DrawerProfile drawerProfile, long id) {
                        Toast.makeText(MainActivity.this, "Clicked profile #" + id, Toast.LENGTH_SHORT).show();
                    }
                })
        );

Step 4: Populate your drawer list:

addItem(
        new DrawerItem()
                .setImage(getResources().getDrawable(R.drawable.ic_first_item))
                .setTextPrimary(getString(R.string.title_first_item))
                .setTextSecondary(getString(R.string.description_first_item))
                .setOnItemClickListener(new DrawerItem.OnItemClickListener() {
                    @Override
                    public void onClick(DrawerItem drawerItem, long id, int position) {
                        Toast.makeText(MainActivity.this, "Clicked first item #" + id, Toast.LENGTH_SHORT).show();
                    }
                })
        );
addDivider();
addItem(
        new DrawerItem()
                .setImage(getResources().getDrawable(R.drawable.ic_second_item))
                .setTextPrimary(getString(R.string.title_second_item))
                .setOnItemClickListener(new DrawerItem.OnItemClickListener() {
                    @Override
                    public void onClick(DrawerItem drawerItem, long id, int position) {
                        Toast.makeText(MainActivity.this, "Clicked second item #" + id, Toast.LENGTH_SHORT).show();
                    }
                })
        );

Step 5: Add actionBarStyle to your theme:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="colorPrimary">@color/color_primary</item>
    <item name="colorPrimaryDark">@color/color_primary_dark</item>
    <item name="colorAccent">@color/color_accent</item>
    <item name="actionBarStyle">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
</style>

Step 6 (Optional): Change the drawer theme:

The drawer gets themed based on your selected app theme but you can also modify it.

setDrawerTheme(
        new DrawerTheme(this)
                .setBackgroundColorRes(R.color.background)
                .setTextColorPrimaryRes(R.color.primary_text)
                .setTextColorSecondaryRes(R.color.secondary_text)
                .setTextColorPrimaryInverseRes(R.color.primary_text_inverse)
                .setTextColorSecondaryInverseRes(R.color.secondary_text_inverse)
                .setHighlightColorRes(R.color.highlight)
);

Step 7 (Optional): Set your own Toolbar:

You can set your own Toolbar as you do with ActionBarActivity.

setSupportActionBar(toolbar);

Pro Tip: Lollipop status bar

Step 1: Make your status bar transparent:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowDrawsSystemBarBackgrounds">true</item>
    <item name="android:statusBarColor">@android:color/transparent</item>
</style>

That's it! material-drawer takes care of the rest.

Info: DrawerFrameLayout & DrawerView

Of course you can use DrawerFrameLayout and DrawerView alone too. See the comments in the Java files for further information.

Open source libraries

material-drawer uses the following open source libraries or files:

License

Copyright 2015 Heinrich Reimer

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].