Skip to content

Commit

Permalink
Added to the example code and Updated readme with details of 1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Mads Møller committed Jan 19, 2014
1 parent a4e0a0a commit 0545045
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 8 deletions.
42 changes: 37 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ var mainWindow = NappSlideMenu.createSlideMenuWindow({
centerWindow:navController,
leftWindow:winLeft,
rightWindow:winRight,
statusBarStyle: NappSlideMenu.STATUSBAR_WHITE,
leftLedge:100
});
```
Expand Down Expand Up @@ -117,6 +118,29 @@ Set the duration of the animation when leftWindow or rightWindow is closed. It t
mainWindow.setCloseViewAnimationDuration(0.3);
```
### StatusBarStyle
Use this property to set the statusBar style. You will need to add the following to tiapp.xml in order to make this work:
<ios>
<plist>
<dict>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
</ios>
| input (constant) | Description |
| ----- | ----------- |
| STATUSBAR_BLACK | The statusbar icons and text will be black |
| STATUSBAR_WHITE | The statusbar icons and text will be white |
```javascript
mainWindow.setStatusBarStyle(NappSlideMenu.STATUSBAR_WHITE);
```
## API Methods
Expand All @@ -137,9 +161,9 @@ A small animation to show the app user that its possible to interact with the Na
mainWindow.bounceLeftView();
### isAnyViewOpen
### isAnyViewOpen, isLeftViewOpen, isRightViewOpen
Check if any of the windows is open. This returns a boolean.
Check if any, left or right window is open. This returns a boolean.
```javascript
mainWindow.isAnyViewOpen();
Expand Down Expand Up @@ -193,7 +217,7 @@ When an animation from the one of the side windows to the CenterWindow completes
var NappSlideMenu = require('dk.napp.slidemenu');

var window = NappSlideMenu.createSlideMenuWindow({
centerWindow:$.navgroup,
centerWindow:$.navWindow,
leftWindow:$.leftWindow,
rightWindow:$.rightWindow,
leftLedge:80
Expand Down Expand Up @@ -224,7 +248,7 @@ window.open(); //open the app
</TableView>
</Window>

<NavigationGroup id="navgroup">
<NavigationWindow id="navWindow">
<Window id="win">
<LeftNavButton>
<Button title="Left" onClick="openLeft"></Button>
Expand All @@ -238,7 +262,7 @@ window.open(); //open the app
</TableViewRow>
</TableView>
</Window>
</NavigationGroup>
</NavigationWindow>

<Window id="rightWindow">
<TableView id="rightTable">
Expand All @@ -252,6 +276,14 @@ window.open(); //open the app
## Changelog
**v1.4.2**
* iOS7 statusbar updated again. Added `statusBarStyle` to help iOS7 and the LIGHT CONTENT bug. #22
* Added `closeOpenView()`. Thanks to @chrisnharvey. #19
* Added `isLeftViewOpen()` and `isRightViewOpen()`
* Added ability to create the SlideMenu with centerWindow only.
* Added ability to dynamically remove the left or right menu by setting leftWindow or rightWindow as null. Thanks to @nartex
**v1.4.1**
* iOS7 statusbar update
Expand Down
20 changes: 17 additions & 3 deletions example/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ var leftTableView = Ti.UI.createTableView({
{title:'Basic'},
{title:'Basic2'},
{title:'left to right'},
{title:'Change Center Windowr'},
{title:'Default Window'}
{title:'Change Center Window'},
{title:'Default Window'},
{title:'No Side Windows'},
{title:'Close open Window'}
]
});
winLeft.add(leftTableView);
leftTableView.addEventListener("click", function(e){
Ti.API.info("isAnyViewOpen: " + window.isAnyViewOpen());
Ti.API.info("isLeftViewOpen: " + window.isLeftViewOpen());
Ti.API.info("isRightViewOpen: " + window.isRightViewOpen());
switch(e.index){
case 0:
case 1:
Expand All @@ -37,6 +41,15 @@ leftTableView.addEventListener("click", function(e){
window.setCenterWindow(createCenterNavWindow());
window.toggleLeftView(); //animate back to center
break;
case 5:
//remove side windows
window.setLeftWindow(null);
window.setRightWindow(null);
break;
case 6:
//close views
window.closeOpenView();
break;
}
});
////////////////////////////////////////////////
Expand Down Expand Up @@ -158,7 +171,8 @@ var window = NappSlideMenu.createSlideMenuWindow({
centerWindow: navController,
leftWindow:winLeft,
rightWindow:winRight,
leftLedge:150
statusBarStyle: NappSlideMenu.STATUSBAR_WHITE,
leftLedge:100
});

window.addEventListener("viewWillOpen", function(e) {
Expand Down

0 comments on commit 0545045

Please sign in to comment.