Skip to content

Commit

Permalink
Merge pull request #214 from hansemannn/add-accessibility
Browse files Browse the repository at this point in the history
iOS: Add accessibility, change a few README.md lines
  • Loading branch information
Mads Møller authored Feb 7, 2018
2 parents 7bd41c4 + d7e0f20 commit 5567e5b
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,12 @@ -(id)initWithTarget:(id)target action:(SEL)action{
}
self.action = action;
self.target = target;

// Enable accessibility
self.isAccessibilityElement = YES;
self.accessibilityLabel = NSLocalizedString(@"Menu", nil);
self.accessibilityHint = NSLocalizedString(@"Toggles the menu", nil);

return self;
}
}
Expand Down
51 changes: 28 additions & 23 deletions ios/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ Thanks to the folks at Mutual Mobile for their great work with MMDrawerControlle

Simply add the following lines to your `tiapp.xml` file:

<modules>
<module platform="iphone">dk.napp.drawer</module>
</modules>

```xml
<modules>
<module platform="iphone">dk.napp.drawer</module>
</modules>
```

## Reference

Expand Down Expand Up @@ -50,7 +51,7 @@ var mainWindow = NappDrawerModule.createDrawer({
A method that allow change of a window. You can either use a window or a navigation group.
```javascript
var newWin = Ti.UI.createWindow({
backgroundColor: "#FF0000"
backgroundColor: '#FF0000'
};
mainWindow.setCenterWindow(newWin);
```
Expand All @@ -60,7 +61,6 @@ If you want to remove the side drawer, you can do this be parsing false as the a
mainWindow.setRightWindow(false);
```
### LeftDrawerWidth, rightDrawerWidth
Update the width with these methods. The default width is `280`
Expand Down Expand Up @@ -186,15 +186,16 @@ mainWindow.setOrientationModes([Ti.UI.PORTRAIT, Ti.UI.UPSIDE_PORTRAIT]);
Use this property to set the statusBar. 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>
```xml
<ios>
<plist>
<dict>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
</ios>
```
| input (constant) | Description |
| ----- | ----------- |
Expand All @@ -210,9 +211,9 @@ mainWindow.setStatusBarStyle(NappDrawerModule.STATUSBAR_WHITE);
If your drawer has a rightWindow, you can also set the statusbarStyle off that window, which will automagically apply that style to all of the drawer. This was discovered by Andrea Vitale.
```javascript
rightWindow: Ti.UI.createWindow({
statusBarStyle: Ti.UI.iPhone.StatusBar.LIGHT_CONTENT
}),
rightWindow: Ti.UI.createWindow({
statusBarStyle: Ti.UI.iPhone.StatusBar.LIGHT_CONTENT
});
```
## API Methods
Expand Down Expand Up @@ -248,7 +249,7 @@ mainWindow.isAnyWindowOpen();
When the drawer has been opened.
```javascript
mainWindow.addEventListener("windowDidOpen", function(e) {
mainWindow.addEventListener('windowDidOpen', function(e) {
// Drawer opened
});
```
Expand All @@ -258,7 +259,7 @@ mainWindow.addEventListener("windowDidOpen", function(e) {
When the drawer has been closed.
```javascript
mainWindow.addEventListener("windowDidClose", function(e) {
mainWindow.addEventListener('windowDidClose', function(e) {
// Drawer closed
});
```
Expand All @@ -268,7 +269,7 @@ mainWindow.addEventListener("windowDidClose", function(e) {
When the drawer center window has been focussed.
```javascript
mainWindow.addEventListener("centerWindowDidFocus", function(e) {
mainWindow.addEventListener('centerWindowDidFocus', function(e) {
// Center window focussed
});
```
Expand All @@ -278,12 +279,16 @@ mainWindow.addEventListener("centerWindowDidFocus", function(e) {
When the drawer center window has been blurred.
```javascript
mainWindow.addEventListener("centerWindowDidBlur", function(e) {
mainWindow.addEventListener('centerWindowDidBlur', function(e) {
// Center window blurred
});
```
## Changelog
*v2.1.0
* Added accessibility to the menu buttons (#102)
* v2.0.0
* Major module refactoring (https://github.com/viezel/NappDrawer/pull/211)
Expand Down Expand Up @@ -347,7 +352,7 @@ twitter: @nappdev
## License
Copyright (c) 2010-2013 Mads Møller
Copyright (c) 2010-present Mads Møller
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Binary file added ios/dist/dk.napp.drawer-iphone-2.1.0.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion ios/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 2.0.0
version: 2.1.0
apiversion: 2
architectures: armv7 i386 x86_64 arm64
description: Drawer controller
Expand Down

0 comments on commit 5567e5b

Please sign in to comment.