Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/malekkamel/actionsheet
ActionSheet is an Android clone of iOS action sheet component, completely typical to iOS7 style.
https://github.com/malekkamel/actionsheet
actionsheet android bottomsheet ios ios7 java jitpack kotlin mobile os programming sheet
Last synced: about 1 month ago
JSON representation
ActionSheet is an Android clone of iOS action sheet component, completely typical to iOS7 style.
- Host: GitHub
- URL: https://github.com/malekkamel/actionsheet
- Owner: MalekKamel
- License: apache-2.0
- Created: 2020-09-26T10:48:50.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-26T15:00:57.000Z (over 4 years ago)
- Last Synced: 2024-11-18T14:12:05.217Z (about 2 months ago)
- Topics: actionsheet, android, bottomsheet, ios, ios7, java, jitpack, kotlin, mobile, os, programming, sheet
- Language: Kotlin
- Homepage:
- Size: 171 KB
- Stars: 14
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![](https://jitpack.io/v/ShabanKamell/ActionSheet.svg)](https://jitpack.io/#ShabanKamell/ActionSheet)
ActionSheet
===========ActionSheet is an Android clone of iOS action sheet component, completely typical to iOS7 style.
## Installation
#### Gradle:
```groovy
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}dependencies {
implementation 'com.github.ShabanKamell:ActionSheet:x.y.z'
}
```
(Please replace x, y and z with the latest version numbers: [![](https://jitpack.io/v/ShabanKamell/ActionSheet.svg)](https://jitpack.io/#ShabanKamell/ActionSheet))#### Usage
#### Kotlin
```kotlin
val option1 = ActionItem(title = "Option 1") {
// action selected
}
// You can set a tag
option1.tag = 0val option2 = ActionItem(title = "Option 2", style = Style.DESTRUCTIVE) {
// action selected
}
val option3 = ActionItem(title = "Option 3", isEnabled = false) {
// action selected
}
// Using using DSL
ActionSheet.create {
title = "TITLE"
message = "MESSAGE"
actions = listOf(option1, option2, option3)
isCancelable = true // true by default
isCancelableOnActionClick = true // true by default
show(supportFragmentManager)
}
// Or using Kotlin Builder
ActionSheet.Builder()
.actions(listOf(option1, option2, option3))
.title("TITLE")
.message("MESSAGE")
.show(supportFragmentManager)
```#### Java
```java
ActionItem option1 = new ActionItem(
"Option 1",
() -> {
// Do something
return Unit.INSTANCE;
});
List actions = new ArrayList<>();
actions.add(option1);
new ActionSheet.Builder()
.title("TITLE")
.message("MESSAGE")
.actions(actions)
.isCancelable(true)
.show(manager);
```## Contibution
All contributions are always welcome. Just submit a Pull request **PR**.
### 🛡 License
click to reveal License
```
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```