{"id":3504,"url":"https://github.com/jfeinstein10/SlidingMenu","last_synced_at":"2025-08-03T20:32:39.046Z","repository":{"id":3763629,"uuid":"4839957","full_name":"jfeinstein10/SlidingMenu","owner":"jfeinstein10","description":"An Android library that allows you to easily create applications with slide-in menus. You may use it in your Android apps provided that you cite this project and include the license in your app. Thanks!","archived":false,"fork":false,"pushed_at":"2021-09-19T14:04:18.000Z","size":32085,"stargazers_count":11070,"open_issues_count":305,"forks_count":5034,"subscribers_count":967,"default_branch":"master","last_synced_at":"2024-11-19T09:04:47.394Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jfeinstein10.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-06-30T05:14:23.000Z","updated_at":"2024-11-18T14:15:45.000Z","dependencies_parsed_at":"2022-08-23T23:40:45.966Z","dependency_job_id":null,"html_url":"https://github.com/jfeinstein10/SlidingMenu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfeinstein10%2FSlidingMenu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfeinstein10%2FSlidingMenu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfeinstein10%2FSlidingMenu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfeinstein10%2FSlidingMenu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jfeinstein10","download_url":"https://codeload.github.com/jfeinstein10/SlidingMenu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228567009,"owners_count":17937983,"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":[],"created_at":"2024-01-05T20:16:43.395Z","updated_at":"2024-12-07T05:30:37.663Z","avatar_url":"https://github.com/jfeinstein10.png","language":"Java","readme":"SlidingMenu ([Play Store Demo][7])\n===========\n\nSlidingMenu is an Open Source Android library that allows developers to easily create applications \nwith sliding menus like those made popular in the Google+, YouTube, and Facebook apps. Feel free \nto use it all you want in your Android apps provided that you cite this project and include the license in your app.\n\nSlidingMenu is currently used in some awesome Android apps. Here's a list of some of them: \n* [Foursquare][15]\n* [LinkedIn][19]\n* [Zappos][20]\n* [Rdio][8]\n* [Evernote Food][18]\n* [Plume][4]\n* [VLC for Android][5]\n* [ESPN ScoreCenter][14]\n* [MLS MatchDay][16]\n* [9GAG][17]\n* [Wunderlist 2][13]\n* [The Verge][6]\n* [MTG Familiar][9]\n* [Mantano Reader][10]\n* [Falcon Pro (BETA)][12]\n* [MW3 Barracks][11]\n\nIf you are using SlidingMenu in your app and would like to be listed here, please let me know via [Twitter][1]!\n\nHere's an older video of the example application in this repository : http://youtu.be/8vNaANLHw-c\n\nAlso, you can follow the project on Twitter : [@SlidingMenu][1]\n\nSetup\n-----\n* In Eclipse, just import the library as an Android library project. Project \u003e Clean to generate the binaries \nyou need, like R.java, etc.\n* Then, just add SlidingMenu as a dependency to your existing project and you're good to go!\n\nSetup with ActionBarSherlock\n----------------------------\n* Setup as above.\n* Checkout a clean copy of [ActionBarSherlock][2] and import into your Eclipse workspace.\n* Add ActionBarSherlock as a dependency to SlidingMenu\n* Go into the SlidingActivities that you plan on using make them extend Sherlock___Activity instead of ___Activity. \n\nHow to Integrate this Library into Your Projects\n------------------------------------------------\nIn order to integrate SlidingMenu into your own projects you can do one of two things.\n\n__1.__      You can wrap your Activities in a SlidingMenu by constructing it programmatically (`new SlidingMenu(Context context)`)\nand then calling `SlidingMenu.attachToActivity(Activity activity, SlidingMenu.SLIDING_WINDOW | SlidingMenu.SLIDING_CONTENT)`.\n`SLIDING_WINDOW` will include the Title/ActionBar in the content section of the SlidingMenu, while `SLIDING_CONTENT`\ndoes not. You can check it out in the example app AttachExample Activity.\n\n__2.__      You can embed the SlidingMenu at the Activity level by making your Activity extend `SlidingActivity`.\n* In your Activity's onCreate method, you will have to call `setContentView`, as usual, and also \n`setBehindContentView`, which has the same syntax as setContentView. `setBehindContentView` will place \nthe view in the \"behind\" portion of the SlidingMenu. You will have access to the `getSlidingMenu` method so you can\ncustomize the SlidingMenu to your liking.\n* If you want to use another library such as ActionBarSherlock, you can just change the SlidingActivities to extend\nthe SherlockActivities instead of the regular Activities.\n\n__3.__      You can use the SlidingMenu view directly in your xml layouts or programmatically in your Java code.\n* This way, you can treat SlidingMenu as you would any other view type and put it in crazy awesome places like in the\nrows of a ListView.\n* So. Many. Possibilities.\n\nSimple Example\n-----\n```java\npublic class SlidingExample extends Activity {\n\n\t@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetTitle(R.string.attach);\n\t\t// set the content view\n\t\tsetContentView(R.layout.content);\n\t\t// configure the SlidingMenu\n\t\tSlidingMenu menu = new SlidingMenu(this);\n        menu.setMode(SlidingMenu.LEFT);\n\t\tmenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);\n\t\tmenu.setShadowWidthRes(R.dimen.shadow_width);\n\t\tmenu.setShadowDrawable(R.drawable.shadow);\n\t\tmenu.setBehindOffsetRes(R.dimen.slidingmenu_offset);\n\t\tmenu.setFadeDegree(0.35f);\n\t\tmenu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);\n\t\tmenu.setMenu(R.layout.menu);\n\t}\n    \n}\n```\n\nXML Usage\n-----\nIf you decide to use SlidingMenu as a view, you can define it in your xml layouts like this:\n```xml\n\u003ccom.jeremyfeinstein.slidingmenu.lib.SlidingMenu\n    xmlns:sliding=\"http://schemas.android.com/apk/res-auto\"\n    android:id=\"@+id/slidingmenulayout\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    sliding:viewAbove=\"@layout/YOUR_ABOVE_VIEW\"\n    sliding:viewBehind=\"@layout/YOUR_BEHIND_BEHIND\"\n    sliding:touchModeAbove=\"margin|fullscreen\"\n    sliding:behindOffset=\"@dimen/YOUR_OFFSET\"\n    sliding:behindWidth=\"@dimen/YOUR_WIDTH\"\n    sliding:behindScrollScale=\"@dimen/YOUR_SCALE\"\n    sliding:shadowDrawable=\"@drawable/YOUR_SHADOW\"\n    sliding:shadowWidth=\"@dimen/YOUR_SHADOW_WIDTH\"\n    sliding:fadeEnabled=\"true|false\"\n    sliding:fadeDegree=\"float\"\n    sliding:selectorEnabled=\"true|false\"\n    sliding:selectorDrawable=\"@drawable/YOUR_SELECTOR\"/\u003e\n```\nNOTE : you cannot use both behindOffset and behindWidth. You will get an exception if you try.\n* `viewAbove` - a reference to the layout that you want to use as the above view of the SlidingMenu\n* `viewBehind` - a reference to the layout that you want to use as the behind view of the SlidingMenu\n* `touchModeAbove` - an enum that designates what part of the screen is touchable when the above view is \nshowing. Margin means only the left margin. Fullscreen means the entire screen. Default is margin.\n* `behindOffset` - a dimension representing the number of pixels that you want the above view to show when the\nbehind view is showing. Default is 0.\n* `behindWidth` - a dimension representing the width of the behind view. Default is the width of the screen\n(equivalent to behindOffset = 0).\n* `behindScrollScale` - a float representing the relationship between the above view scrolling and the behind\nbehind view scrolling. If set to 0.5f, the behind view will scroll 1px for every 2px that the above view scrolls.\nIf set to 1.0f, the behind view will scroll 1px for every 1px that the above view scrolls. And if set to 0.0f, the\nbehind view will never scroll; it will be static. This one is fun to play around with. Default is 0.25f.\n* `shadowDrawable` - a reference to a drawable to be used as a drop shadow from the above view onto the below view.\nDefault is no shadow for now.\n* `shadowWidth` - a dimension representing the width of the shadow drawable. Default is 0.\n* `fadeEnabled` - a boolean representing whether or not the behind view should fade when the SlidingMenu is closing\nand \"un-fade\" when opening\n* `fadeDegree` - a float representing the \"amount\" of fade. `1.0f` would mean fade all the way to black when the\nSlidingMenu is closed. `0.0f` would mean do not fade at all.\n* `selectorEnabled` - a boolean representing whether or not a selector should be drawn on the left side of the above\nview showing a selected view on the behind view.\n* `selectorDrawable` - a reference to a drawable to be used as the selector\nNOTE : in order to have the selector drawn, you must call SlidingMenu.setSelectedView(View v) with the selected view.\nNote that this will most likely not work with items in a ListView because of the way that Android recycles item views.\n\nCaveats\n-------\n* Your layouts have to be based on a viewgroup, unfortunatly this negates the `\u003cmerge\u003e` optimisations.\n            \n\nDeveloped By\n------------\n* Jeremy Feinstein\n\nLicense\n-------\n\n    Copyright 2012-2014 Jeremy Feinstein\n    \n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n    \n    http://www.apache.org/licenses/LICENSE-2.0\n    \n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n    \n[1]: http://twitter.com/slidingmenu\n[2]: http://actionbarsherlock.com/\n[3]: https://play.google.com/store/apps/details?id=com.zappos.android\u0026hl=en\n[4]: https://play.google.com/store/apps/details?id=com.levelup.touiteur\u0026hl=en\n[5]: https://play.google.com/store/apps/details?id=org.videolan.vlc.betav7neon\n[6]: https://play.google.com/store/apps/details?id=com.verge.android\n[7]: http://bit.ly/TWejze\n[8]: https://play.google.com/store/apps/details?id=com.rdio.android.ui\n[9]: https://play.google.com/store/apps/details?id=com.gelakinetic.mtgfam\n[10]: https://play.google.com/store/apps/details?id=com.mantano.reader.android\n[11]: https://play.google.com/store/apps/details?id=com.phonegap.MW3BarracksFree\n[12]: http://forum.xda-developers.com/showthread.php?p=34361296\n[13]: http://bit.ly/xs1sMN\n[14]: https://play.google.com/store/apps/details?id=com.espn.score_center\n[15]: https://play.google.com/store/apps/details?id=com.joelapenna.foursquared\n[16]: https://play.google.com/store/apps/details?id=com.mlssoccer\n[17]: https://play.google.com/store/apps/details?id=com.ninegag.android.app\n[18]: https://play.google.com/store/apps/details?id=com.evernote.food\n[19]: https://play.google.com/store/apps/details?id=com.linkedin.android\n[20]: https://play.google.com/store/apps/details?id=com.zappos.android\n","funding_links":[],"categories":["Libraries","CN","Java","Android 应用","Libs","etc","Android 开发中的日常积累","Uncategorized","库"],"sub_categories":["GUI","[Jeremy Feinstein](https://github.com/jfeinstein10)","网络服务_其他","\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget","安卓开发值得关注的库","Uncategorized","[](https://github.com/JStumpp/awesome-android/blob/master/readme.md#navigation)导航"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfeinstein10%2FSlidingMenu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjfeinstein10%2FSlidingMenu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfeinstein10%2FSlidingMenu/lists"}