├── LICENSE ├── MaterialNavigationDrawer ├── .gitignore ├── build.gradle ├── demo │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── it │ │ │ └── neokree │ │ │ └── example │ │ │ ├── MainActivity.java │ │ │ ├── backpattern │ │ │ ├── BackAnywhere.java │ │ │ ├── BackPatternCustom.java │ │ │ └── BackToFirst.java │ │ │ ├── dark │ │ │ ├── Accounts.java │ │ │ ├── CustomDrawerHeader.java │ │ │ ├── ImageDrawerHeader.java │ │ │ ├── MockedAccount.java │ │ │ └── NoDrawerHeader.java │ │ │ ├── functionalities │ │ │ ├── CustomAccountSection.java │ │ │ ├── KitkatStatusBar.java │ │ │ ├── MultiPane.java │ │ │ ├── RealColorSections.java │ │ │ ├── RippleBackport.java │ │ │ ├── UniqueToolbarColor.java │ │ │ └── master_child │ │ │ │ ├── ChildFragment.java │ │ │ │ ├── MasterChildActivity.java │ │ │ │ └── MasterFragment.java │ │ │ ├── light │ │ │ ├── Accounts.java │ │ │ ├── CustomDrawerHeader.java │ │ │ ├── ImageDrawerHeader.java │ │ │ ├── MockedAccount.java │ │ │ └── NoDrawerHeader.java │ │ │ ├── mockedActivity │ │ │ ├── Profile.java │ │ │ └── Settings.java │ │ │ ├── mockedFragments │ │ │ ├── FragmentButton.java │ │ │ ├── FragmentIndex.java │ │ │ └── FragmentList.java │ │ │ └── test │ │ │ ├── Test.java │ │ │ ├── TestFragment.java │ │ │ └── TestFragment2.java │ │ └── res │ │ ├── drawable-hdpi │ │ ├── ic_arrow_back_white_24dp.png │ │ ├── ic_hotel_grey600_24dp.png │ │ ├── ic_launcher.png │ │ ├── ic_mic_white_24dp.png │ │ └── ic_settings_black_24dp.png │ │ ├── drawable-mdpi │ │ ├── ic_arrow_back_white_24dp.png │ │ ├── ic_hotel_grey600_24dp.png │ │ ├── ic_launcher.png │ │ ├── ic_mic_white_24dp.png │ │ └── ic_settings_black_24dp.png │ │ ├── drawable-xhdpi │ │ ├── ic_arrow_back_white_24dp.png │ │ ├── ic_hotel_grey600_24dp.png │ │ ├── ic_launcher.png │ │ ├── ic_mic_white_24dp.png │ │ └── ic_settings_black_24dp.png │ │ ├── drawable-xxhdpi │ │ ├── ic_arrow_back_white_24dp.png │ │ ├── ic_hotel_grey600_24dp.png │ │ ├── ic_launcher.png │ │ ├── ic_mic_white_24dp.png │ │ └── ic_settings_black_24dp.png │ │ ├── drawable-xxxhdpi │ │ └── ic_arrow_back_white_24dp.png │ │ ├── drawable │ │ ├── bamboo.jpg │ │ ├── mat2.jpg │ │ ├── mat3.jpg │ │ ├── photo.jpg │ │ └── photo2.jpg │ │ ├── layout │ │ ├── custom_drawer.xml │ │ ├── masterchild_child.xml │ │ ├── masterchild_master.xml │ │ ├── profile.xml │ │ ├── settings.xml │ │ └── test_fragment_click.xml │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── library │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ └── fonts │ │ │ ├── Roboto-Medium.ttf │ │ │ └── Roboto-Regular.ttf │ │ ├── java │ │ └── it │ │ │ └── neokree │ │ │ └── materialnavigationdrawer │ │ │ ├── MaterialNavigationDrawer.java │ │ │ ├── elements │ │ │ ├── MaterialAccount.java │ │ │ ├── MaterialSection.java │ │ │ ├── MaterialSubheader.java │ │ │ └── listeners │ │ │ │ ├── MaterialAccountListener.java │ │ │ │ └── MaterialSectionListener.java │ │ │ └── util │ │ │ ├── MaterialActionBarDrawerToggle.java │ │ │ ├── MaterialDrawerLayout.java │ │ │ ├── TypefaceManager.java │ │ │ └── Utils.java │ │ └── res │ │ ├── drawable-hdpi │ │ ├── ic_arrow_drop_down_white_24dp.png │ │ └── ic_arrow_drop_up_white_24dp.png │ │ ├── drawable-mdpi │ │ ├── ic_arrow_drop_down_white_24dp.png │ │ └── ic_arrow_drop_up_white_24dp.png │ │ ├── drawable-xhdpi │ │ ├── ic_arrow_drop_down_white_24dp.png │ │ └── ic_arrow_drop_up_white_24dp.png │ │ ├── drawable-xxhdpi │ │ ├── ic_arrow_drop_down_white_24dp.png │ │ └── ic_arrow_drop_up_white_24dp.png │ │ ├── drawable-xxxhdpi │ │ ├── ic_arrow_drop_down_white_24dp.png │ │ └── ic_arrow_drop_up_white_24dp.png │ │ ├── drawable │ │ └── black_gradient.xml │ │ ├── layout │ │ ├── activity_google_navigation_drawer.xml │ │ ├── activity_material_navigation_drawer.xml │ │ ├── activity_material_navigation_drawer_customheader.xml │ │ ├── layout_drawer.xml │ │ ├── layout_drawer_customheader.xml │ │ ├── layout_material_section.xml │ │ ├── layout_material_section_icon.xml │ │ ├── layout_material_section_icon_large.xml │ │ ├── layout_material_section_icon_large_ripple.xml │ │ ├── layout_material_section_icon_ripple.xml │ │ └── layout_material_section_ripple.xml │ │ ├── values-v19 │ │ ├── dimens.xml │ │ └── themes.xml │ │ ├── values-v21 │ │ ├── dimens.xml │ │ └── themes.xml │ │ └── values │ │ ├── dimens.xml │ │ ├── integers.xml │ │ ├── strings.xml │ │ ├── styles.xml │ │ └── themes.xml └── settings.gradle ├── README.md ├── art ├── accountChangeButton.jpg ├── screen1.jpg ├── screen2.jpg ├── screen3.jpg ├── screen4.jpg ├── screen5.jpg ├── screen6.jpg ├── screen7.jpg ├── screen8.jpg └── section1.jpg └── example.apk /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | .DS_Store 5 | /build 6 | # built application files 7 | *.apk 8 | *.ap_ 9 | 10 | # files for the dex VM 11 | *.dex 12 | 13 | # Java class files 14 | *.class 15 | .DS_Store 16 | 17 | # generated files 18 | bin/ 19 | gen/ 20 | Wiki/ 21 | 22 | # Local configuration file (sdk path, etc) 23 | local.properties 24 | 25 | # Eclipse project files 26 | .classpath 27 | .project 28 | .settings/ 29 | 30 | # Proguard folder generated by Eclipse 31 | proguard/ 32 | 33 | #Android Studio 34 | build/ 35 | 36 | # Intellij project files 37 | *.iml 38 | *.ipr 39 | *.iws 40 | .idea/ 41 | 42 | #gradle 43 | .gradle/ -------------------------------------------------------------------------------- /MaterialNavigationDrawer/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.0.0' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | jcenter() 18 | maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 21 5 | buildToolsVersion "21.1.2" 6 | defaultConfig { 7 | applicationId "it.neokree.materialnavigationdrawer" 8 | minSdkVersion 10 9 | targetSdkVersion 21 10 | versionCode 1 11 | versionName '1.0' 12 | } 13 | buildTypes { 14 | release { 15 | //runProguard false 16 | //proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | productFlavors { 20 | } 21 | } 22 | 23 | dependencies { 24 | compile 'com.android.support:appcompat-v7:21.0.3' 25 | compile project(':library') 26 | } 27 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Applications/adt-bundle/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example; 2 | 3 | import android.app.ListActivity; 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | import android.widget.AdapterView; 8 | import android.widget.ArrayAdapter; 9 | 10 | import java.util.ArrayList; 11 | 12 | import it.neokree.example.backpattern.BackAnywhere; 13 | import it.neokree.example.backpattern.BackPatternCustom; 14 | import it.neokree.example.backpattern.BackToFirst; 15 | import it.neokree.example.functionalities.CustomAccountSection; 16 | import it.neokree.example.functionalities.KitkatStatusBar; 17 | import it.neokree.example.functionalities.MultiPane; 18 | import it.neokree.example.functionalities.RealColorSections; 19 | import it.neokree.example.functionalities.RippleBackport; 20 | import it.neokree.example.functionalities.UniqueToolbarColor; 21 | import it.neokree.example.functionalities.master_child.MasterChildActivity; 22 | import it.neokree.example.light.Accounts; 23 | import it.neokree.example.light.CustomDrawerHeader; 24 | import it.neokree.example.light.ImageDrawerHeader; 25 | import it.neokree.example.light.MockedAccount; 26 | import it.neokree.example.light.NoDrawerHeader; 27 | import it.neokree.example.test.Test; 28 | 29 | /** 30 | * Created by neokree on 30/12/14. 31 | */ 32 | public class MainActivity extends ListActivity implements AdapterView.OnItemClickListener { 33 | 34 | @Override 35 | protected void onCreate(Bundle savedInstanceState) { 36 | super.onCreate(savedInstanceState); 37 | ArrayList list = new ArrayList(); 38 | 39 | list.add("Light - Mocked Account"); 40 | list.add("Dark - Mocked Account"); 41 | 42 | list.add("Light - Accounts"); 43 | list.add("Dark - Accounts"); 44 | 45 | list.add("Light - Drawer Header Image"); 46 | list.add("Dark - Drawer Header Image"); 47 | 48 | list.add("Light - No Drawer Header"); 49 | list.add("Dark - No Drawer Header"); 50 | 51 | list.add("Light - Custom Drawer Header"); 52 | list.add("Dark - Custom Drawer Header"); 53 | 54 | list.add("Functionality: unique Toolbar Color"); 55 | list.add("Functionality: ripple backport support"); 56 | list.add("Functionality: multi pane support for tablet"); 57 | list.add("Functionality: custom section under account list"); 58 | list.add("Functionality: Kitkat trasluncent status bar"); 59 | list.add("Functionality: Master/Child example"); 60 | list.add("Functionality: section not pre-rendered"); 61 | 62 | list.add("Back Pattern: Back To first"); 63 | list.add("Back Pattern: Back Anywhere"); 64 | list.add("Back Pattern: Custom"); 65 | 66 | //list.add("Test"); 67 | 68 | this.setListAdapter(new ArrayAdapter<>(this,android.R.layout.simple_list_item_1,list)); 69 | this.getListView().setOnItemClickListener(this); 70 | } 71 | 72 | @Override 73 | public void onItemClick(AdapterView parent, View view, int position, long id) { 74 | Intent intent; 75 | switch(position) { 76 | case 0: 77 | intent = new Intent(this,MockedAccount.class); 78 | break; 79 | case 1: 80 | intent = new Intent(this, it.neokree.example.dark.MockedAccount.class); 81 | break; 82 | case 2: 83 | intent = new Intent(this,Accounts.class); 84 | break; 85 | case 3: 86 | intent = new Intent(this, it.neokree.example.dark.Accounts.class); 87 | break; 88 | case 4: 89 | intent = new Intent(this,ImageDrawerHeader.class); 90 | break; 91 | case 5: 92 | intent = new Intent(this, it.neokree.example.dark.ImageDrawerHeader.class); 93 | break; 94 | case 6: 95 | intent = new Intent(this,NoDrawerHeader.class); 96 | break; 97 | case 7: 98 | intent = new Intent(this, it.neokree.example.dark.NoDrawerHeader.class); 99 | break; 100 | case 8: 101 | intent = new Intent(this, CustomDrawerHeader.class); 102 | break; 103 | case 9: 104 | intent = new Intent(this, it.neokree.example.dark.CustomDrawerHeader.class); 105 | break; 106 | case 10: 107 | intent = new Intent(this, UniqueToolbarColor.class); 108 | break; 109 | case 11: 110 | intent = new Intent(this, RippleBackport.class); 111 | break; 112 | case 12: 113 | intent = new Intent(this, MultiPane.class); 114 | break; 115 | case 13: 116 | intent = new Intent(this, CustomAccountSection.class); 117 | break; 118 | case 14: 119 | intent = new Intent(this, KitkatStatusBar.class); 120 | break; 121 | case 15: 122 | intent = new Intent(this, MasterChildActivity.class); 123 | break; 124 | case 16: 125 | intent = new Intent(this, RealColorSections.class); 126 | break; 127 | case 17: 128 | intent = new Intent(this, BackToFirst.class); 129 | break; 130 | case 18: 131 | intent = new Intent(this, BackAnywhere.class); 132 | break; 133 | case 19: 134 | intent = new Intent(this, BackPatternCustom.class); 135 | break; 136 | case 20: 137 | intent = new Intent(this, Test.class); 138 | break; 139 | default: 140 | intent = null; 141 | } 142 | startActivity(intent); 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/backpattern/BackAnywhere.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.backpattern; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Color; 5 | import android.os.Bundle; 6 | 7 | import it.neokree.example.R; 8 | import it.neokree.example.mockedActivity.Settings; 9 | import it.neokree.example.mockedFragments.FragmentButton; 10 | import it.neokree.example.mockedFragments.FragmentIndex; 11 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 12 | 13 | /** 14 | * Created by neokree on 14/02/15. 15 | */ 16 | public class BackAnywhere extends MaterialNavigationDrawer { 17 | 18 | @Override 19 | public void init(Bundle savedInstanceState) { 20 | this.addSection(newSection("Section 1", new FragmentIndex())); 21 | this.addSection(newSection("Section 2",new FragmentIndex())); 22 | this.addSection(newSection("Section 3", R.drawable.ic_mic_white_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#9c27b0"))); 23 | this.addSection(newSection("Section",R.drawable.ic_hotel_grey600_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#03a9f4"))); 24 | 25 | // create bottom section 26 | this.addBottomSection(newSection("Bottom Section",R.drawable.ic_settings_black_24dp,new Intent(this,Settings.class))); 27 | 28 | // add pattern 29 | this.setBackPattern(MaterialNavigationDrawer.BACKPATTERN_BACK_ANYWHERE); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/backpattern/BackPatternCustom.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.backpattern; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Color; 5 | import android.os.Bundle; 6 | 7 | import it.neokree.example.R; 8 | import it.neokree.example.mockedActivity.Settings; 9 | import it.neokree.example.mockedFragments.FragmentButton; 10 | import it.neokree.example.mockedFragments.FragmentIndex; 11 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 12 | import it.neokree.materialnavigationdrawer.elements.MaterialSection; 13 | 14 | /** 15 | * Created by neokree on 14/02/15. 16 | */ 17 | public class BackPatternCustom extends MaterialNavigationDrawer { 18 | 19 | @Override 20 | public void init(Bundle savedInstanceState) { 21 | this.addSection(newSection("Section 1", new FragmentIndex())); 22 | this.addSection(newSection("Section 2",new FragmentIndex())); 23 | this.addSection(newSection("Section 3", R.drawable.ic_mic_white_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#9c27b0"))); 24 | this.addSection(newSection("Section",R.drawable.ic_hotel_grey600_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#03a9f4"))); 25 | 26 | // create bottom section 27 | this.addBottomSection(newSection("Bottom Section",R.drawable.ic_settings_black_24dp,new Intent(this,Settings.class))); 28 | 29 | // add pattern 30 | this.setBackPattern(MaterialNavigationDrawer.BACKPATTERN_CUSTOM); 31 | } 32 | 33 | @Override 34 | protected MaterialSection backToSection(MaterialSection currentSection) { 35 | MaterialSection section; 36 | switch(currentSection.getPosition()) { 37 | case 3: 38 | section =this.getSectionAtCurrentPosition(2); 39 | this.changeToolbarColor(section); // remember to change the toolbar color 40 | break; 41 | case 2: 42 | section = this.getSectionAtCurrentPosition(1); 43 | this.changeToolbarColor(section); // remember to change the toolbar color 44 | break; 45 | case 1: 46 | section = this.getSectionAtCurrentPosition(0); 47 | this.changeToolbarColor(section); // remember to change the toolbar color 48 | break; 49 | default: 50 | section = super.backToSection(currentSection); // exit from activity 51 | break; 52 | } 53 | 54 | return section; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/backpattern/BackToFirst.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.backpattern; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Color; 5 | import android.os.Bundle; 6 | 7 | import it.neokree.example.R; 8 | import it.neokree.example.mockedActivity.Settings; 9 | import it.neokree.example.mockedFragments.FragmentButton; 10 | import it.neokree.example.mockedFragments.FragmentIndex; 11 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 12 | 13 | /** 14 | * Created by neokree on 14/02/15. 15 | */ 16 | public class BackToFirst extends MaterialNavigationDrawer { 17 | 18 | @Override 19 | public void init(Bundle savedInstanceState) { 20 | this.addSection(newSection("Section 1", new FragmentIndex())); 21 | this.addSection(newSection("Section 2",new FragmentIndex())); 22 | this.addSection(newSection("Section 3", R.drawable.ic_mic_white_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#9c27b0"))); 23 | this.addSection(newSection("Section",R.drawable.ic_hotel_grey600_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#03a9f4"))); 24 | 25 | // create bottom section 26 | this.addBottomSection(newSection("Bottom Section",R.drawable.ic_settings_black_24dp,new Intent(this,Settings.class))); 27 | 28 | // add pattern 29 | this.setBackPattern(MaterialNavigationDrawer.BACKPATTERN_BACK_TO_FIRST); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/dark/Accounts.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.dark; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Color; 5 | import android.os.Bundle; 6 | 7 | import it.neokree.example.R; 8 | import it.neokree.example.mockedActivity.Settings; 9 | import it.neokree.example.mockedFragments.FragmentButton; 10 | import it.neokree.example.mockedFragments.FragmentIndex; 11 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 12 | import it.neokree.materialnavigationdrawer.elements.MaterialAccount; 13 | import it.neokree.materialnavigationdrawer.elements.listeners.MaterialAccountListener; 14 | 15 | /** 16 | * Created by neokree on 18/01/15. 17 | */ 18 | public class Accounts extends MaterialNavigationDrawer implements MaterialAccountListener{ 19 | 20 | @Override 21 | public void init(Bundle savedInstanceState) { 22 | 23 | // add accounts 24 | MaterialAccount account = new MaterialAccount(this.getResources(),"NeoKree","neokree@gmail.com",R.drawable.photo, R.drawable.bamboo); 25 | this.addAccount(account); 26 | 27 | MaterialAccount account2 = new MaterialAccount(this.getResources(),"Hatsune Miky","hatsune.miku@example.com",R.drawable.photo2,R.drawable.mat2); 28 | this.addAccount(account2); 29 | 30 | MaterialAccount account3 = new MaterialAccount(this.getResources(),"Example","example@example.com",R.drawable.photo,R.drawable.mat3); 31 | this.addAccount(account3); 32 | 33 | // set listener 34 | this.setAccountListener(this); 35 | 36 | // create sections 37 | this.addSection(newSection("Section 1", new FragmentIndex())); 38 | this.addSection(newSection("Section 2",new FragmentIndex())); 39 | this.addSection(newSection("Section 3",R.drawable.ic_mic_white_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#9c27b0"))); 40 | this.addSection(newSection("Section",R.drawable.ic_hotel_grey600_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#03a9f4"))); 41 | 42 | // create bottom section 43 | this.addBottomSection(newSection("Bottom Section",R.drawable.ic_settings_black_24dp,new Intent(this,Settings.class))); 44 | } 45 | 46 | @Override 47 | public void onAccountOpening(MaterialAccount account) { 48 | 49 | } 50 | 51 | @Override 52 | public void onChangeAccount(MaterialAccount newAccount) { 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/dark/CustomDrawerHeader.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.dark; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Color; 5 | import android.os.Bundle; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | 9 | import it.neokree.example.R; 10 | import it.neokree.example.mockedActivity.Settings; 11 | import it.neokree.example.mockedFragments.FragmentButton; 12 | import it.neokree.example.mockedFragments.FragmentIndex; 13 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 14 | 15 | /** 16 | * Created by neokree on 18/01/15. 17 | */ 18 | public class CustomDrawerHeader extends MaterialNavigationDrawer { 19 | @Override 20 | public void init(Bundle savedInstanceState) { 21 | 22 | // create and set the header 23 | View view = LayoutInflater.from(this).inflate(R.layout.custom_drawer,null); 24 | setDrawerHeaderCustom(view); 25 | 26 | // create sections 27 | this.addSection(newSection("Section 1", new FragmentIndex())); 28 | this.addSection(newSection("Section 2",new FragmentIndex())); 29 | this.addSection(newSection("Section 3", R.drawable.ic_mic_white_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#9c27b0"))); 30 | this.addSection(newSection("Section",R.drawable.ic_hotel_grey600_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#03a9f4"))); 31 | 32 | // create bottom section 33 | this.addBottomSection(newSection("Bottom Section",R.drawable.ic_settings_black_24dp,new Intent(this,Settings.class))); 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/dark/ImageDrawerHeader.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.dark; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Color; 5 | import android.os.Bundle; 6 | 7 | import it.neokree.example.R; 8 | import it.neokree.example.mockedActivity.Settings; 9 | import it.neokree.example.mockedFragments.FragmentButton; 10 | import it.neokree.example.mockedFragments.FragmentIndex; 11 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 12 | 13 | /** 14 | * Created by neokree on 18/01/15. 15 | */ 16 | public class ImageDrawerHeader extends MaterialNavigationDrawer { 17 | @Override 18 | public void init(Bundle savedInstanceState) { 19 | 20 | // set the header image 21 | this.setDrawerHeaderImage(R.drawable.mat2); 22 | 23 | // create sections 24 | this.addSection(newSection("Section 1", new FragmentIndex())); 25 | this.addSection(newSection("Section 2",new FragmentIndex())); 26 | this.addSection(newSection("Section 3", R.drawable.ic_mic_white_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#9c27b0"))); 27 | this.addSection(newSection("Section",R.drawable.ic_hotel_grey600_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#03a9f4"))); 28 | 29 | // create bottom section 30 | this.addBottomSection(newSection("Bottom Section",R.drawable.ic_settings_black_24dp,new Intent(this,Settings.class))); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/dark/MockedAccount.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.dark; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Color; 5 | import android.os.Bundle; 6 | 7 | import it.neokree.example.R; 8 | import it.neokree.example.mockedActivity.Settings; 9 | import it.neokree.example.mockedFragments.FragmentButton; 10 | import it.neokree.example.mockedFragments.FragmentIndex; 11 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 12 | import it.neokree.materialnavigationdrawer.elements.MaterialAccount; 13 | 14 | /** 15 | * Created by neokree on 18/01/15. 16 | */ 17 | public class MockedAccount extends MaterialNavigationDrawer { 18 | 19 | @Override 20 | public void init(Bundle savedInstanceState) { 21 | 22 | // set header data 23 | setDrawerHeaderImage(R.drawable.mat2); 24 | setUsername("My App Name"); 25 | setUserEmail("My version build"); 26 | //setFirstAccountPhoto(getResources().getDrawable(R.drawable.photo)); 27 | 28 | // create sections 29 | this.addSection(newSection("Section 1", new FragmentIndex())); 30 | this.addSection(newSection("Section 2",new FragmentIndex())); 31 | this.addSection(newSection("Section 3",R.drawable.ic_mic_white_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#9c27b0"))); 32 | this.addSection(newSection("Section",R.drawable.ic_hotel_grey600_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#03a9f4"))); 33 | 34 | // create bottom section 35 | this.addBottomSection(newSection("Bottom Section",R.drawable.ic_settings_black_24dp,new Intent(this,Settings.class))); 36 | } 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/dark/NoDrawerHeader.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.dark; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Color; 5 | import android.os.Bundle; 6 | 7 | import it.neokree.example.R; 8 | import it.neokree.example.mockedActivity.Settings; 9 | import it.neokree.example.mockedFragments.FragmentButton; 10 | import it.neokree.example.mockedFragments.FragmentIndex; 11 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 12 | 13 | /** 14 | * Created by neokree on 18/01/15. 15 | */ 16 | public class NoDrawerHeader extends MaterialNavigationDrawer { 17 | @Override 18 | public void init(Bundle savedInstanceState) { 19 | // create sections 20 | this.addSection(newSection("Section 1", new FragmentIndex())); 21 | this.addSection(newSection("Section 2",new FragmentIndex())); 22 | this.addSection(newSection("Section 3", R.drawable.ic_mic_white_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#9c27b0"))); 23 | this.addSection(newSection("Section",R.drawable.ic_hotel_grey600_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#03a9f4"))); 24 | 25 | // create bottom section 26 | this.addBottomSection(newSection("Bottom Section",R.drawable.ic_settings_black_24dp,new Intent(this,Settings.class))); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/functionalities/CustomAccountSection.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.functionalities; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Color; 5 | import android.os.Bundle; 6 | import android.widget.Toast; 7 | 8 | import it.neokree.example.R; 9 | import it.neokree.example.mockedActivity.Settings; 10 | import it.neokree.example.mockedFragments.FragmentButton; 11 | import it.neokree.example.mockedFragments.FragmentIndex; 12 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 13 | import it.neokree.materialnavigationdrawer.elements.MaterialAccount; 14 | import it.neokree.materialnavigationdrawer.elements.MaterialSection; 15 | import it.neokree.materialnavigationdrawer.elements.listeners.MaterialSectionListener; 16 | 17 | /** 18 | * Created by neokree on 20/01/15. 19 | */ 20 | public class CustomAccountSection extends MaterialNavigationDrawer { 21 | 22 | @Override 23 | public void init(Bundle savedInstanceState) { 24 | 25 | // add accounts 26 | MaterialAccount account = new MaterialAccount(this.getResources(),"NeoKree","neokree@gmail.com", R.drawable.photo, R.drawable.bamboo); 27 | this.addAccount(account); 28 | 29 | MaterialAccount account2 = new MaterialAccount(this.getResources(),"Hatsune Miky","hatsune.miku@example.com",R.drawable.photo2,R.drawable.mat2); 30 | this.addAccount(account2); 31 | 32 | MaterialAccount account3 = new MaterialAccount(this.getResources(),"Example","example@example.com",R.drawable.photo,R.drawable.mat3); 33 | this.addAccount(account3); 34 | 35 | // add account sections 36 | this.addAccountSection(newSection("Account settings",R.drawable.ic_settings_black_24dp,new MaterialSectionListener() { 37 | @Override 38 | public void onClick(MaterialSection section) { 39 | Toast.makeText(CustomAccountSection.this,"Account settings clicked",Toast.LENGTH_SHORT).show(); 40 | 41 | // for default section is selected when you click on it 42 | section.unSelect(); // so deselect the section if you want 43 | } 44 | })); 45 | 46 | 47 | // create sections 48 | this.addSection(newSection("Section 1", new FragmentIndex())); 49 | this.addSection(newSection("Section 2",new FragmentIndex())); 50 | this.addSection(newSection("Section 3",R.drawable.ic_mic_white_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#9c27b0"))); 51 | this.addSection(newSection("Section",R.drawable.ic_hotel_grey600_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#03a9f4"))); 52 | 53 | // create bottom section 54 | this.addBottomSection(newSection("Bottom Section",R.drawable.ic_settings_black_24dp,new Intent(this,Settings.class))); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/functionalities/KitkatStatusBar.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.functionalities; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Color; 5 | import android.os.Bundle; 6 | 7 | import it.neokree.example.R; 8 | import it.neokree.example.mockedActivity.Settings; 9 | import it.neokree.example.mockedFragments.FragmentButton; 10 | import it.neokree.example.mockedFragments.FragmentIndex; 11 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 12 | import it.neokree.materialnavigationdrawer.elements.MaterialAccount; 13 | 14 | /** 15 | * Created by neokree on 20/01/15. 16 | */ 17 | public class KitkatStatusBar extends MaterialNavigationDrawer { 18 | 19 | @Override 20 | public void init(Bundle savedInstanceState) { 21 | // add accounts 22 | MaterialAccount account = new MaterialAccount(this.getResources(),"NeoKree","neokree@gmail.com", R.drawable.photo, R.drawable.bamboo); 23 | this.addAccount(account); 24 | 25 | MaterialAccount account2 = new MaterialAccount(this.getResources(),"Hatsune Miky","hatsune.miku@example.com",R.drawable.photo2,R.drawable.mat2); 26 | this.addAccount(account2); 27 | 28 | MaterialAccount account3 = new MaterialAccount(this.getResources(),"Example","example@example.com",R.drawable.photo,R.drawable.mat3); 29 | this.addAccount(account3); 30 | 31 | // create sections 32 | this.addSection(newSection("Section 1", new FragmentIndex())); 33 | this.addSection(newSection("Section 2",new FragmentIndex())); 34 | this.addSection(newSection("Section 3",R.drawable.ic_mic_white_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#9c27b0"))); 35 | this.addSection(newSection("Section",R.drawable.ic_hotel_grey600_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#03a9f4"))); 36 | 37 | // create bottom section 38 | this.addBottomSection(newSection("Bottom Section",R.drawable.ic_settings_black_24dp,new Intent(this,Settings.class))); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/functionalities/MultiPane.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.functionalities; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Color; 5 | import android.os.Bundle; 6 | 7 | import it.neokree.example.R; 8 | import it.neokree.example.mockedActivity.Settings; 9 | import it.neokree.example.mockedFragments.FragmentButton; 10 | import it.neokree.example.mockedFragments.FragmentIndex; 11 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 12 | import it.neokree.materialnavigationdrawer.elements.MaterialAccount; 13 | 14 | /** 15 | * Created by neokree on 20/01/15. 16 | */ 17 | public class MultiPane extends MaterialNavigationDrawer { 18 | 19 | @Override 20 | public void init(Bundle savedInstanceState) { 21 | // add accounts 22 | MaterialAccount account = new MaterialAccount(this.getResources(),"NeoKree","neokree@gmail.com", R.drawable.photo, R.drawable.bamboo); 23 | this.addAccount(account); 24 | 25 | MaterialAccount account2 = new MaterialAccount(this.getResources(),"Hatsune Miky","hatsune.miku@example.com",R.drawable.photo2,R.drawable.mat2); 26 | this.addAccount(account2); 27 | 28 | MaterialAccount account3 = new MaterialAccount(this.getResources(),"Example","example@example.com",R.drawable.photo,R.drawable.mat3); 29 | this.addAccount(account3); 30 | 31 | // create sections 32 | this.addSection(newSection("Section 1", new FragmentIndex())); 33 | this.addSection(newSection("Section 2",new FragmentIndex())); 34 | this.addSection(newSection("Section 3",R.drawable.ic_mic_white_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#9c27b0"))); 35 | this.addSection(newSection("Section",R.drawable.ic_hotel_grey600_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#03a9f4"))); 36 | 37 | // create bottom section 38 | this.addBottomSection(newSection("Bottom Section",R.drawable.ic_settings_black_24dp,new Intent(this,Settings.class))); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/functionalities/RealColorSections.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.functionalities; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Color; 5 | import android.os.Bundle; 6 | 7 | import it.neokree.example.R; 8 | import it.neokree.example.mockedActivity.Settings; 9 | import it.neokree.example.mockedFragments.FragmentButton; 10 | import it.neokree.example.mockedFragments.FragmentIndex; 11 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 12 | 13 | /** 14 | * Created by neokree on 31/01/15. 15 | */ 16 | public class RealColorSections extends MaterialNavigationDrawer { 17 | 18 | @Override 19 | public void init(Bundle savedInstanceState) { 20 | 21 | this.addSection(newSection("Section 1", new FragmentIndex())); 22 | this.addSection(newSection("Section 2",new FragmentIndex())); 23 | this.addSection(newSectionWithRealColor("Section 3", R.drawable.photo,new FragmentButton()).setSectionColor(Color.parseColor("#9c27b0"))); 24 | this.addSection(newSectionWithRealColor("Section",R.drawable.photo2,new FragmentButton()).setSectionColor(Color.parseColor("#03a9f4"))); 25 | 26 | // create bottom section 27 | this.addBottomSection(newSection("Bottom Section",R.drawable.ic_settings_black_24dp,new Intent(this,Settings.class))); 28 | 29 | } 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/functionalities/RippleBackport.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.functionalities; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Color; 5 | import android.os.Bundle; 6 | 7 | import it.neokree.example.R; 8 | import it.neokree.example.mockedActivity.Settings; 9 | import it.neokree.example.mockedFragments.FragmentButton; 10 | import it.neokree.example.mockedFragments.FragmentIndex; 11 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 12 | 13 | /** 14 | * Created by neokree on 20/01/15. 15 | */ 16 | public class RippleBackport extends MaterialNavigationDrawer { 17 | 18 | @Override 19 | public void init(Bundle savedInstanceState) { 20 | 21 | // create sections 22 | this.addSection(newSection("Section 1", new FragmentIndex())); 23 | this.addSection(newSection("Section 2",new FragmentIndex())); 24 | this.addSection(newSection("Section 3", R.drawable.ic_mic_white_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#9c27b0"))); 25 | this.addSection(newSection("Section",R.drawable.ic_hotel_grey600_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#03a9f4"))); 26 | 27 | // create bottom section 28 | this.addBottomSection(newSection("Bottom Section",R.drawable.ic_settings_black_24dp,new Intent(this,Settings.class))); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/functionalities/UniqueToolbarColor.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.functionalities; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Color; 5 | import android.os.Bundle; 6 | 7 | import it.neokree.example.R; 8 | import it.neokree.example.mockedActivity.Settings; 9 | import it.neokree.example.mockedFragments.FragmentButton; 10 | import it.neokree.example.mockedFragments.FragmentIndex; 11 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 12 | 13 | /** 14 | * Created by neokree on 20/01/15. 15 | */ 16 | public class UniqueToolbarColor extends MaterialNavigationDrawer { 17 | 18 | @Override 19 | public void init(Bundle savedInstanceState) { 20 | 21 | // create sections 22 | this.addSection(newSection("Section 1", new FragmentIndex())); 23 | this.addSection(newSection("Section 2",new FragmentIndex())); 24 | this.addSection(newSection("Section 3", R.drawable.ic_mic_white_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#9c27b0"))); 25 | this.addSection(newSection("Section",R.drawable.ic_hotel_grey600_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#03a9f4"))); 26 | 27 | // create bottom section 28 | this.addBottomSection(newSection("Bottom Section",R.drawable.ic_settings_black_24dp,new Intent(this,Settings.class))); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/functionalities/master_child/ChildFragment.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.functionalities.master_child; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v4.app.Fragment; 6 | import android.util.Log; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | 11 | import it.neokree.example.R; 12 | 13 | /** 14 | * Created by neokree on 20/01/15. 15 | */ 16 | public class ChildFragment extends Fragment { 17 | 18 | @Override 19 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 20 | Log.i("MaterialNavigationDrawer Master-Child","Child created"); 21 | 22 | return inflater.inflate(R.layout.masterchild_child,container,false); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/functionalities/master_child/MasterChildActivity.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.functionalities.master_child; 2 | 3 | import android.os.Bundle; 4 | 5 | import it.neokree.example.R; 6 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 7 | 8 | /** 9 | * Created by neokree on 20/01/15. 10 | */ 11 | public class MasterChildActivity extends MaterialNavigationDrawer { 12 | 13 | @Override 14 | public void init(Bundle savedInstanceState) { 15 | 16 | this.setDrawerHeaderImage(R.drawable.mat3); 17 | 18 | this.addSection(this.newSection("Section 1", new MasterFragment())); 19 | this.addSection(this.newSection("Section 2",new MasterFragment())); 20 | 21 | } 22 | 23 | @Override 24 | protected void onStart() { 25 | super.onStart(); 26 | 27 | // set the indicator for child fragments 28 | // N.B. call this method AFTER the init() to leave the time to instantiate the ActionBarDrawerToggle 29 | this.setHomeAsUpIndicator(R.drawable.ic_arrow_back_white_24dp); 30 | } 31 | 32 | @Override 33 | public void onHomeAsUpSelected() { 34 | // when the back arrow is selected this method is called 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/functionalities/master_child/MasterFragment.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.functionalities.master_child; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v4.app.Fragment; 6 | import android.util.Log; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | import android.widget.Button; 11 | 12 | import it.neokree.example.R; 13 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 14 | 15 | /** 16 | * Created by neokree on 20/01/15. 17 | */ 18 | public class MasterFragment extends Fragment implements View.OnClickListener { 19 | 20 | @Override 21 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 22 | Log.i("MaterialNavigationDrawer Master-Child", "Master created"); 23 | 24 | View view = inflater.inflate(R.layout.masterchild_master,container,false); 25 | ((Button)view.findViewById(R.id.master_button)).setOnClickListener(this); 26 | 27 | return view; 28 | } 29 | 30 | @Override 31 | public void onClick(View v) { 32 | ((MaterialNavigationDrawer)this.getActivity()).setFragmentChild(new ChildFragment(),"Child Title"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/light/Accounts.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.light; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Color; 5 | import android.os.Bundle; 6 | 7 | import it.neokree.example.R; 8 | import it.neokree.example.mockedActivity.Settings; 9 | import it.neokree.example.mockedFragments.FragmentButton; 10 | import it.neokree.example.mockedFragments.FragmentIndex; 11 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 12 | import it.neokree.materialnavigationdrawer.elements.MaterialAccount; 13 | import it.neokree.materialnavigationdrawer.elements.listeners.MaterialAccountListener; 14 | 15 | /** 16 | * Created by neokree on 18/01/15. 17 | */ 18 | public class Accounts extends MaterialNavigationDrawer implements MaterialAccountListener { 19 | 20 | @Override 21 | public void init(Bundle savedInstanceState) { 22 | 23 | // add accounts 24 | MaterialAccount account = new MaterialAccount(this.getResources(),"NeoKree","neokree@gmail.com",R.drawable.photo, R.drawable.bamboo); 25 | this.addAccount(account); 26 | 27 | MaterialAccount account2 = new MaterialAccount(this.getResources(),"Hatsune Miky","hatsune.miku@example.com",R.drawable.photo2,R.drawable.mat2); 28 | this.addAccount(account2); 29 | 30 | MaterialAccount account3 = new MaterialAccount(this.getResources(),"Example","example@example.com",R.drawable.photo,R.drawable.mat3); 31 | this.addAccount(account3); 32 | 33 | // set listener 34 | this.setAccountListener(this); 35 | 36 | // create sections 37 | this.addSection(newSection("Section 1", new FragmentIndex())); 38 | this.addSection(newSection("Section 2",new FragmentIndex())); 39 | this.addSection(newSection("Section 3",R.drawable.ic_mic_white_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#9c27b0"))); 40 | this.addSection(newSection("Section",R.drawable.ic_hotel_grey600_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#03a9f4"))); 41 | 42 | // create bottom section 43 | this.addBottomSection(newSection("Bottom Section",R.drawable.ic_settings_black_24dp,new Intent(this,Settings.class))); 44 | 45 | } 46 | 47 | @Override 48 | public void onAccountOpening(MaterialAccount account) { 49 | 50 | } 51 | 52 | @Override 53 | public void onChangeAccount(MaterialAccount newAccount) { 54 | 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/light/CustomDrawerHeader.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.light; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Color; 5 | import android.os.Bundle; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | 9 | import it.neokree.example.R; 10 | import it.neokree.example.mockedActivity.Settings; 11 | import it.neokree.example.mockedFragments.FragmentButton; 12 | import it.neokree.example.mockedFragments.FragmentIndex; 13 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 14 | 15 | /** 16 | * Created by neokree on 18/01/15. 17 | */ 18 | public class CustomDrawerHeader extends MaterialNavigationDrawer { 19 | @Override 20 | public void init(Bundle savedInstanceState) { 21 | 22 | // create and set the header 23 | View view = LayoutInflater.from(this).inflate(R.layout.custom_drawer,null); 24 | setDrawerHeaderCustom(view); 25 | 26 | // create sections 27 | this.addSection(newSection("Section 1", new FragmentIndex())); 28 | this.addSection(newSection("Section 2",new FragmentIndex())); 29 | this.addSection(newSection("Section 3", R.drawable.ic_mic_white_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#9c27b0"))); 30 | this.addSection(newSection("Section",R.drawable.ic_hotel_grey600_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#03a9f4"))); 31 | 32 | // create bottom section 33 | this.addBottomSection(newSection("Bottom Section",R.drawable.ic_settings_black_24dp,new Intent(this,Settings.class))); 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/light/ImageDrawerHeader.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.light; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Color; 5 | import android.os.Bundle; 6 | 7 | import it.neokree.example.R; 8 | import it.neokree.example.mockedActivity.Settings; 9 | import it.neokree.example.mockedFragments.FragmentButton; 10 | import it.neokree.example.mockedFragments.FragmentIndex; 11 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 12 | 13 | /** 14 | * Created by neokree on 18/01/15. 15 | */ 16 | public class ImageDrawerHeader extends MaterialNavigationDrawer { 17 | @Override 18 | public void init(Bundle savedInstanceState) { 19 | 20 | // set the header image 21 | this.setDrawerHeaderImage(R.drawable.mat2); 22 | 23 | // create sections 24 | this.addSection(newSection("Section 1", new FragmentIndex())); 25 | this.addSection(newSection("Section 2",new FragmentIndex())); 26 | this.addSection(newSection("Section 3", R.drawable.ic_mic_white_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#9c27b0"))); 27 | this.addSection(newSection("Section",R.drawable.ic_hotel_grey600_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#03a9f4"))); 28 | 29 | // create bottom section 30 | this.addBottomSection(newSection("Bottom Section",R.drawable.ic_settings_black_24dp,new Intent(this,Settings.class))); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/light/MockedAccount.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.light; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Color; 5 | import android.os.Bundle; 6 | 7 | import it.neokree.example.R; 8 | import it.neokree.example.mockedActivity.Settings; 9 | import it.neokree.example.mockedFragments.FragmentButton; 10 | import it.neokree.example.mockedFragments.FragmentIndex; 11 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 12 | 13 | /** 14 | * Created by neokree on 18/01/15. 15 | */ 16 | public class MockedAccount extends MaterialNavigationDrawer { 17 | 18 | @Override 19 | public void init(Bundle savedInstanceState) { 20 | 21 | // set header data 22 | setDrawerHeaderImage(R.drawable.mat2); 23 | setUsername("My App Name"); 24 | setUserEmail("My version build"); 25 | //setFirstAccountPhoto(getResources().getDrawable(R.drawable.photo)); 26 | 27 | // create sections 28 | this.addSection(newSection("Section 1", new FragmentIndex())); 29 | this.addSection(newSection("Section 2",new FragmentIndex())); 30 | this.addSection(newSection("Section 3",R.drawable.ic_mic_white_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#9c27b0"))); 31 | this.addSection(newSection("Section",R.drawable.ic_hotel_grey600_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#03a9f4"))); 32 | 33 | // create bottom section 34 | this.addBottomSection(newSection("Bottom Section",R.drawable.ic_settings_black_24dp,new Intent(this,Settings.class))); 35 | } 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/light/NoDrawerHeader.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.light; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Color; 5 | import android.os.Bundle; 6 | 7 | import it.neokree.example.R; 8 | import it.neokree.example.mockedActivity.Settings; 9 | import it.neokree.example.mockedFragments.FragmentButton; 10 | import it.neokree.example.mockedFragments.FragmentIndex; 11 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 12 | 13 | /** 14 | * Created by neokree on 18/01/15. 15 | */ 16 | public class NoDrawerHeader extends MaterialNavigationDrawer { 17 | @Override 18 | public void init(Bundle savedInstanceState) { 19 | // create sections 20 | this.addSection(newSection("Section 1", new FragmentIndex())); 21 | this.addSection(newSection("Section 2",new FragmentIndex())); 22 | this.addSection(newSection("Section 3", R.drawable.ic_mic_white_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#9c27b0"))); 23 | this.addSection(newSection("Section",R.drawable.ic_hotel_grey600_24dp,new FragmentButton()).setSectionColor(Color.parseColor("#03a9f4"))); 24 | 25 | // create bottom section 26 | this.addBottomSection(newSection("Bottom Section",R.drawable.ic_settings_black_24dp,new Intent(this,Settings.class))); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/mockedActivity/Profile.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.mockedActivity; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.os.Bundle; 6 | import android.support.v7.app.ActionBarActivity; 7 | 8 | import it.neokree.example.R; 9 | 10 | 11 | /** 12 | * Created by neokree on 12/12/14. 13 | */ 14 | public class Profile extends ActionBarActivity { 15 | 16 | @Override 17 | protected void onCreate(Bundle savedInstanceState) { 18 | super.onCreate(savedInstanceState); 19 | setContentView(R.layout.profile); 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/mockedActivity/Settings.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.mockedActivity; 2 | 3 | import android.os.Bundle; 4 | import android.os.PersistableBundle; 5 | import android.support.v7.app.ActionBarActivity; 6 | 7 | import it.neokree.example.R; 8 | 9 | /** 10 | * Created by neokree on 24/11/14. 11 | */ 12 | public class Settings extends ActionBarActivity { 13 | 14 | @Override 15 | protected void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | setContentView(R.layout.settings); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/mockedFragments/FragmentButton.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.mockedFragments; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v4.app.Fragment; 6 | import android.view.Gravity; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | import android.widget.Button; 11 | 12 | /** 13 | * Created by neokree on 31/12/14. 14 | */ 15 | public class FragmentButton extends Fragment{ 16 | 17 | @Override 18 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 19 | Button button = new Button(this.getActivity()); 20 | button.setText("Click Me"); 21 | button.setGravity(Gravity.CENTER); 22 | return button; 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/mockedFragments/FragmentIndex.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.mockedFragments; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | 6 | import android.support.v4.app.Fragment; 7 | import android.view.Gravity; 8 | import android.view.LayoutInflater; 9 | import android.view.View; 10 | import android.view.ViewGroup; 11 | import android.widget.TextView; 12 | 13 | 14 | /** 15 | * Created by neokree on 24/11/14. 16 | */ 17 | public class FragmentIndex extends Fragment { 18 | 19 | @Override 20 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 21 | TextView text = new TextView(this.getActivity()); 22 | text.setText("Section"); 23 | text.setGravity(Gravity.CENTER); 24 | return text; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/mockedFragments/FragmentList.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.mockedFragments; 2 | 3 | import android.os.Bundle; 4 | import android.support.v4.app.ListFragment; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.ArrayAdapter; 9 | 10 | import java.util.ArrayList; 11 | 12 | /** 13 | * Created by neokree on 11/01/15. 14 | */ 15 | public class FragmentList extends ListFragment{ 16 | 17 | ArrayList list; 18 | 19 | @Override 20 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 21 | 22 | list = new ArrayList<>(); 23 | 24 | for (int i = 0;i< 50 ;i++) { 25 | list.add("Item "+ (i+1)); 26 | } 27 | setListAdapter(new ArrayAdapter(this.getActivity(), android.R.layout.simple_list_item_1, list)); 28 | return super.onCreateView(inflater, container, savedInstanceState); 29 | } 30 | 31 | @Override 32 | public void onResume() { 33 | super.onResume(); 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/test/Test.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.test; 2 | 3 | import android.graphics.Color; 4 | import android.os.Bundle; 5 | 6 | import it.neokree.example.R; 7 | import it.neokree.example.mockedFragments.FragmentButton; 8 | import it.neokree.example.mockedFragments.FragmentIndex; 9 | import it.neokree.example.mockedFragments.FragmentList; 10 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 11 | import it.neokree.materialnavigationdrawer.elements.MaterialAccount; 12 | 13 | /** 14 | * Created by neokree on 22/01/15. 15 | */ 16 | public class Test extends MaterialNavigationDrawer { 17 | 18 | @Override 19 | public void init(Bundle savedInstanceState) { 20 | 21 | MaterialAccount account = new MaterialAccount(this.getResources(),"NeoKree","neokree@gmail.com",R.drawable.photo, R.drawable.bamboo); 22 | this.addAccount(account); 23 | 24 | MaterialAccount account2 = new MaterialAccount(this.getResources(),"Hatsune Miky","hatsune.miku@example.com",R.drawable.photo2,R.drawable.mat2); 25 | this.addAccount(account2); 26 | 27 | MaterialAccount account3 = new MaterialAccount(this.getResources(),"Example","example@example.com",R.drawable.photo,R.drawable.mat3); 28 | this.addAccount(account3); 29 | 30 | MaterialAccount account4 = new MaterialAccount(this.getResources(),"Example","example@example.com",R.drawable.photo,R.drawable.mat3); 31 | this.addAccount(account4); 32 | 33 | // create sections 34 | this.addSection(newSection("Section 1", new TestFragment())); 35 | this.addSection(newSection("Section 2",new FragmentList())); 36 | this.addSection(newSection("Section 3", R.drawable.ic_mic_white_24dp,new TestFragment()).setSectionColor(Color.parseColor("#9c27b0"))); 37 | this.addSection(newSection("Section",R.drawable.ic_hotel_grey600_24dp,new TestFragment()).setSectionColor(Color.parseColor("#03a9f4"))); 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/test/TestFragment.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.test; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v4.app.Fragment; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.Button; 10 | 11 | import it.neokree.example.R; 12 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 13 | 14 | /** 15 | * Created by neokree on 22/01/15. 16 | */ 17 | public class TestFragment extends Fragment { 18 | 19 | @Override 20 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 21 | View view = inflater.inflate(R.layout.test_fragment_click,container,false); 22 | 23 | ((Button)view.findViewById(R.id.next_section)).setOnClickListener(new View.OnClickListener() { 24 | @Override 25 | public void onClick(View v) { 26 | nextSection(); 27 | } 28 | }); 29 | 30 | return view; 31 | } 32 | 33 | 34 | public void nextSection() { 35 | Fragment fragment = new TestFragment2(); 36 | Bundle data = new Bundle(); 37 | data.putString("Test","Banana"); 38 | fragment.setArguments(data); 39 | 40 | ((MaterialNavigationDrawer)this.getActivity()).setFragmentChild(fragment,"Test page 2"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/java/it/neokree/example/test/TestFragment2.java: -------------------------------------------------------------------------------- 1 | package it.neokree.example.test; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v4.app.Fragment; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.Button; 10 | 11 | import it.neokree.example.R; 12 | import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; 13 | 14 | /** 15 | * Created by neokree on 31/01/15. 16 | */ 17 | public class TestFragment2 extends Fragment { 18 | 19 | @Override 20 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 21 | View view = inflater.inflate(R.layout.test_fragment_click,container,false); 22 | 23 | Bundle data = this.getArguments(); 24 | 25 | ((Button)view.findViewById(R.id.next_section)).setText(data.getString("Test")); 26 | 27 | return view; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable-hdpi/ic_arrow_back_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable-hdpi/ic_arrow_back_white_24dp.png -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable-hdpi/ic_hotel_grey600_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable-hdpi/ic_hotel_grey600_24dp.png -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable-hdpi/ic_mic_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable-hdpi/ic_mic_white_24dp.png -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable-hdpi/ic_settings_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable-hdpi/ic_settings_black_24dp.png -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable-mdpi/ic_arrow_back_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable-mdpi/ic_arrow_back_white_24dp.png -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable-mdpi/ic_hotel_grey600_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable-mdpi/ic_hotel_grey600_24dp.png -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable-mdpi/ic_mic_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable-mdpi/ic_mic_white_24dp.png -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable-mdpi/ic_settings_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable-mdpi/ic_settings_black_24dp.png -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable-xhdpi/ic_arrow_back_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable-xhdpi/ic_arrow_back_white_24dp.png -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable-xhdpi/ic_hotel_grey600_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable-xhdpi/ic_hotel_grey600_24dp.png -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable-xhdpi/ic_mic_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable-xhdpi/ic_mic_white_24dp.png -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable-xhdpi/ic_settings_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable-xhdpi/ic_settings_black_24dp.png -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable-xxhdpi/ic_arrow_back_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable-xxhdpi/ic_arrow_back_white_24dp.png -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable-xxhdpi/ic_hotel_grey600_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable-xxhdpi/ic_hotel_grey600_24dp.png -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable-xxhdpi/ic_mic_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable-xxhdpi/ic_mic_white_24dp.png -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable-xxhdpi/ic_settings_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable-xxhdpi/ic_settings_black_24dp.png -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable-xxxhdpi/ic_arrow_back_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable-xxxhdpi/ic_arrow_back_white_24dp.png -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable/bamboo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable/bamboo.jpg -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable/mat2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable/mat2.jpg -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable/mat3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable/mat3.jpg -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable/photo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable/photo.jpg -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/drawable/photo2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/MaterialNavigationDrawer/3c677fa834d9ebe90cd8568024c3bf3fa8c10ae2/MaterialNavigationDrawer/demo/src/main/res/drawable/photo2.jpg -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/layout/custom_drawer.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/layout/masterchild_child.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 14 | -------------------------------------------------------------------------------- /MaterialNavigationDrawer/demo/src/main/res/layout/masterchild_master.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 |