Skip to content

chrystoffer/titanium-android-bottom-sheet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Use the native Android BottomSheet view in Appcelerator Titanium.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 89.1%
  • JavaScript 10.9%