{"id":21946841,"url":"https://github.com/rasheedsulayman/slidingupmenu","last_synced_at":"2025-09-07T01:33:38.009Z","repository":{"id":95607376,"uuid":"225466042","full_name":"rasheedsulayman/SlidingUpMenu","owner":"rasheedsulayman","description":"🚀 A very customizable library that allows you to present menu items (from menu resource and/or other sources) to users as a bottom sheet.","archived":false,"fork":false,"pushed_at":"2021-05-11T20:20:19.000Z","size":2325,"stargazers_count":31,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-22T22:35:15.431Z","etag":null,"topics":["android","bottomsheet","customizable-ui","dialog","material-design","menu","slideup"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/rasheedsulayman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-02T20:49:58.000Z","updated_at":"2024-06-26T06:43:45.000Z","dependencies_parsed_at":"2023-03-13T16:48:27.109Z","dependency_job_id":null,"html_url":"https://github.com/rasheedsulayman/SlidingUpMenu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rasheedsulayman/SlidingUpMenu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rasheedsulayman%2FSlidingUpMenu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rasheedsulayman%2FSlidingUpMenu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rasheedsulayman%2FSlidingUpMenu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rasheedsulayman%2FSlidingUpMenu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rasheedsulayman","download_url":"https://codeload.github.com/rasheedsulayman/SlidingUpMenu/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rasheedsulayman%2FSlidingUpMenu/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266405362,"owners_count":23923535,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","bottomsheet","customizable-ui","dialog","material-design","menu","slideup"],"created_at":"2024-11-29T04:35:30.144Z","updated_at":"2025-07-22T01:02:44.075Z","avatar_url":"https://github.com/rasheedsulayman.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SlidingUpMenu\n\nA library that allows you to present menu items (from menu resource and/or other sources) to users as a bottom sheet.\n\n[![Build Status](https://travis-ci.com/r4sh33d/SlidingUpMenu.svg?branch=master)](https://travis-ci.com/r4sh33d/SlidingUpMenu)\n[ ![Download](https://api.bintray.com/packages/r4sh33d/maven/SlidingUpMenu/images/download.svg) ](https://bintray.com/r4sh33d/maven/SlidingUpMenu/_latestVersion)\n\n\u003cimg src=\"https://raw.githubusercontent.com/r4sh33d/SlidingUpMenu/master/screenshots/snippet_screen_a.png\" width=\"600\"/\u003e\n\n## Gradle Dependency\n\nAdd the dependency to your app's `build.gradle`:\n\n```groovy\nimplementation 'com.r4sh33d:SlidingUpMenu:0.0.2'\n```\n## Usage\n\nIt is very easy to get started with `SlidingUpMenu`. Just specify a `Context` and a menu resource file: \n\n```kotlin\nSlidingUpMenu(context, R.menu.sample_menu).show()\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/r4sh33d/SlidingUpMenu/master/screenshots/dialog_basic_pixel_very_silver_portrait.png\" width=\"230\"/\u003e\n\n\n### Title\n\nYou can specify the title for the menu dialog by supplying a `String` id to the `titleText` method.  \n\n```kotlin\nSlidingUpMenu(context, R.menu.sample_menu).show {\n   titleText(R.string.basic_title)\n}\n```\n\nYou can also specify a `String` for the title:\n\n```kotlin\ntitleText(titleText = \"Basic Title\")\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/r4sh33d/SlidingUpMenu/master/screenshots/dialog_title_pixel_very_silver_portrait.png\" width=\"230\"/\u003e\n\n### Menu Items\n\nYou specify the menu items by supplying a `Menu` resource id and/or list of `MenuModel` items. If both menu resource id and list of MenuModel is specified, `SlidingUpMenu` will merge the sources together and present the menu items to users at once:\n\n```kotlin\nSlidingUpMenu(context, R.menu.sample_menu).show() // Menu resource id only\n//or \nSlidingUpMenu(context, menuModelItems = menuItems).show() // List of MenuModel only\n//or \nSlidingUpMenu(context, R.menu.sample_menu, menuItems).show() // Menu resource + List of MenuModel\n```\n### Callback\n\nTo receive item selected events, You specify a `MenuModelSelectedListener` to the `menuModelSelected` method. The `menuModelSelected` method takes in a lambda that will be called with the selected `MenuModel`, the position of the `MenuModel` and the `SlidingUpMenu` instance.\n \n ```kotlin\n SlidingUpMenu(context, R.menu.sample_menu).show {\n    titleText(R.string.basic_title)\n    menuModelSelected { slidingUpMenu, menuModel, position -\u003e\n        //   \n    }\n }\n ```\n \nYou can identify the selected menu item by querying the `menuModel.id` or using `position`. For menu resource files inflated from xml, the `id` is the `android:id` specified in the menu item tag:\n\n```kotlin\n\nSlidingUpMenu(context, R.menu.sample_menu).show {\n   titleText(titleText = \"Basic Title\")\n   menuModelSelected { slidingUpMenu, menuModel, position -\u003e\n   when (menuModel.id) {\n       R.id.menu_one -\u003e TODO()\n       R.id.menu_two -\u003e TODO()\n       R.id.menu_three -\u003e TODO()\n       //...\n       }\n   }\n}\n```\n### Showing and Dismissing Menu\n\n#### Showing Menu\nYou can create and immediately show the dialog, as seen the sample code snippets above. Just call the show() method variant that takes in a configuration block. You can add configurations in the block. `SlidingUpMenu` will apply the configuration and show the dialog immediately:  \n\n```kotlin\nSlidingUpMenu(context, R.menu.sample_menu).show {\n   // Configuration block\n   titleText(R.string.basic_title)\n   icon(R.drawable.icon)\n   menuType(GRID)\n   // ...\n}\n```\n\nAlternatively, you can create and configure the `SlidingUpMenu` instance, and show at a later time:\n\n```kotlin\nval slidingUpMenu = SlidingUpMenu(context, R.menu.sample_menu)\n// perform some operations\nslidingUpMenu.titleText(R.string.basic_title)\n   .icon(R.drawable.icon)\n   .menuType(GRID)\n   //...\n// Then after some time.\nslidingUpMenu.show()\n```\n#### Dismissing Menu\n\nBy default, `SlidingMenu` will automatically be dismissed anytime a menu item is selected. You can control this behaviour:\n\n```kotlin\nSlidingUpMenu(context, R.menu.sample_menu).show {\n   dismissOnMenuItemSelected(false)\n}\n```\nIf you disable auto-dismiss, you need to manually dismiss the menu dialog. \n\n```kotlin\nslidingUpMenu.dismiss()\n```\nLike other `Dialog`s you can also configure the behaviour when users' touch outside the dialog content:\n\n```kotlin\nslidingUpMenu.setCanceledOnTouchOutside(true)\n```\n\n### Menu Type\n\nYou can pass a `MenuType` to the `menuType` method to specify if you want the menu items to be arranged in a list or grid manner. \n\n#### GRID\n\n```kotlin\nSlidingUpMenu(context, R.menu.sample_menu).show {\n   menuType(MenuType.GRID)\n}\n```\n\u003cimg src=\"https://raw.githubusercontent.com/r4sh33d/SlidingUpMenu/master/screenshots/dialog_title_pixel_very_silver_portrait.png\" width=\"230\"/\u003e\n\n#### LIST\n\n```kotlin\nSlidingUpMenu(context, R.menu.sample_menu).show {\n   menuType(MenuType.LIST)\n}\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/r4sh33d/SlidingUpMenu/master/screenshots/dialog_list_pixel_very_silver_portrait.png\" width=\"230\"/\u003e\n\n### Scroll Direction\n\nTo control the scrolling direction for the menu items, You specify a `ScrollDirection` to the `scrollDirection` method:\n\n```kotlin\nSlidingUpMenu(context, R.menu.sample_menu).show {\n   scrollDirection(ScrollDirection.HORIZONTAL)\n   //or \n   scrollDirection(ScrollDirection.VERTICAL)\n}\n```\n\n### Icon\n\nTo set an icon for the menu dialog, use the `icon` method to supply a `Drawable` or a drawable resource id. The icon will be displayed at the top left corner of the menu dialog.\n\n```kotlin\nSlidingUpMenu(context, R.menu.sample_menu).show {\n    icon(R.drawable.icon)\n    // or \n    val drawable = {...}\n    icon(drawable)\n}\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/r4sh33d/SlidingUpMenu/master/screenshots/dialog_icon_pixel_very_silver_portrait.png\" width=\"230\"/\u003e\n\n## Theming \n\n### Corner Radius\n\nYou can get rounded edges by specifying a corner radius to the menu dialog:\n\n```kotlin\nSlidingUpMenu(context, R.menu.sample_menu).show {\n   cornerRadius(16f) // 16dp\n   // or \n   cornerRadius(R.dimen.cornerRadius) // from dimens resource\n}\n```\n\nYou can also specify the corner radius as an attribute in your theme style definition.\n\n\n```xml\n\u003cstyle name=\"AppThemeLight\" parent=\"Theme.MaterialComponents.Light.DarkActionBar\"\u003e\n   ...\n   \u003citem name=\"sm_corner_radius\"\u003e24dp\u003c/item\u003e\n   ...\n\u003c/style\u003e\n```\n\n\n\u003cimg src=\"https://raw.githubusercontent.com/r4sh33d/SlidingUpMenu/master/screenshots/dialog_round_corner_pixel_very_silver_portrait.png\" width=\"230\"/\u003e\n\n### Corner Radius\n\n### Text Color and Font\n\nYou can specify colors and fonts for dialog title and body with theme attributes:\n\n```xml\n\u003cstyle name=\"AppThemeLight\" parent=\"Theme.MaterialComponents.Light.DarkActionBar\"\u003e\n   ...\n   \u003citem name=\"sm_title_text_font\"\u003e@font/fugaz_one\u003c/item\u003e\n   \u003citem name=\"sm_title_text_color\"\u003e@color/colorAccent\u003c/item\u003e\n   \u003citem name=\"sm_body_text_font\"\u003e@font/maven_pro\u003c/item\u003e\n   \u003citem name=\"sm_body_text_color\"\u003e@android:color/holo_orange_light\u003c/item\u003e\n   ...\n\u003c/style\u003e \n```\n\n\n\u003cimg src=\"https://raw.githubusercontent.com/r4sh33d/SlidingUpMenu/master/screenshots/dialog_custom_font_color_pixel_very_silver_portrait.png\" width=\"230\"/\u003e\n\n\n### Background color\n\nYou can set background color for menu dialog:\n\n```xml\n\u003cstyle name=\"AppThemeLight\" parent=\"Theme.MaterialComponents.Light.DarkActionBar\"\u003e\n   ...\n   \u003citem name=\"sm_background_color\"\u003e@color/menuBackground\u003c/item\u003e\n   ...\n\u003c/style\u003e\n```\n\n\n\u003cimg src=\"https://raw.githubusercontent.com/r4sh33d/SlidingUpMenu/master/screenshots/dialog_custom_bg_pixel_very_silver_portrait.png\" width=\"230\"/\u003e\n\n\n### Ripple color\n\nYou can set the color for to use as background when menu items are selected:\n\n```xml\n\u003cstyle name=\"AppThemeLight\" parent=\"Theme.MaterialComponents.Light.DarkActionBar\"\u003e\n   ...\n   \u003citem name=\"sm_ripple_color\"\u003e@color/rippleColor\u003c/item\u003e\n   ...\n\u003c/style\u003e\n```\n\n---\n\n`SlidingUpMenu` uses [Dialog](https://developer.android.com/reference/android/app/Dialog.html) under the hood, so most standard `Dialog` operations should also be available.\n You can also check out [MaterialDialogs](https://github.com/afollestad/material-dialogs) for more customizable set of Dialogs. The icons used in the screenshots are from [here](https://forum.xda-developers.com/showthread.php?t=2798349).\n\n##  License\n\n    Copyright (c) 2019 Rasheed Sulayman.\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frasheedsulayman%2Fslidingupmenu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frasheedsulayman%2Fslidingupmenu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frasheedsulayman%2Fslidingupmenu/lists"}