{"id":13493520,"url":"https://github.com/shrikanth7698/Custom-Navigation-Drawer","last_synced_at":"2025-03-28T11:32:54.063Z","repository":{"id":42187497,"uuid":"127861007","full_name":"shrikanth7698/Custom-Navigation-Drawer","owner":"shrikanth7698","description":"Custom Navigation Drawer Library for Android","archived":false,"fork":false,"pushed_at":"2022-07-05T07:37:22.000Z","size":446,"stargazers_count":459,"open_issues_count":14,"forks_count":139,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-03-15T00:25:53.515Z","etag":null,"topics":["android-library","drawer-android","drawer-navigation","drawerlayout","library","navigation-drawer"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shrikanth7698.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-03T06:23:00.000Z","updated_at":"2025-02-28T01:17:37.000Z","dependencies_parsed_at":"2022-07-13T14:44:13.476Z","dependency_job_id":null,"html_url":"https://github.com/shrikanth7698/Custom-Navigation-Drawer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shrikanth7698%2FCustom-Navigation-Drawer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shrikanth7698%2FCustom-Navigation-Drawer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shrikanth7698%2FCustom-Navigation-Drawer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shrikanth7698%2FCustom-Navigation-Drawer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shrikanth7698","download_url":"https://codeload.github.com/shrikanth7698/Custom-Navigation-Drawer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246021488,"owners_count":20710943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android-library","drawer-android","drawer-navigation","drawerlayout","library","navigation-drawer"],"created_at":"2024-07-31T19:01:16.077Z","updated_at":"2025-03-28T11:32:53.589Z","avatar_url":"https://github.com/shrikanth7698.png","language":"Java","funding_links":["https://ko-fi.com/O5O2BPL1'"],"categories":["Java"],"sub_categories":[],"readme":"![alt text](https://drive.google.com/uc?id=1frkB2g3FGLCBDN6icLGAJ9NM_k4mhCcD)\n[![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com)\n\n[![forthebadge](https://forthebadge.com/images/badges/built-for-android.svg)](https://forthebadge.com)\n\n[![forthebadge](https://forthebadge.com/images/badges/built-with-swag.svg)](https://forthebadge.com)\n\n\u003ca href='https://ko-fi.com/O5O2BPL1' target='_blank'\u003e\u003cimg height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi2.png?v=0' border='0' alt='Buy Me a Coffee at ko-fi.com' /\u003e\u003c/a\u003e\n\nIt has smooth zoom-in, zoom-out animation when switched from one fragment to another.\n\n## Repo no longer being maintained.\n\n[![Android Arsenal]( https://img.shields.io/badge/Android%20Arsenal-Custom%20Navigation%20Drawer-green.svg?style=flat )]( https://android-arsenal.com/details/1/6876 )\n  \n  ### Version\n[![](https://jitpack.io/v/shrikanth7698/Custom-Navigation-Drawer.svg)](https://jitpack.io/#shrikanth7698/Custom-Navigation-Drawer)\n\n### Installation\n\n* **Gradle**\n\n\tAdd it in your root build.gradle at the end of repositories:\n\t```gradle\n  allprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n\t```\n\n\tAdd the dependency in your app build.gradle\n\t```gradle\n  dependencies {\n\t        compile 'com.github.shrikanth7698:Custom-Navigation-Drawer:v0.0.1'\n\t}\n\t```\n\n* **Maven**\n\n\tAdd the JitPack repository to your build file\n\t```gradle\n\t\u003crepositories\u003e\n\t\t\u003crepository\u003e\n\t\t    \u003cid\u003ejitpack.io\u003c/id\u003e\n\t\t    \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n\t\t\u003c/repository\u003e\n\t\u003c/repositories\u003e\n\t```\n\n\tAdd the dependency\n\t```gradle\n  \u003cdependency\u003e\n\t    \u003cgroupId\u003ecom.github.shrikanth7698\u003c/groupId\u003e\n\t    \u003cartifactId\u003eCustom-Navigation-Drawer\u003c/artifactId\u003e\n\t    \u003cversion\u003ev0.0.1\u003c/version\u003e\n\t\u003c/dependency\u003e\n\t```\n  \n### Usage\n\nDrop the Custom Navigation Drawer in your XML layout as is shown below:\n```xml\n    \u003ccom.shrikanthravi.customnavigationdrawer2.widget.SNavigationDrawer\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:id=\"@+id/navigationDrawer\"\u003e\n        \u003cFrameLayout\n            android:id=\"@+id/frameLayout\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"/\u003e\n\n    \u003c/com.shrikanthravi.customnavigationdrawer2.widget.SNavigationDrawer\u003e\n```\nAnd then in your Activity or fragment\n```java\n        //Global Declaration\n        SNavigationDrawer sNavigationDrawer;\n        Class fragmentClass;\n        public static Fragment fragment;\n        \n        //Inside onCreate()\n        \n        sNavigationDrawer = findViewById(R.id.navigationDrawer);\n        \n        //Creating a list of menu Items\n        \n        List\u003cMenuItem\u003e menuItems = new ArrayList\u003c\u003e();\n        \n        //Use the MenuItem given by this library and not the default one.\n        //First parameter is the title of the menu item and then the second parameter is the image which will be the background of the menu item.\n        \n        menuItems.add(new MenuItem(\"News\",R.drawable.news_bg));\n        menuItems.add(new MenuItem(\"Feed\",R.drawable.feed_bg));\n        menuItems.add(new MenuItem(\"Messages\",R.drawable.message_bg));\n        menuItems.add(new MenuItem(\"Music\",R.drawable.music_bg));\n        \n        //then add them to navigation drawer\n        \n        sNavigationDrawer.setMenuItemList(menuItems);\n        fragmentClass =  NewsFragment.class;\n        try {\n            fragment = (Fragment) fragmentClass.newInstance();\n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n        if (fragment != null) {\n            FragmentManager fragmentManager = getSupportFragmentManager();\n            fragmentManager.beginTransaction().setCustomAnimations(android.R.animator.fade_in, android.R.animator.fade_out).replace(R.id.frameLayout, fragment).commit();\n        }\n        \n        \n\n        //Listener to handle the menu item click. It returns the position of the menu item clicked. Based on that you can switch between the fragments.\n        \n        sNavigationDrawer.setOnMenuItemClickListener(new SNavigationDrawer.OnMenuItemClickListener() {\n            @Override\n            public void onMenuItemClicked(int position) {\n                System.out.println(\"Position \"+position);\n\n                switch (position){\n                    case 0:{\n                        fragmentClass = NewsFragment.class;\n                        break;\n                    }\n                    case 1:{\n                        fragmentClass = FeedFragment.class;\n                        break;\n                    }\n                    case 2:{\n                        fragmentClass = MessagesFragment.class;\n                        break;\n                    }\n                    case 3:{\n                        fragmentClass = MusicFragment.class;\n                        break;\n                    }\n\n                }\n                \n                //Listener for drawer events such as opening and closing.\n                sNavigationDrawer.setDrawerListener(new SNavigationDrawer.DrawerListener() {\n\n                    @Override\n                    public void onDrawerOpened() {\n\n                    }\n\n                    @Override\n                    public void onDrawerOpening(){\n\n                    }\n\n                    @Override\n                    public void onDrawerClosing(){\n                        System.out.println(\"Drawer closed\");\n\n                        try {\n                            fragment = (Fragment) fragmentClass.newInstance();\n                        } catch (Exception e) {\n                            e.printStackTrace();\n                        }\n\n                        if (fragment != null) {\n                            FragmentManager fragmentManager = getSupportFragmentManager();\n                            fragmentManager.beginTransaction().setCustomAnimations(android.R.animator.fade_in, android.R.animator.fade_out).replace(R.id.frameLayout, fragment).commit();\n\n                        }\n                    }\n\n                    @Override\n                    public void onDrawerClosed() {\n\n                    }\n\n                    @Override\n                    public void onDrawerStateChanged(int newState) {\n                        System.out.println(\"State \"+newState);\n                    }\n                });\n            }\n        });\n```\n\n### Customization\n\n\n```xml\n    \u003ccom.shrikanthravi.customnavigationdrawer2.widget.SNavigationDrawer\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        app:navigationDrawerBackgroundColor=\"#151515\"\n        app:appbarTitleTextColor=\"@android:color/white\"\n        app:HamMenuIconTintColor=\"@android:color/white\"\n        app:appbarColor=\"@android:color/black\"\n        app:primaryMenuItemTextColor=\"@android:color/white\"\n        app:secondaryMenuItemTextColor=\"@android:color/white\"\n        app:appbarTitleTextSize=\"7sp\"\n        app:primaryMenuItemTextSize=\"7sp\"\n        app:secondaryMenuItemTextSize=\"7sp\"\n        android:id=\"@+id/navigationDrawer\"\u003e\n        \u003cFrameLayout\n            android:id=\"@+id/frameLayout\"\n            android:background=\"@android:color/black\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"/\u003e\n\n    \u003c/com.shrikanthravi.customnavigationdrawer2.widget.SNavigationDrawer\u003e\n      \n```\n\n### Developed by\n\u003cdiv class=\"LI-profile-badge\"  data-version=\"v1\" data-size=\"medium\" data-locale=\"en_US\" data-type=\"horizontal\" data-theme=\"light\" data-vanity=\"shrikanthravi\"\u003e\u003ca class=\"LI-simple-link\" href='https://in.linkedin.com/in/shrikanthravi?trk=profile-badge'\u003eShrikanth Ravi\u003c/a\u003e\u003c/div\u003e\n\n  \n### License\n```\nMIT License\n\nCopyright (c) 2018 Shrikanth Ravi\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshrikanth7698%2FCustom-Navigation-Drawer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshrikanth7698%2FCustom-Navigation-Drawer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshrikanth7698%2FCustom-Navigation-Drawer/lists"}