├── .gitignore ├── .idea ├── caches │ ├── build_file_checksums.ser │ └── gradle_models.ser ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── dictionaries │ └── Syed.xml ├── encodings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── LICENSE ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── ashraf │ │ └── navigrationpractice │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── ashraf │ │ │ └── navigrationpractice │ │ │ └── MainActivity.java │ └── res │ │ ├── drawable │ │ ├── fr_flag.png │ │ ├── logo.png │ │ ├── nav_option_background.xml │ │ ├── navicon1.png │ │ ├── navicon5.png │ │ ├── single_line.xml │ │ ├── svpn__country_flag.png │ │ ├── uk_flag.png │ │ └── usa_flag.png │ │ ├── layout │ │ ├── activity_main.xml │ │ ├── app_bar_main.xml │ │ ├── layout_navigation.xml │ │ ├── layout_navigation_flag.xml │ │ └── tool_bar.xml │ │ ├── menu │ │ └── activity_main_drawer.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-v21 │ │ └── styles.xml │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── drawables.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── ashraf │ └── navigrationpractice │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashraf789/Android-Custom-Navigation/4a35d546132b21374c5193b359218e0b47224848/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /.idea/caches/gradle_models.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashraf789/Android-Custom-Navigation/4a35d546132b21374c5193b359218e0b47224848/.idea/caches/gradle_models.ser -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/dictionaries/Syed.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 37 | 38 | 39 | 40 | 41 | 42 | 44 | 45 | 46 | 47 | 48 | 1.8 49 | 50 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Lazycoder 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Android-Custom-Navigation 2 | 3 |
4 | if you don't like android default navigation system(option menu) or looking for add two navigation(left and right) then this is right place for you 5 | 6 |
7 |
8 | 9 | 10 |
11 | 12 | 13 |
14 | 15 | 16 | 17 |
18 | 19 |
20 | 21 | ## License 22 | This project is licensed under the MIT License - see the [License File](LICENSE) for details 23 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | defaultConfig { 6 | applicationId "com.ashraf.navigrationpractice" 7 | minSdkVersion 16 8 | targetSdkVersion 28 9 | versionCode 1 10 | versionName "1.0" 11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | implementation fileTree(include: ['*.jar'], dir: 'libs') 23 | implementation 'com.android.support:appcompat-v7:28.0.0' 24 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 25 | implementation 'com.android.support:support-v4:28.0.0' 26 | testImplementation 'junit:junit:4.12' 27 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 28 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 29 | implementation 'com.android.support:design:28.0.0' 30 | } 31 | -------------------------------------------------------------------------------- /app/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 C:\Users\Syed\AppData\Local\Android\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 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/ashraf/navigrationpractice/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.ashraf.navigrationpractice; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.ashraf.navigrationpractice", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/ashraf/navigrationpractice/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.ashraf.navigrationpractice; 2 | 3 | import android.content.Intent; 4 | import android.net.Uri; 5 | import android.os.Bundle; 6 | import android.support.design.widget.Snackbar; 7 | import android.view.View; 8 | import android.support.v4.view.GravityCompat; 9 | import android.support.v4.widget.DrawerLayout; 10 | import android.support.v7.app.ActionBarDrawerToggle; 11 | import android.support.v7.app.AppCompatActivity; 12 | import android.support.v7.widget.Toolbar; 13 | import android.widget.ImageButton; 14 | import android.widget.LinearLayout; 15 | import android.widget.RelativeLayout; 16 | import android.widget.Toast; 17 | 18 | import static android.support.design.widget.Snackbar.LENGTH_LONG; 19 | import static android.support.design.widget.Snackbar.make; 20 | 21 | /* 22 | * Author: Lazy Coder 23 | * Email: syedashrafullah15@gmail.com 24 | * Date 10.04.17 25 | * */ 26 | public class MainActivity extends AppCompatActivity implements View.OnClickListener{ 27 | 28 | 29 | private RelativeLayout navRl,navGuideRl,navAboutUrlRl,navSeoulVpnUrlRl; 30 | private LinearLayout navRightUkLayout,navRightFrLayout,navRightUsLayout; 31 | private View v; 32 | 33 | @Override 34 | protected void onCreate(Bundle savedInstanceState) { 35 | super.onCreate(savedInstanceState); 36 | setContentView(R.layout.activity_main); 37 | 38 | 39 | ImageButton menuRight = (ImageButton) findViewById(R.id.navbar_right); 40 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); 41 | 42 | setSupportActionBar(toolbar); 43 | final DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); 44 | ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( 45 | this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); 46 | drawer.addDrawerListener(toggle); 47 | 48 | toggle.syncState(); 49 | 50 | menuRight.setOnClickListener(new View.OnClickListener() { 51 | @Override 52 | public void onClick(View v) { 53 | if (drawer.isDrawerOpen(GravityCompat.END)) { 54 | drawer.closeDrawer(GravityCompat.END); 55 | } else { 56 | drawer.openDrawer(GravityCompat.END); 57 | } 58 | } 59 | }); 60 | 61 | initializeAll(); 62 | 63 | } 64 | 65 | private void initializeAll() { 66 | 67 | 68 | navRightUkLayout = (LinearLayout) findViewById(R.id.navRightUkLayout); 69 | navRightFrLayout = (LinearLayout) findViewById(R.id.navRightFrLayout); 70 | navRightUsLayout = (LinearLayout) findViewById(R.id.navRightUsLayout); 71 | 72 | navRightUkLayout.setOnClickListener(this); 73 | navRightFrLayout.setOnClickListener(this); 74 | navRightUsLayout.setOnClickListener(this); 75 | 76 | 77 | navGuideRl = (RelativeLayout) findViewById(R.id.navGuideRl); 78 | navAboutUrlRl = (RelativeLayout) findViewById(R.id.navAboutUrlRl); 79 | navSeoulVpnUrlRl = (RelativeLayout) findViewById(R.id.navUrlRl); 80 | navRl = (RelativeLayout) findViewById(R.id.navRl); 81 | 82 | navGuideRl.setOnClickListener(this); 83 | navAboutUrlRl.setOnClickListener(this); 84 | navSeoulVpnUrlRl.setOnClickListener(this); 85 | navRl.setOnClickListener(this); 86 | 87 | 88 | } 89 | 90 | @Override 91 | public void onClick(View view) { 92 | switch (view.getId()){ 93 | 94 | //if you want to use fragment you can use that on each option i just use a toast message 95 | case R.id.navRl: 96 | showMessage("Navigation Home"); 97 | closeDrawer(); 98 | break; 99 | case R.id.navGuideRl: 100 | showMessage("Navigation Guide"); 101 | closeDrawer(); 102 | break; 103 | case R.id.navAboutUrlRl: 104 | showMessage("Navigation About"); 105 | closeDrawer(); 106 | 107 | break; 108 | case R.id.navUrlRl: 109 | Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://lazycoder.6te.net/")); 110 | startActivity(browserIntent); 111 | break; 112 | case R.id.navRightUkLayout: 113 | showMessage("Navigation Location UK"); 114 | closeDrawer(); 115 | 116 | break; 117 | case R.id.navRightFrLayout: 118 | showMessage("Navigation Location FR"); 119 | closeDrawer(); 120 | 121 | break; 122 | case R.id.navRightUsLayout: 123 | showMessage("Navigation Location US"); 124 | closeDrawer(); 125 | break; 126 | 127 | 128 | } 129 | } 130 | public void closeDrawer(){ 131 | DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); 132 | if (drawer.isDrawerOpen(GravityCompat.START)) { 133 | drawer.closeDrawer(GravityCompat.START); 134 | }else if (drawer.isDrawerOpen(GravityCompat.END)){ 135 | drawer.closeDrawer(GravityCompat.END); 136 | } 137 | } 138 | 139 | public void showMessage(String message){ 140 | Toast.makeText(MainActivity.this,message,Toast.LENGTH_SHORT).show(); 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/fr_flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashraf789/Android-Custom-Navigation/4a35d546132b21374c5193b359218e0b47224848/app/src/main/res/drawable/fr_flag.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashraf789/Android-Custom-Navigation/4a35d546132b21374c5193b359218e0b47224848/app/src/main/res/drawable/logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/nav_option_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/navicon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashraf789/Android-Custom-Navigation/4a35d546132b21374c5193b359218e0b47224848/app/src/main/res/drawable/navicon1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/navicon5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashraf789/Android-Custom-Navigation/4a35d546132b21374c5193b359218e0b47224848/app/src/main/res/drawable/navicon5.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/single_line.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/svpn__country_flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashraf789/Android-Custom-Navigation/4a35d546132b21374c5193b359218e0b47224848/app/src/main/res/drawable/svpn__country_flag.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/uk_flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashraf789/Android-Custom-Navigation/4a35d546132b21374c5193b359218e0b47224848/app/src/main/res/drawable/uk_flag.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/usa_flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashraf789/Android-Custom-Navigation/4a35d546132b21374c5193b359218e0b47224848/app/src/main/res/drawable/usa_flag.png -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 22 | 23 | 24 | 25 | 26 | 27 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /app/src/main/res/layout/app_bar_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_navigation.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 13 | 18 | 25 | 31 | 37 | 38 | 39 | 40 | 50 | 51 | 56 | 64 | 65 | 71 | 80 | 81 | 88 | 89 | 95 | 104 | 105 | 106 | 107 | 108 | 116 | 121 | 128 | 129 | 135 | 144 | 145 | 146 | 147 | 152 | 160 | 170 | 177 | 178 | 179 | 180 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_navigation_flag.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 16 | 17 | 23 | 24 | 27 | 31 | 37 | 42 | 48 | 49 | 56 | 61 | 67 | 68 | 75 | 80 | 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /app/src/main/res/layout/tool_bar.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 24 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/menu/activity_main_drawer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 13 | 17 | 21 | 22 | 23 | 24 | 25 | 29 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashraf789/Android-Custom-Navigation/4a35d546132b21374c5193b359218e0b47224848/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashraf789/Android-Custom-Navigation/4a35d546132b21374c5193b359218e0b47224848/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashraf789/Android-Custom-Navigation/4a35d546132b21374c5193b359218e0b47224848/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashraf789/Android-Custom-Navigation/4a35d546132b21374c5193b359218e0b47224848/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashraf789/Android-Custom-Navigation/4a35d546132b21374c5193b359218e0b47224848/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #fec802 4 | #d4d4d3 5 | #f9a825 6 | #ff6e40 7 | #FF4081 8 | #4d393b 9 | #429e5b 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 160dp 5 | 6 | 16dp 7 | 16dp 8 | 16dp 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/drawables.xml: -------------------------------------------------------------------------------- 1 | 2 | @android:drawable/ic_menu_camera 3 | @android:drawable/ic_menu_gallery 4 | @android:drawable/ic_menu_slideshow 5 | @android:drawable/ic_menu_manage 6 | @android:drawable/ic_menu_share 7 | @android:drawable/ic_menu_send 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | NavigrationPractice 3 | 4 | Open navigation drawer 5 | Close navigation drawer 6 | 7 | Settings 8 | 9 | 10 | Hello blank fragment 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 |