/titanium-android-bottom-sheet-dialog

Use the native Android BottomSheet view in Appcelerator Titanium.

Primary LanguageJavaOtherNOASSERTION

Titanium Android BottomSheet module

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! 🤘

Example Screenshot

Requirements

  • Titanium SDK 7.0.0+

Download

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

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

cd android
ti build -p android --build-only

Legal

Copyright (c) 2019-present by Hans Knöchel. All Rights Reserved.