Git Product home page Git Product logo

ti.drawerlayout's Introduction

โš ๏ธ

THIS REPO IS DEPRECATED SINCE THE DRAWER LAYOUT WAS INTEGRATED INTO THE TITANIUM CORE. CONSIDER USING: https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Android.DrawerLayout


DEPRECATED (Ti.DrawerLayout) gittio No Maintenance Intended

Native Android Navigation Drawer for Titanium

This is a fork of Tripvi/Ti.DrawerLayout

Overview

This module adds support for using the DrawerLayout in Titanium Apps.

The Drawer Layout is a view that can be pulled from the edge of a window. This can answer various purposes. The most common use case is the Navigation Drawer as seen in the above screenshot. The Navigation Drawer displays navigation options in a drawer which slides in from the left edge.

To expand the drawer the user can either touch the app icon or swipe from the left edge. The navigation drawer overlays the content but not the action bar.

Installation

  • Grab the latest package from the dist folder
  • Install it following this guide
  • with gittio: $ gittio install com.tripvi.drawerlayout

Usage

Here's an example of how to use the module.

Please note: This module requires a Theme without ActionBar such as Theme.AppCompat.Light.NoActionBar since it adds a Toolbar to its own layout. If you do not want the Toolbar, just pass the hideToolbar property at creation-time.

// Load module
var TiDrawerLayout = require('com.tripvi.drawerlayout');

// define left and center view
var leftView = Ti.UI.createView({backgroundColor:'gray'});
var centerView = Ti.UI.createView({backgroundColor:'white'});

// create the Drawer
var drawer = TiDrawerLayout.createDrawer({
    leftView: leftView,
    centerView: centerView
});

// create a window
var win = Ti.UI.createWindow();

// add the drawer to the window
win.add(drawer);

// listen for the open event...
win.addEventListener('open', function(){
    
    // ...to access activity and action bar
    var activity = win.getActivity();
    var actionbar = activity.getActionBar();
    
    if (actionbar){
    
        // this makes the drawer indicator visible in the action bar
        actionbar.displayHomeAsUp = true;
        
        // open and close with the app icon
        actionbar.onHomeIconItemSelected = function() {
            drawer.toggleLeftWindow();
        };
    }
});

// open the window
win.open();

Development

Contributions are very welcome. If you are able to fix bugs or want to add features to the module, please refer to the official module development guide. You can build the module with appc as described there. You can also use grunt build here. For distribution a new version, please update the version number in package.json and run grunt. It will update the version number in manifest and readme. Then it builds the new version and installs it globally with gittio.

License

MIT license, see LICENSE

Copyright (c) 2013 - 2014 by Tripvi Inc., 2015 - 2016 by Manuel Lehner

ti.drawerlayout's People

Contributors

dirleidionisio avatar drauggres avatar falkolab avatar fokkezb avatar geraudbourdin avatar gitter-badger avatar hazemkhaled avatar hieupham007 avatar iotashan avatar joaoveiga avatar m1ga avatar manumaticx avatar metacortex avatar sschueller avatar timanrebel avatar vagrantinoz avatar vladm3 avatar yomybaby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.