[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7330":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":16,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":16,"starSnapshotCount":16,"syncStatus":30,"lastSyncTime":31,"discoverSource":32},7330,"Context-Menu.Android","Yalantis\u002FContext-Menu.Android","Yalantis","You can easily add awesome animated context menu to your app.","https:\u002F\u002Fyalantis.com",null,"Kotlin",3826,958,176,4,0,60.95,"Apache License 2.0",false,"master",true,[23,24,25,26],"android","animation","context-menu","java","2026-06-12 04:00:33","[![Android Arsenal](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAndroid%20Arsenal-Context--Menu.Android-brightgreen.svg?style=flat)](https:\u002F\u002Fandroid-arsenal.com\u002Fdetails\u002F1\u002F1387) [![Yalantis](https:\u002F\u002Fgithub.com\u002FYalantis\u002FContext-Menu.Android\u002Fblob\u002Fmaster\u002Fbadge.png)](https:\u002F\u002Fyalantis.com\u002F?utm_source=github) [![](https:\u002F\u002Fjitpack.io\u002Fv\u002Fyalantis\u002Fcontext-menu.android.svg)](https:\u002F\u002Fjitpack.io\u002F#yalantis\u002Fcontext-menu.android)\n\n# ContextMenu \n\n#### You can easily add awesome animated context menu to  your app. \n\nCheck this [project on dribbble](https:\u002F\u002Fdribbble.com\u002Fshots\u002F1785274-Menu-Animation-for-Additional-Functions?list=users&offset=17)\n\nCheck this [project on Behance](https:\u002F\u002Fwww.behance.net\u002Fgallery\u002F20411445\u002FMobile-Animations-Interactions)  \n\n\u003Cimage src=\"https:\u002F\u002Fcdn.dribbble.com\u002Fusers\u002F125056\u002Fscreenshots\u002F1785274\u002F99miles-profile-light_1-1-4.gif\"\u002F>\n\n### Usage:\n\n*For a working implementation, have a look at the ```app``` module*\n\n#### \t1. Clone repository and add sources into your project or use Gradle:\n\nAdd it in your root build.gradle at the end of repositories:\n```\n\tallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https:\u002F\u002Fjitpack.io' }\n\t\t}\n\t}\n```\nAdd the dependency\n```\n\tdependencies {\n\t        implementation 'com.github.Yalantis:Context-Menu.Android:1.1.4'\n\t}\n```\n#### \t2. Create list of `MenuObject`, which consists of icon or icon and description.\nYou can use any `drawable, resource, bitmap, color` as image:\n```\n    menuObject.drawable = ...\n    menuObject.setResourceValue(...)\n    menuObject.setBitmapValue(...)\n    menuObject.setColorValue(...)\n   ```\nYou can set image `ScaleType`:\n```\n    menuObject.scaleType = ScaleType.FIT_XY\n```\nYou can use any `resource, drawable, color` as background:\n```\n    menuObject.setBgResourceValue(...)\n    menuObject.setBgDrawable(...)\n    menuObject.setBgColorValue(...)\n```\nNow You can easily add text appearance style for menu titles: \n```\n\tIn your project styles create style for text appearance\n\t(For better visual effect extend it from TextView.DefaultStyle):\n\t\n\t\u003Cstyle name=\"TextViewStyle\" parent=\"TextView.DefaultStyle\">\n        \t\u003Citem name=\"android:textStyle\">italic|bold\u003C\u002Fitem>\n        \t\u003Citem name=\"android:textColor\">#26D0EB\u003C\u002Fitem>\n\t\u003C\u002Fstyle>\n\n\tAnd set it's id to your MenuObject :\t\n    \n        val bitmapDrawable = BitmapDrawable(\n                resources,\n                BitmapFactory.decodeResource(resources, R.drawable.icn_3)\n        )\n\n        val menuObject = MenuObject(\"Add to friends\").apply {\n            drawable = bitmapDrawable\n            menuTextAppearanceStyle = R.style.TextViewStyle\n        }\n```\nYou can use any `color` as text color:\n```\n    menuObject.textColor = ...\n```\nYou can set any `color` as divider color:\n```\n    menuObject.dividerColor = ...\n```\nExample:  \n```\n    val close = MenuObject().apply { setResourceValue(R.drawable.icn_close) }\n\n    val send = MenuObject(\"Send message\").apply { setResourceValue(R.drawable.icn_1) }\n    \n    val addFriend = MenuObject(\"Add to friends\").apply {\n            drawable = BitmapDrawable(\n                    resources,\n                    BitmapFactory.decodeResource(resources, R.drawable.icn_3)\n            )\n    }\n\n    val menuObjects = mutableListOf\u003CMenuObject>().apply {\n            add(close)\n            add(send)\n            add(addFriend)\n    }\n```\n\n####\t3. Create `newInstance` of `ContextMenuDialogFragment`, which received `MenuParams` object.\n\n```\n    val menuParams = MenuParams(\n    \tactionBarSize = resources.getDimension(R.dimen.tool_bar_height).toInt(),\n    \tmenuObjects = getMenuObjects(),\n    \tisClosableOutside = false\n    \t\u002F\u002F set other settings to meet your needs\n    )\n    \n    \u002F\u002F If you want to change the side you need to add 'gravity' parameter,\n    \u002F\u002F by default it is MenuGravity.END.\n    \n    \u002F\u002F For example:\n    \n    val menuParams = MenuParams(\n    \tactionBarSize = resources.getDimension(R.dimen.tool_bar_height).toInt(),\n    \tmenuObjects = getMenuObjects(),\n    \tisClosableOutside = false,\n    \tgravity = MenuGravity.START\n    )\n    \n    val contextMenuDialogFragment = ContextMenuDialogFragment.newInstance(menuParams)\n```\n\n####\t4. Set menu with button, which will open `ContextMenuDialogFragment`.\n\n```\n    override fun onCreateOptionsMenu(menu: Menu?): Boolean {\n        menuInflater.inflate(R.menu.menu_main, menu)\n        return true\n    }\n\n    override fun onOptionsItemSelected(item: MenuItem?): Boolean {\n        item?.let {\n            when (it.itemId) {\n                R.id.context_menu -> {\n                    showContextMenuDialogFragment()\n                }\n            }\n        }\n\n        return super.onOptionsItemSelected(item)\n    }\n```\n\n####\t5. Add menu item listeners.\n```\n    contextMenuDialogFragment = menuItemClickListener = { view, position ->\n    \t\u002F\u002F do something here\n    }\n\t    \n    contextMenuDialogFragment = menuItemLongClickListener = { view, position ->\n    \t\u002F\u002F do something here\n    }\n```\n\n## Customization: \nFor better experience menu item size should be equal to `ActionBar` height.\n\n`newInstance` of `ContextMenuDialogFragment` receives `MenuParams` object that has the fields:\n\n`menuObjects` - list of MenuObject objects,\n\n`animationDelay` - delay in millis after fragment opening and before closing, which will make animation smoother on slow devices,\n\n`animationDuration` - duration of every piece of animation in millis,\n\n`isClosableOutside` - if menu can be closed on touch to non-button area,\n\n`isFitSystemWindows` - if true, then the default implementation of fitSystemWindows(Rect) will be executed,\n\n`isClipToPadding` - true to clip children to the padding of the group, false otherwise.\n\nThe last two parameters may be useful if you use _Translucent_ parameters in your theme:\n```\n    \u003Citem name=\"android:windowTranslucentStatus\">true\u003C\u002Fitem>\n```\nTo stay `Context Menu` below Status Bar set `fitSystemWindows` to true and `clipToPadding` to false.\n\n## Compatibility\n  \n  * Android KitKat 4.4+\n\n# Changelog\n\n### Version: 1.1.4\n\n  * added background color animation\n\n### Version: 1.1.2\n\n  * added animation on close outside menu\n\n### Version: 1.1.1\n\n  * bug with `menuObject.textColor` was fixed\n\n### Version: 1.1.0\n\n  * library rewrited on Kotlin\n  * added `rtl` support\n  * added `gravity` parameter for `MenuParams`\n\n### Version: 1.0.8\n\n  * added transparent menu background support\n  * dependencies actualized\n\n### Version: 1.0.7\n\n  * Text in menu now also clickable\n  * Support libs and gradle updated\n\n### Version: 1.0.6\n\n  * com.android.tools.build:gradle:1.5.0\n  * Support libs and sdk updated to 23 \n\n### Version: 1.0.5\n\n  * Fixed `setClosableOutside` [issue](https:\u002F\u002Fgithub.com\u002FYalantis\u002FContext-Menu.Android\u002Fissues\u002F25).\n  * Fixed `setAnimationDuration` doesn´t work for open event [issue](https:\u002F\u002Fgithub.com\u002FYalantis\u002FContext-Menu.Android\u002Fissues\u002F22).\n  * Fixed menu item listener setting mechanism. It can be not activity but any class that implements listeners now. [Issue](https:\u002F\u002Fgithub.com\u002FYalantis\u002FContext-Menu.Android\u002Fissues\u002F24). Attention! You have to set listeners to the context fragment manually. Check block 5 in the `Usage`.\n\n### Version: 1.0.4\n\n  * Old `ContextMenuDialogFragment` `newInstance` methods are deprecated. Use new universal one that received `MenuParams`.\n  * Added possibility to dismiss menu by clicking on non-button area. See `MenuParams.setClosableOutside(boolean)`.\n\n### Version: 1.0.3\n\n  * Added menu text appearence style. (Note: other text style methods are deprecated).\n\n### Version: 1.0.2\n\n  * Changed `MenuObject` constructors. Image setting is moved to methods\n  * Added styling of `MenuObject` image, background, text color, divider color\n  * Added possibility to interact with translucent Status Bar\n\n### Version: 1.0.1\n\n  * Added `OnMenuItemLongClickListener` (usage: the same as `OnMenuItemClickListener`, check sample app)\n  * Renamed:\n```\ncom.yalantis.contextmenu.lib.ContextMenuDialogFragment.ItemClickListener ->\ncom.yalantis.contextmenu.lib.interfaces.OnMenuItemClickListener\n\ncom.yalantis.contextmenu.lib.ContextMenuDialogFragment.ItemClickListener.onItemClick(...) ->\ncom.yalantis.contextmenu.lib.interfaces.OnMenuItemClickListener.onMenuItemClick(...)\n```\n\n### Version: 1.0\n\n  * Pilot version\n\n#### Let us know!\n\nWe’d be really happy if you sent us links to your projects where you use our component. Just send an email to github@yalantis.com And do let us know if you have any questions or suggestion regarding the animation. \n\nP.S. We’re going to publish more awesomeness wrapped in code and a tutorial on how to make UI for Android (iOS) better than better. Stay tuned!\n\n## License\n\n    Copyright 2019, Yalantis\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:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-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","Yalantis\u002FContext-Menu.Android 是一个用于在Android应用中轻松添加具有动画效果的上下文菜单的库。该项目使用Kotlin语言编写，支持多种自定义选项如图标、背景色、文本样式等，使开发者能够根据需要灵活调整菜单项的外观和行为。其核心功能包括通过简单的API调用来创建和展示包含图标或描述的菜单对象，并且提供了丰富的动画效果来提升用户体验。适用于希望增强移动应用程序交互性和视觉吸引力的各种场景，特别是在需要为用户提供更多操作选项时。",2,"2026-06-11 03:11:48","top_language"]