https://github.com/hansemannn/titanium-android-bottom-sheet-dialog
Use the native Android BottomSheet view in Appcelerator Titanium.
https://github.com/hansemannn/titanium-android-bottom-sheet-dialog
appcelerator bottomsheet javascript native titanium
Last synced: 3 months ago
JSON representation
Use the native Android BottomSheet view in Appcelerator Titanium.
- Host: GitHub
- URL: https://github.com/hansemannn/titanium-android-bottom-sheet-dialog
- Owner: hansemannn
- License: other
- Created: 2019-03-01T13:44:58.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-04T09:20:49.000Z (over 2 years ago)
- Last Synced: 2025-04-15T20:56:30.677Z (6 months ago)
- Topics: appcelerator, bottomsheet, javascript, native, titanium
- Language: Java
- Size: 257 KB
- Stars: 14
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Titanium Android BottomSheet module
Use the native Android `BottomSheet` view in Appcelerator Titanium.
Credits go to the native [`michael-rapp/AndroidBottomSheet`](https://github.com/michael-rapp/AndroidBottomSheet) library
and [@chrystoffer](https://github.com/chrystoffer) for the initial Hyperloop based example. Thanks guys! 🤘
## Requirements
- [x] Titanium SDK 7.0.0+## Download
- [x] [Stable release](https://github.com/hansemannn/titanium-android-bottom-sheet/releases)## API's
### `createOptionDialog`
#### Arguments
| Name | Type |
| - | - |
| `title` | String |
| `options` | Array |
| `cancelable` | Boolean |
| `destructive`* | Number |> `*` The `destructive` option is there to mimic the native iOS behavior by tinting the title
red. Different to iOS, the title will be red if the index is > -1 and is not applied to a single
option but the title.#### Events
##### `click`
| Name | Type |
| - | - |
| `index` | Number |
| `cancel` | Boolean |## Examples
```js
import TiBottomSheet from 'ti.bottomsheet';const options = TiBottomSheet.createOptionDialog({
title: 'Titanium rocks!',
options: [ 'Option A', 'Option B' ],
cancelable: true
});options.addEventListener('click', event => {
alert(event);
});options.show();
```## Build
```js
cd android
ti build -p android --build-only
```## Legal
Copyright (c) 2019-present by Hans Knöchel. All Rights Reserved.