Use the native Android BottomSheet view in Appcelerator Titanium.
Credits go to the native michael-rapp/AndroidBottomSheet library
and @chrystoffer for the initial Hyperloop based example. Thanks guys! 🤘
- Titanium SDK 7.0.0+
| Name | Type |
|---|---|
title |
String |
options |
Array |
cancelable |
Boolean |
destructive* |
Number |
*Thedestructiveoption 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.
| Name | Type |
|---|---|
index |
Number |
cancel |
Boolean |
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();cd android
ti build -p android --build-onlyCopyright (c) 2019-present by Hans Knöchel. All Rights Reserved.
