Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "ios/MMDrawerController"]
path = ios/MMDrawerController
url = https://mattapperson@github.com/mutualmobile/MMDrawerController
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2010-2013 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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
1 change: 0 additions & 1 deletion android/CHANGELOG.txt

This file was deleted.

1 change: 0 additions & 1 deletion android/LICENSE

This file was deleted.

1 change: 0 additions & 1 deletion android/LICENSE.txt

This file was deleted.

96 changes: 96 additions & 0 deletions ios/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
# BasedOnStyle: WebKit
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: false
AlignOperands: false
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: All
BreakBeforeBraces: WebKit
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 0
CommentPragmas: '^ IWYU pragma:'
BreakBeforeInheritanceComma: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: Inner
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never
...
1 change: 0 additions & 1 deletion ios/CHANGELOG.txt

This file was deleted.

7 changes: 3 additions & 4 deletions ios/Classes/CustomMMDrawerController.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@

typedef void windowAppearanceChange;

@interface CustomMMDrawerController : MMDrawerController
{
void (^_callback)(NSString *state);
@interface CustomMMDrawerController : MMDrawerController {
void (^_callback)(NSString *state);
}

-(void)setWindowAppearanceCallback:(void(^)(NSString*))callback;
- (void)setWindowAppearanceCallback:(void (^)(NSString *))callback;

@end
57 changes: 28 additions & 29 deletions ios/Classes/CustomMMDrawerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,43 +13,42 @@

@implementation CustomMMDrawerController

-(void)openDrawerSide:(MMDrawerSide)drawerSide animated:(BOOL)animated completion:(void (^)(BOOL finished))completion
- (void)openDrawerSide:(MMDrawerSide)drawerSide animated:(BOOL)animated completion:(void (^)(BOOL finished))completion
{
[super openDrawerSide:drawerSide animated:animated completion:^(BOOL finished) {
if (finished){
_callback(@"open");
}
}];
[super openDrawerSide:drawerSide
animated:animated
completion:^(BOOL finished) {
if (finished) {
_callback(@"open");
}
}];
}

-(void)closeDrawerAnimated:(BOOL)animated completion:(void (^)(BOOL finished))completion
- (void)closeDrawerAnimated:(BOOL)animated completion:(void (^)(BOOL finished))completion
{
[super closeDrawerAnimated:animated completion:^(BOOL finished) {
if (finished){
_callback(@"close");
}
}];
[super closeDrawerAnimated:animated
completion:^(BOOL finished) {
if (finished) {
_callback(@"close");
}
}];
}

-(void)setWindowAppearanceCallback:(void(^)(NSString*))callback
- (void)setWindowAppearanceCallback:(void (^)(NSString *))callback
{
_callback = [callback copy];

// add callback for the gestures
[super setGestureCompletionBlock:^(MMDrawerController *controller, UIGestureRecognizer *gesture) {
if(controller.openSide == MMDrawerSideNone){
_callback(@"close");
} else {
_callback(@"open");
}
}];
}
_callback = [callback copy];
__weak __typeof__(self) weakSelf = self;

-(void)dealloc
{
[super dealloc];
[_callback release];
_callback = nil;
// add callback for the gestures
[super setGestureCompletionBlock:^(MMDrawerController *controller, UIGestureRecognizer *gesture) {
__typeof__(self) strongSelf = weakSelf;

if (controller.openSide == MMDrawerSideNone) {
strongSelf->_callback(@"close");
} else {
strongSelf->_callback(@"open");
}
}];
}

@end
45 changes: 23 additions & 22 deletions ios/Classes/DkNappDrawerDrawer.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,38 @@
* and licensed under the Apache Public License (version 2)
*/

#import "TiBase.h"
#import "TiUIView.h"
#import "CustomMMDrawerController.h"
#import "NappDrawerVisualState.h"
#import "TiBase.h"
#import "TiUIView.h"
#import "TiUIiOSNavWindowProxy.h"

#import <QuartzCore/QuartzCore.h>

@interface DkNappDrawerDrawer : TiUIView {
@private
CustomMMDrawerController *controller;
TiUIiOSNavWindowProxy *navProxy;
NSMutableArray* _accessibleElements;
UIView* controllerView_;
UIView* leftView_;
UIView* rightView_;
UIView* centerView_;
@private
CustomMMDrawerController *controller;
TiUIiOSNavWindowProxy *navProxy;

NSMutableArray *_accessibleElements;

UIView *controllerView_;

UIView *leftView_;
UIView *rightView_;
UIView *centerView_;
}

-(CustomMMDrawerController*)controller;
- (CustomMMDrawerController *)controller;

// Public APIs

//API
-(void)toggleLeftWindow:(id)args;
-(void)toggleRightWindow:(id)args;
-(void)bounceLeftWindow:(id)args;
-(void)bounceRightWindow:(id)args;
-(NSNumber*)isAnyWindowOpen:(id)args;
-(NSNumber*)isLeftWindowOpen:(id)args;
-(NSNumber*)isRightWindowOpen:(id)args;
- (void)toggleLeftWindow:(id)args;
- (void)toggleRightWindow:(id)args;
- (void)bounceLeftWindow:(id)args;
- (void)bounceRightWindow:(id)args;
- (NSNumber *)isAnyWindowOpen:(id)args;
- (NSNumber *)isLeftWindowOpen:(id)args;
- (NSNumber *)isRightWindowOpen:(id)args;

@end
Loading