├── .gitignore
├── .gitmodules
├── .project
├── .settings
└── com.aptana.editor.common.prefs
├── CHANGELOG.txt
├── Classes
├── .gitignore
├── ItSmcDakeyboardcontrolModule.h
├── ItSmcDakeyboardcontrolModule.m
├── ItSmcDakeyboardcontrolModuleAssets.h
├── ItSmcDakeyboardcontrolModuleAssets.m
├── TiViewProxy+KeyboardControl.h
└── TiViewProxy+KeyboardControl.m
├── ItSmcDakeyboardcontrol_Prefix.pch
├── LICENSE
├── README.md
├── TiDAKeyboardControl.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ ├── xcshareddata
│ │ └── TiDAKeyboardControl.xccheckout
│ └── xcuserdata
│ │ └── pier.xcuserdatad
│ │ ├── UserInterfaceState.xcuserstate
│ │ └── WorkspaceSettings.xcsettings
└── xcuserdata
│ └── pier.xcuserdatad
│ ├── xcdebugger
│ └── Breakpoints_v2.xcbkptlist
│ └── xcschemes
│ ├── Build & Test.xcscheme
│ ├── TiDAKeyboardControl.xcscheme
│ └── xcschememanagement.plist
├── assets
└── README
├── build.py
├── documentation
└── index.md
├── example
├── README.md
├── app.js
├── automatic.js
└── manual.js
├── hooks
├── README
├── add.py
├── install.py
├── remove.py
└── uninstall.py
├── launch
├── manifest
├── module.xcconfig
├── platform
└── README
├── timodule.xml
└── titanium.xcconfig
/.gitignore:
--------------------------------------------------------------------------------
1 | tmp
2 | bin
3 | build
4 | *.zip
5 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "DAKeyboardControl"]
2 | path = DAKeyboardControl
3 | url = git@github.com:danielamitay/DAKeyboardControl.git
4 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | TiDAKeyboardControl
4 |
5 |
6 |
7 |
8 |
9 | com.appcelerator.titanium.core.builder
10 |
11 |
12 |
13 |
14 | com.aptana.ide.core.unifiedBuilder
15 |
16 |
17 |
18 |
19 |
20 | com.appcelerator.titanium.mobile.module.nature
21 | com.aptana.projects.webnature
22 |
23 |
24 |
--------------------------------------------------------------------------------
/.settings/com.aptana.editor.common.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | selectUserAgents=com.appcelerator.titanium.mobile.module.nature\:iphone
3 |
--------------------------------------------------------------------------------
/CHANGELOG.txt:
--------------------------------------------------------------------------------
1 | Place your change log text here. This file will be incorporated with your app at package time.
--------------------------------------------------------------------------------
/Classes/.gitignore:
--------------------------------------------------------------------------------
1 | ItSmcDakeyboardcontrol.h
2 | ItSmcDakeyboardcontrol.m
3 |
--------------------------------------------------------------------------------
/Classes/ItSmcDakeyboardcontrolModule.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2014 SMC Treviso s.r.l. All rights reserved.
3 | *
4 | * This library is free software; you can redistribute it and/or modify it under
5 | * the terms of the GNU Lesser General Public License as published by the Free
6 | * Software Foundation; either version 2.1 of the License, or (at your option)
7 | * any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful, but WITHOUT
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 | * details.
13 | *
14 | * Appcelerator Titanium is Copyright (c) 2009-2010 by Appcelerator, Inc.
15 | * and licensed under the Apache Public License (version 2)
16 | */
17 |
18 | #import "TiModule.h"
19 |
20 | @interface ItSmcDakeyboardcontrolModule : TiModule
21 | {
22 | }
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/Classes/ItSmcDakeyboardcontrolModule.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2014 SMC Treviso s.r.l. All rights reserved.
3 | *
4 | * This library is free software; you can redistribute it and/or modify it under
5 | * the terms of the GNU Lesser General Public License as published by the Free
6 | * Software Foundation; either version 2.1 of the License, or (at your option)
7 | * any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful, but WITHOUT
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 | * details.
13 | *
14 | * Appcelerator Titanium is Copyright (c) 2009-2010 by Appcelerator, Inc.
15 | * and licensed under the Apache Public License (version 2)
16 | */
17 |
18 | #import "ItSmcDakeyboardcontrolModule.h"
19 | #import "TiBase.h"
20 | #import "TiHost.h"
21 | #import "TiUtils.h"
22 |
23 | @implementation ItSmcDakeyboardcontrolModule
24 |
25 | #pragma mark Internal
26 |
27 | // this is generated for your module, please do not change it
28 | -(id)moduleGUID
29 | {
30 | return @"1d7767b0-9492-466b-ac7d-7a0d593eec42";
31 | }
32 |
33 | // this is generated for your module, please do not change it
34 | -(NSString*)moduleId
35 | {
36 | return @"it.smc.dakeyboardcontrol";
37 | }
38 |
39 | #pragma mark Lifecycle
40 |
41 | -(void)startup
42 | {
43 | // this method is called when the module is first loaded
44 | // you *must* call the superclass
45 | [super startup];
46 |
47 | NSLog(@"[INFO] %@ loaded",self);
48 | }
49 |
50 | -(void)shutdown:(id)sender
51 | {
52 | // this method is called when the module is being unloaded
53 | // typically this is during shutdown. make sure you don't do too
54 | // much processing here or the app will be quit forceably
55 |
56 | // you *must* call the superclass
57 | [super shutdown:sender];
58 | }
59 |
60 | #pragma mark Cleanup
61 |
62 | -(void)dealloc
63 | {
64 | // release any resources that have been retained by the module
65 | [super dealloc];
66 | }
67 |
68 | #pragma mark Internal Memory Management
69 |
70 | -(void)didReceiveMemoryWarning:(NSNotification*)notification
71 | {
72 | // optionally release any resources that can be dynamically
73 | // reloaded once memory is available - such as caches
74 | [super didReceiveMemoryWarning:notification];
75 | }
76 |
77 | #pragma mark Listener Notifications
78 |
79 | -(void)_listenerAdded:(NSString *)type count:(int)count
80 | {
81 | if (count == 1 && [type isEqualToString:@"my_event"])
82 | {
83 | // the first (of potentially many) listener is being added
84 | // for event named 'my_event'
85 | }
86 | }
87 |
88 | -(void)_listenerRemoved:(NSString *)type count:(int)count
89 | {
90 | if (count == 0 && [type isEqualToString:@"my_event"])
91 | {
92 | // the last listener called for event named 'my_event' has
93 | // been removed, we can optionally clean up any resources
94 | // since no body is listening at this point for that event
95 | }
96 | }
97 |
98 | #pragma Public APIs
99 |
100 | -(id)example:(id)args
101 | {
102 | // example method
103 | return @"hello world";
104 | }
105 |
106 | -(id)exampleProp
107 | {
108 | // example property getter
109 | return @"hello world";
110 | }
111 |
112 | -(void)setExampleProp:(id)value
113 | {
114 | // example property setter
115 | }
116 |
117 | @end
118 |
--------------------------------------------------------------------------------
/Classes/ItSmcDakeyboardcontrolModuleAssets.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2014 SMC Treviso s.r.l. All rights reserved.
3 | *
4 | * This library is free software; you can redistribute it and/or modify it under
5 | * the terms of the GNU Lesser General Public License as published by the Free
6 | * Software Foundation; either version 2.1 of the License, or (at your option)
7 | * any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful, but WITHOUT
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 | * details.
13 | *
14 | * Appcelerator Titanium is Copyright (c) 2009-2010 by Appcelerator, Inc.
15 | * and licensed under the Apache Public License (version 2)
16 | */
17 |
18 | @interface ItSmcDakeyboardcontrolModuleAssets : NSObject
19 | {
20 | }
21 | - (NSData*) moduleAsset;
22 | - (NSData*) resolveModuleAsset:(NSString*)path;
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/Classes/ItSmcDakeyboardcontrolModuleAssets.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2014 SMC Treviso s.r.l. All rights reserved.
3 | *
4 | * This library is free software; you can redistribute it and/or modify it under
5 | * the terms of the GNU Lesser General Public License as published by the Free
6 | * Software Foundation; either version 2.1 of the License, or (at your option)
7 | * any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful, but WITHOUT
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 | * details.
13 | *
14 | * Appcelerator Titanium is Copyright (c) 2009-2010 by Appcelerator, Inc.
15 | * and licensed under the Apache Public License (version 2)
16 | */
17 |
18 | #import "ItSmcDakeyboardcontrolModuleAssets.h"
19 |
20 | extern NSData* filterDataInRange(NSData* thedata, NSRange range);
21 |
22 | @implementation ItSmcDakeyboardcontrolModuleAssets
23 |
24 | - (NSData*) moduleAsset
25 | {
26 | //##TI_AUTOGEN_BEGIN asset
27 | //Compiler generates code for asset here
28 | return nil; // DEFAULT BEHAVIOR
29 | //##TI_AUTOGEN_END asset
30 | }
31 |
32 | - (NSData*) resolveModuleAsset:(NSString*)path
33 | {
34 | //##TI_AUTOGEN_BEGIN resolve_asset
35 | //Compiler generates code for asset resolution here
36 | return nil; // DEFAULT BEHAVIOR
37 | //##TI_AUTOGEN_END resolve_asset
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/Classes/TiViewProxy+KeyboardControl.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2014 SMC Treviso s.r.l. All rights reserved.
3 | *
4 | * This library is free software; you can redistribute it and/or modify it under
5 | * the terms of the GNU Lesser General Public License as published by the Free
6 | * Software Foundation; either version 2.1 of the License, or (at your option)
7 | * any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful, but WITHOUT
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 | * details.
13 | *
14 | * Appcelerator Titanium is Copyright (c) 2009-2010 by Appcelerator, Inc.
15 | * and licensed under the Apache Public License (version 2)
16 | */
17 |
18 |
19 | @interface TiViewProxy (KeyboardControl)
20 |
21 |
22 | - (void)setKeyboardPanning:(id)args;
23 |
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/Classes/TiViewProxy+KeyboardControl.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2014 SMC Treviso s.r.l. All rights reserved.
3 | *
4 | * This library is free software; you can redistribute it and/or modify it under
5 | * the terms of the GNU Lesser General Public License as published by the Free
6 | * Software Foundation; either version 2.1 of the License, or (at your option)
7 | * any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful, but WITHOUT
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 | * details.
13 | *
14 | * Appcelerator Titanium is Copyright (c) 2009-2010 by Appcelerator, Inc.
15 | * and licensed under the Apache Public License (version 2)
16 | */
17 |
18 |
19 | #import "TiBase.h"
20 | #import "TiComplexValue.h"
21 | #import "Ti2DMatrix.h"
22 | #import "TiViewProxy.h"
23 | #import "TiViewProxy+KeyboardControl.h"
24 | #import "DAKeyboardControl.h"
25 |
26 |
27 | @implementation TiViewProxy (KeyboardControl)
28 |
29 |
30 | DEFINE_DEF_PROP(lockedViews, nil);
31 |
32 |
33 | - (void)setKeyboardPanning:(id)args
34 | {
35 | ENSURE_UI_THREAD(setKeyboardPanning, args);
36 |
37 | BOOL oldValue = [self keyboardPanning];
38 | BOOL newValue = [TiUtils boolValue:args def:NO];
39 |
40 | [self replaceValue:[NSNumber numberWithBool:newValue]
41 | forKey:@"keyboardPanning"
42 | notification:NO];
43 |
44 | if (newValue && !oldValue)
45 | {
46 | [self setupKeyboardPanning];
47 | }
48 | else if (!newValue && oldValue)
49 | {
50 | [self teardownKeyboardPanning];
51 | }
52 | }
53 |
54 |
55 | - (BOOL)keyboardPanning
56 | {
57 | id value = [self valueForUndefinedKey:@"keyboardPanning"];
58 | if (value == nil || value == [NSNull null] || ![value respondsToSelector:@selector(boolValue)])
59 | {
60 | return NO;
61 | }
62 | else
63 | {
64 | return [value boolValue];
65 | }
66 | }
67 |
68 |
69 | - (void)setupKeyboardPanning
70 | {
71 | [self replaceValue:self.view
72 | forKey:@"keyboardPanningView"
73 | notification:NO];
74 |
75 | [self.view addKeyboardPanningWithActionHandler:^(CGRect keyboardFrameInView) {
76 | [self updateKeyboardPanningLockedViews:keyboardFrameInView];
77 | [self fireEventForKeyboardFrameInView:keyboardFrameInView];
78 | }];
79 | }
80 |
81 |
82 | - (void)teardownKeyboardPanning
83 | {
84 | TiUIView * panningView = [self valueForKey:@"keyboardPanningView"];
85 | [panningView removeKeyboardControl];
86 | }
87 |
88 |
89 | - (void)fireEventForKeyboardFrameInView:(CGRect)keyboardFrameInView
90 | {
91 | if (![self _hasListeners:@"keyboardchange"]) {
92 | return;
93 | }
94 |
95 | NSNumber * keyboardWidth = [NSNumber numberWithFloat:keyboardFrameInView.size.width];
96 | NSNumber * keyboardHeight = [NSNumber numberWithFloat:keyboardFrameInView.size.height];
97 | NSNumber * keyboardX = [NSNumber numberWithFloat:keyboardFrameInView.origin.x];
98 | NSNumber * keyboardY = [NSNumber numberWithFloat:keyboardFrameInView.origin.y];
99 |
100 | NSMutableDictionary * event = [NSMutableDictionary dictionary];
101 |
102 | [event setValue:keyboardHeight
103 | forKey:@"height"];
104 |
105 | [event setValue:keyboardWidth
106 | forKey:@"width"];
107 |
108 | [event setValue:keyboardX
109 | forKey:@"x"];
110 |
111 | [event setValue:keyboardY
112 | forKey:@"y"];
113 |
114 | [self fireEvent:@"keyboardchange" withObject:event];
115 | }
116 |
117 |
118 | - (void)updateKeyboardPanningLockedViews:(CGRect)keyboardFrameInView
119 | {
120 | ENSURE_UI_THREAD(updateKeyboardPanningLockedViews, keyboardFrameInView);
121 |
122 | NSArray * lockedViews = [self lockedViews];
123 |
124 | ENSURE_TYPE_OR_NIL(lockedViews, NSArray);
125 |
126 | if (lockedViews == nil || [lockedViews count] == 0)
127 | {
128 | return;
129 | }
130 |
131 | float keyboardHeight = keyboardFrameInView.size.height;
132 | float keyboardY = keyboardFrameInView.origin.y;
133 | float height = self.view.frame.size.height;
134 |
135 | float shift = keyboardHeight <= 0 ? 0 : (height - keyboardY);
136 |
137 | for (TiViewProxy * proxy in lockedViews) {
138 | if (proxy != nil)
139 | {
140 | [self updateKeyboardPanningLockedView:proxy with:shift];
141 | }
142 | }
143 | }
144 |
145 |
146 | - (void)updateKeyboardPanningLockedView:(TiViewProxy *)proxy with:(float)shift
147 | {
148 | TiUIView * proxyView = [proxy view];
149 |
150 | CGAffineTransform transform = CGAffineTransformMakeTranslation(0.0f, -shift);
151 |
152 | Ti2DMatrix * matrix = [[Ti2DMatrix alloc] initWithMatrix:transform];
153 |
154 | [proxy replaceValue:matrix forKey:@"transform" notification:YES];
155 | [proxyView setTransform_:matrix];
156 | }
157 |
158 |
159 | - (void)setKeyboardTriggerOffset:(id)args
160 | {
161 | float offset = [TiUtils floatValue:args def:0.0f];
162 | self.view.keyboardTriggerOffset = offset;
163 | }
164 |
165 |
166 | @end
167 |
--------------------------------------------------------------------------------
/ItSmcDakeyboardcontrol_Prefix.pch:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __OBJC__
3 | #import
4 | #endif
5 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU LESSER GENERAL PUBLIC LICENSE
2 | Version 2.1, February 1999
3 |
4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc.
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | (This is the first released version of the Lesser GPL. It also counts
10 | as the successor of the GNU Library Public License, version 2, hence
11 | the version number 2.1.)
12 |
13 | Preamble
14 |
15 | The licenses for most software are designed to take away your
16 | freedom to share and change it. By contrast, the GNU General Public
17 | Licenses are intended to guarantee your freedom to share and change
18 | free software--to make sure the software is free for all its users.
19 |
20 | This license, the Lesser General Public License, applies to some
21 | specially designated software packages--typically libraries--of the
22 | Free Software Foundation and other authors who decide to use it. You
23 | can use it too, but we suggest you first think carefully about whether
24 | this license or the ordinary General Public License is the better
25 | strategy to use in any particular case, based on the explanations below.
26 |
27 | When we speak of free software, we are referring to freedom of use,
28 | not price. Our General Public Licenses are designed to make sure that
29 | you have the freedom to distribute copies of free software (and charge
30 | for this service if you wish); that you receive source code or can get
31 | it if you want it; that you can change the software and use pieces of
32 | it in new free programs; and that you are informed that you can do
33 | these things.
34 |
35 | To protect your rights, we need to make restrictions that forbid
36 | distributors to deny you these rights or to ask you to surrender these
37 | rights. These restrictions translate to certain responsibilities for
38 | you if you distribute copies of the library or if you modify it.
39 |
40 | For example, if you distribute copies of the library, whether gratis
41 | or for a fee, you must give the recipients all the rights that we gave
42 | you. You must make sure that they, too, receive or can get the source
43 | code. If you link other code with the library, you must provide
44 | complete object files to the recipients, so that they can relink them
45 | with the library after making changes to the library and recompiling
46 | it. And you must show them these terms so they know their rights.
47 |
48 | We protect your rights with a two-step method: (1) we copyright the
49 | library, and (2) we offer you this license, which gives you legal
50 | permission to copy, distribute and/or modify the library.
51 |
52 | To protect each distributor, we want to make it very clear that
53 | there is no warranty for the free library. Also, if the library is
54 | modified by someone else and passed on, the recipients should know
55 | that what they have is not the original version, so that the original
56 | author's reputation will not be affected by problems that might be
57 | introduced by others.
58 |
59 | Finally, software patents pose a constant threat to the existence of
60 | any free program. We wish to make sure that a company cannot
61 | effectively restrict the users of a free program by obtaining a
62 | restrictive license from a patent holder. Therefore, we insist that
63 | any patent license obtained for a version of the library must be
64 | consistent with the full freedom of use specified in this license.
65 |
66 | Most GNU software, including some libraries, is covered by the
67 | ordinary GNU General Public License. This license, the GNU Lesser
68 | General Public License, applies to certain designated libraries, and
69 | is quite different from the ordinary General Public License. We use
70 | this license for certain libraries in order to permit linking those
71 | libraries into non-free programs.
72 |
73 | When a program is linked with a library, whether statically or using
74 | a shared library, the combination of the two is legally speaking a
75 | combined work, a derivative of the original library. The ordinary
76 | General Public License therefore permits such linking only if the
77 | entire combination fits its criteria of freedom. The Lesser General
78 | Public License permits more lax criteria for linking other code with
79 | the library.
80 |
81 | We call this license the "Lesser" General Public License because it
82 | does Less to protect the user's freedom than the ordinary General
83 | Public License. It also provides other free software developers Less
84 | of an advantage over competing non-free programs. These disadvantages
85 | are the reason we use the ordinary General Public License for many
86 | libraries. However, the Lesser license provides advantages in certain
87 | special circumstances.
88 |
89 | For example, on rare occasions, there may be a special need to
90 | encourage the widest possible use of a certain library, so that it becomes
91 | a de-facto standard. To achieve this, non-free programs must be
92 | allowed to use the library. A more frequent case is that a free
93 | library does the same job as widely used non-free libraries. In this
94 | case, there is little to gain by limiting the free library to free
95 | software only, so we use the Lesser General Public License.
96 |
97 | In other cases, permission to use a particular library in non-free
98 | programs enables a greater number of people to use a large body of
99 | free software. For example, permission to use the GNU C Library in
100 | non-free programs enables many more people to use the whole GNU
101 | operating system, as well as its variant, the GNU/Linux operating
102 | system.
103 |
104 | Although the Lesser General Public License is Less protective of the
105 | users' freedom, it does ensure that the user of a program that is
106 | linked with the Library has the freedom and the wherewithal to run
107 | that program using a modified version of the Library.
108 |
109 | The precise terms and conditions for copying, distribution and
110 | modification follow. Pay close attention to the difference between a
111 | "work based on the library" and a "work that uses the library". The
112 | former contains code derived from the library, whereas the latter must
113 | be combined with the library in order to run.
114 |
115 | GNU LESSER GENERAL PUBLIC LICENSE
116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
117 |
118 | 0. This License Agreement applies to any software library or other
119 | program which contains a notice placed by the copyright holder or
120 | other authorized party saying it may be distributed under the terms of
121 | this Lesser General Public License (also called "this License").
122 | Each licensee is addressed as "you".
123 |
124 | A "library" means a collection of software functions and/or data
125 | prepared so as to be conveniently linked with application programs
126 | (which use some of those functions and data) to form executables.
127 |
128 | The "Library", below, refers to any such software library or work
129 | which has been distributed under these terms. A "work based on the
130 | Library" means either the Library or any derivative work under
131 | copyright law: that is to say, a work containing the Library or a
132 | portion of it, either verbatim or with modifications and/or translated
133 | straightforwardly into another language. (Hereinafter, translation is
134 | included without limitation in the term "modification".)
135 |
136 | "Source code" for a work means the preferred form of the work for
137 | making modifications to it. For a library, complete source code means
138 | all the source code for all modules it contains, plus any associated
139 | interface definition files, plus the scripts used to control compilation
140 | and installation of the library.
141 |
142 | Activities other than copying, distribution and modification are not
143 | covered by this License; they are outside its scope. The act of
144 | running a program using the Library is not restricted, and output from
145 | such a program is covered only if its contents constitute a work based
146 | on the Library (independent of the use of the Library in a tool for
147 | writing it). Whether that is true depends on what the Library does
148 | and what the program that uses the Library does.
149 |
150 | 1. You may copy and distribute verbatim copies of the Library's
151 | complete source code as you receive it, in any medium, provided that
152 | you conspicuously and appropriately publish on each copy an
153 | appropriate copyright notice and disclaimer of warranty; keep intact
154 | all the notices that refer to this License and to the absence of any
155 | warranty; and distribute a copy of this License along with the
156 | Library.
157 |
158 | You may charge a fee for the physical act of transferring a copy,
159 | and you may at your option offer warranty protection in exchange for a
160 | fee.
161 |
162 | 2. You may modify your copy or copies of the Library or any portion
163 | of it, thus forming a work based on the Library, and copy and
164 | distribute such modifications or work under the terms of Section 1
165 | above, provided that you also meet all of these conditions:
166 |
167 | a) The modified work must itself be a software library.
168 |
169 | b) You must cause the files modified to carry prominent notices
170 | stating that you changed the files and the date of any change.
171 |
172 | c) You must cause the whole of the work to be licensed at no
173 | charge to all third parties under the terms of this License.
174 |
175 | d) If a facility in the modified Library refers to a function or a
176 | table of data to be supplied by an application program that uses
177 | the facility, other than as an argument passed when the facility
178 | is invoked, then you must make a good faith effort to ensure that,
179 | in the event an application does not supply such function or
180 | table, the facility still operates, and performs whatever part of
181 | its purpose remains meaningful.
182 |
183 | (For example, a function in a library to compute square roots has
184 | a purpose that is entirely well-defined independent of the
185 | application. Therefore, Subsection 2d requires that any
186 | application-supplied function or table used by this function must
187 | be optional: if the application does not supply it, the square
188 | root function must still compute square roots.)
189 |
190 | These requirements apply to the modified work as a whole. If
191 | identifiable sections of that work are not derived from the Library,
192 | and can be reasonably considered independent and separate works in
193 | themselves, then this License, and its terms, do not apply to those
194 | sections when you distribute them as separate works. But when you
195 | distribute the same sections as part of a whole which is a work based
196 | on the Library, the distribution of the whole must be on the terms of
197 | this License, whose permissions for other licensees extend to the
198 | entire whole, and thus to each and every part regardless of who wrote
199 | it.
200 |
201 | Thus, it is not the intent of this section to claim rights or contest
202 | your rights to work written entirely by you; rather, the intent is to
203 | exercise the right to control the distribution of derivative or
204 | collective works based on the Library.
205 |
206 | In addition, mere aggregation of another work not based on the Library
207 | with the Library (or with a work based on the Library) on a volume of
208 | a storage or distribution medium does not bring the other work under
209 | the scope of this License.
210 |
211 | 3. You may opt to apply the terms of the ordinary GNU General Public
212 | License instead of this License to a given copy of the Library. To do
213 | this, you must alter all the notices that refer to this License, so
214 | that they refer to the ordinary GNU General Public License, version 2,
215 | instead of to this License. (If a newer version than version 2 of the
216 | ordinary GNU General Public License has appeared, then you can specify
217 | that version instead if you wish.) Do not make any other change in
218 | these notices.
219 |
220 | Once this change is made in a given copy, it is irreversible for
221 | that copy, so the ordinary GNU General Public License applies to all
222 | subsequent copies and derivative works made from that copy.
223 |
224 | This option is useful when you wish to copy part of the code of
225 | the Library into a program that is not a library.
226 |
227 | 4. You may copy and distribute the Library (or a portion or
228 | derivative of it, under Section 2) in object code or executable form
229 | under the terms of Sections 1 and 2 above provided that you accompany
230 | it with the complete corresponding machine-readable source code, which
231 | must be distributed under the terms of Sections 1 and 2 above on a
232 | medium customarily used for software interchange.
233 |
234 | If distribution of object code is made by offering access to copy
235 | from a designated place, then offering equivalent access to copy the
236 | source code from the same place satisfies the requirement to
237 | distribute the source code, even though third parties are not
238 | compelled to copy the source along with the object code.
239 |
240 | 5. A program that contains no derivative of any portion of the
241 | Library, but is designed to work with the Library by being compiled or
242 | linked with it, is called a "work that uses the Library". Such a
243 | work, in isolation, is not a derivative work of the Library, and
244 | therefore falls outside the scope of this License.
245 |
246 | However, linking a "work that uses the Library" with the Library
247 | creates an executable that is a derivative of the Library (because it
248 | contains portions of the Library), rather than a "work that uses the
249 | library". The executable is therefore covered by this License.
250 | Section 6 states terms for distribution of such executables.
251 |
252 | When a "work that uses the Library" uses material from a header file
253 | that is part of the Library, the object code for the work may be a
254 | derivative work of the Library even though the source code is not.
255 | Whether this is true is especially significant if the work can be
256 | linked without the Library, or if the work is itself a library. The
257 | threshold for this to be true is not precisely defined by law.
258 |
259 | If such an object file uses only numerical parameters, data
260 | structure layouts and accessors, and small macros and small inline
261 | functions (ten lines or less in length), then the use of the object
262 | file is unrestricted, regardless of whether it is legally a derivative
263 | work. (Executables containing this object code plus portions of the
264 | Library will still fall under Section 6.)
265 |
266 | Otherwise, if the work is a derivative of the Library, you may
267 | distribute the object code for the work under the terms of Section 6.
268 | Any executables containing that work also fall under Section 6,
269 | whether or not they are linked directly with the Library itself.
270 |
271 | 6. As an exception to the Sections above, you may also combine or
272 | link a "work that uses the Library" with the Library to produce a
273 | work containing portions of the Library, and distribute that work
274 | under terms of your choice, provided that the terms permit
275 | modification of the work for the customer's own use and reverse
276 | engineering for debugging such modifications.
277 |
278 | You must give prominent notice with each copy of the work that the
279 | Library is used in it and that the Library and its use are covered by
280 | this License. You must supply a copy of this License. If the work
281 | during execution displays copyright notices, you must include the
282 | copyright notice for the Library among them, as well as a reference
283 | directing the user to the copy of this License. Also, you must do one
284 | of these things:
285 |
286 | a) Accompany the work with the complete corresponding
287 | machine-readable source code for the Library including whatever
288 | changes were used in the work (which must be distributed under
289 | Sections 1 and 2 above); and, if the work is an executable linked
290 | with the Library, with the complete machine-readable "work that
291 | uses the Library", as object code and/or source code, so that the
292 | user can modify the Library and then relink to produce a modified
293 | executable containing the modified Library. (It is understood
294 | that the user who changes the contents of definitions files in the
295 | Library will not necessarily be able to recompile the application
296 | to use the modified definitions.)
297 |
298 | b) Use a suitable shared library mechanism for linking with the
299 | Library. A suitable mechanism is one that (1) uses at run time a
300 | copy of the library already present on the user's computer system,
301 | rather than copying library functions into the executable, and (2)
302 | will operate properly with a modified version of the library, if
303 | the user installs one, as long as the modified version is
304 | interface-compatible with the version that the work was made with.
305 |
306 | c) Accompany the work with a written offer, valid for at
307 | least three years, to give the same user the materials
308 | specified in Subsection 6a, above, for a charge no more
309 | than the cost of performing this distribution.
310 |
311 | d) If distribution of the work is made by offering access to copy
312 | from a designated place, offer equivalent access to copy the above
313 | specified materials from the same place.
314 |
315 | e) Verify that the user has already received a copy of these
316 | materials or that you have already sent this user a copy.
317 |
318 | For an executable, the required form of the "work that uses the
319 | Library" must include any data and utility programs needed for
320 | reproducing the executable from it. However, as a special exception,
321 | the materials to be distributed need not include anything that is
322 | normally distributed (in either source or binary form) with the major
323 | components (compiler, kernel, and so on) of the operating system on
324 | which the executable runs, unless that component itself accompanies
325 | the executable.
326 |
327 | It may happen that this requirement contradicts the license
328 | restrictions of other proprietary libraries that do not normally
329 | accompany the operating system. Such a contradiction means you cannot
330 | use both them and the Library together in an executable that you
331 | distribute.
332 |
333 | 7. You may place library facilities that are a work based on the
334 | Library side-by-side in a single library together with other library
335 | facilities not covered by this License, and distribute such a combined
336 | library, provided that the separate distribution of the work based on
337 | the Library and of the other library facilities is otherwise
338 | permitted, and provided that you do these two things:
339 |
340 | a) Accompany the combined library with a copy of the same work
341 | based on the Library, uncombined with any other library
342 | facilities. This must be distributed under the terms of the
343 | Sections above.
344 |
345 | b) Give prominent notice with the combined library of the fact
346 | that part of it is a work based on the Library, and explaining
347 | where to find the accompanying uncombined form of the same work.
348 |
349 | 8. You may not copy, modify, sublicense, link with, or distribute
350 | the Library except as expressly provided under this License. Any
351 | attempt otherwise to copy, modify, sublicense, link with, or
352 | distribute the Library is void, and will automatically terminate your
353 | rights under this License. However, parties who have received copies,
354 | or rights, from you under this License will not have their licenses
355 | terminated so long as such parties remain in full compliance.
356 |
357 | 9. You are not required to accept this License, since you have not
358 | signed it. However, nothing else grants you permission to modify or
359 | distribute the Library or its derivative works. These actions are
360 | prohibited by law if you do not accept this License. Therefore, by
361 | modifying or distributing the Library (or any work based on the
362 | Library), you indicate your acceptance of this License to do so, and
363 | all its terms and conditions for copying, distributing or modifying
364 | the Library or works based on it.
365 |
366 | 10. Each time you redistribute the Library (or any work based on the
367 | Library), the recipient automatically receives a license from the
368 | original licensor to copy, distribute, link with or modify the Library
369 | subject to these terms and conditions. You may not impose any further
370 | restrictions on the recipients' exercise of the rights granted herein.
371 | You are not responsible for enforcing compliance by third parties with
372 | this License.
373 |
374 | 11. If, as a consequence of a court judgment or allegation of patent
375 | infringement or for any other reason (not limited to patent issues),
376 | conditions are imposed on you (whether by court order, agreement or
377 | otherwise) that contradict the conditions of this License, they do not
378 | excuse you from the conditions of this License. If you cannot
379 | distribute so as to satisfy simultaneously your obligations under this
380 | License and any other pertinent obligations, then as a consequence you
381 | may not distribute the Library at all. For example, if a patent
382 | license would not permit royalty-free redistribution of the Library by
383 | all those who receive copies directly or indirectly through you, then
384 | the only way you could satisfy both it and this License would be to
385 | refrain entirely from distribution of the Library.
386 |
387 | If any portion of this section is held invalid or unenforceable under any
388 | particular circumstance, the balance of the section is intended to apply,
389 | and the section as a whole is intended to apply in other circumstances.
390 |
391 | It is not the purpose of this section to induce you to infringe any
392 | patents or other property right claims or to contest validity of any
393 | such claims; this section has the sole purpose of protecting the
394 | integrity of the free software distribution system which is
395 | implemented by public license practices. Many people have made
396 | generous contributions to the wide range of software distributed
397 | through that system in reliance on consistent application of that
398 | system; it is up to the author/donor to decide if he or she is willing
399 | to distribute software through any other system and a licensee cannot
400 | impose that choice.
401 |
402 | This section is intended to make thoroughly clear what is believed to
403 | be a consequence of the rest of this License.
404 |
405 | 12. If the distribution and/or use of the Library is restricted in
406 | certain countries either by patents or by copyrighted interfaces, the
407 | original copyright holder who places the Library under this License may add
408 | an explicit geographical distribution limitation excluding those countries,
409 | so that distribution is permitted only in or among countries not thus
410 | excluded. In such case, this License incorporates the limitation as if
411 | written in the body of this License.
412 |
413 | 13. The Free Software Foundation may publish revised and/or new
414 | versions of the Lesser General Public License from time to time.
415 | Such new versions will be similar in spirit to the present version,
416 | but may differ in detail to address new problems or concerns.
417 |
418 | Each version is given a distinguishing version number. If the Library
419 | specifies a version number of this License which applies to it and
420 | "any later version", you have the option of following the terms and
421 | conditions either of that version or of any later version published by
422 | the Free Software Foundation. If the Library does not specify a
423 | license version number, you may choose any version ever published by
424 | the Free Software Foundation.
425 |
426 | 14. If you wish to incorporate parts of the Library into other free
427 | programs whose distribution conditions are incompatible with these,
428 | write to the author to ask for permission. For software which is
429 | copyrighted by the Free Software Foundation, write to the Free
430 | Software Foundation; we sometimes make exceptions for this. Our
431 | decision will be guided by the two goals of preserving the free status
432 | of all derivatives of our free software and of promoting the sharing
433 | and reuse of software generally.
434 |
435 | NO WARRANTY
436 |
437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
446 |
447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
456 | DAMAGES.
457 |
458 | END OF TERMS AND CONDITIONS
459 |
460 | How to Apply These Terms to Your New Libraries
461 |
462 | If you develop a new library, and you want it to be of the greatest
463 | possible use to the public, we recommend making it free software that
464 | everyone can redistribute and change. You can do so by permitting
465 | redistribution under these terms (or, alternatively, under the terms of the
466 | ordinary General Public License).
467 |
468 | To apply these terms, attach the following notices to the library. It is
469 | safest to attach them to the start of each source file to most effectively
470 | convey the exclusion of warranty; and each file should have at least the
471 | "copyright" line and a pointer to where the full notice is found.
472 |
473 | {description}
474 | Copyright (C) {year} {fullname}
475 |
476 | This library is free software; you can redistribute it and/or
477 | modify it under the terms of the GNU Lesser General Public
478 | License as published by the Free Software Foundation; either
479 | version 2.1 of the License, or (at your option) any later version.
480 |
481 | This library is distributed in the hope that it will be useful,
482 | but WITHOUT ANY WARRANTY; without even the implied warranty of
483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
484 | Lesser General Public License for more details.
485 |
486 | You should have received a copy of the GNU Lesser General Public
487 | License along with this library; if not, write to the Free Software
488 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
489 |
490 | Also add information on how to contact you by electronic and paper mail.
491 |
492 | You should also get your employer (if you work as a programmer) or your
493 | school, if any, to sign a "copyright disclaimer" for the library, if
494 | necessary. Here is a sample; alter the names:
495 |
496 | Yoyodyne, Inc., hereby disclaims all copyright interest in the
497 | library `Frob' (a library for tweaking knobs) written by James Random Hacker.
498 |
499 | {signature of Ty Coon}, 1 April 1990
500 | Ty Coon, President of Vice
501 |
502 | That's all there is to it!
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | TiDAKeyboardControl
2 | ===================
3 |
4 | [![Built for Titanium SDK][ti-badge]][ti]
5 | [![Available through gitTio][gittio-badge]][gittio-page]
6 |
7 | [ti-badge]: http://www-static.appcelerator.com/badges/titanium-git-badge-sq.png
8 | [ti]: http://www.appcelerator.com/titanium/
9 | [gittio-badge]: http://gitt.io/badge.png
10 | [gittio-page]: http://gitt.io/component/it.smc.dakeyboardcontrol
11 |
12 | Do you want to create a perfect clone of the iMessage compose interface? ***Fear no more!*** You can now respond to keyboard events (show, hide, and realtime interactive changes) and customize how much space will be used as an offset during interactive panning.
13 |
14 | Titanium SDK wrapper for the awesome [DAKeyboardControl][dakc] from [@danielamitay][da]! (iOS only)
15 |
16 | ### Installation
17 |
18 | You can install this module using [gitTio][gittio-cli] with
19 |
20 | gittio install it.smc.dakeyboardcontrol
21 |
22 | Alternatively you can [download a specific release][rls] for manual installation.
23 |
24 | [rls]: https://github.com/smclab/TiDAKeyboardControl/releases
25 | [gittio-cli]: http://gitt.io/cli
26 |
27 | ### Example
28 |
29 | You can run the example running the following command
30 |
31 | gittio demo it.smc.dakeyboardcontrol
32 |
33 | The source for this demo application can be found in [the `example` folder][exm].
34 |
35 | [exm]: https://github.com/smclab/TiDAKeyboardControl/tree/master/example
36 |
37 |
38 | Usage overview
39 | --------------
40 |
41 | ```js
42 | var textarea = Ti.UI.createTextArea({
43 | right: 0,
44 | bottom: 0,
45 | left: 0,
46 | scrollable: false,
47 | suppressReturn: false,
48 | height: Ti.UI.SIZE,
49 | });
50 |
51 | var window = Ti.UI.createWindow({
52 | // How much space must be took on top of the keyboard
53 | keyboardTriggerOffset: 0,
54 | // This activates the panning feature
55 | keyboardPanning: true,
56 | // Automatically add the textarea as a locked view
57 | lockedViews: [ textarea ]
58 | });
59 |
60 | window.addEventListener('close', function (event) {
61 | // Very important! Releases what needs to be released
62 | event.source.keyboardPanning = false;
63 | });
64 |
65 | window.add(textarea);
66 |
67 | // The window is now the host for keyboard events
68 | window.addEventListener('keyboardchange', function (event) {
69 | Ti.API.error("Notification of keyboard change: y=" + event.y + " height="+event.height);
70 | });
71 |
72 | // Multiline text-area
73 | textarea.addEventListener('postlayout', function (event) {
74 | window.keyboardTriggerOffset = event.source.rect.height;
75 | });
76 |
77 | window.open();
78 | ```
79 |
80 |
81 | Credits
82 | -------
83 |
84 | Kudos to @danielamitay for the development of DAKeyboardControl.
85 |
86 | Humbly made by the spry ladies and gents at SMC.
87 |
88 |
89 | [dakc]: https://github.com/danielamitay/DAKeyboardControl
90 | [da]: http://danielamitay.com
91 |
92 |
93 | License
94 | -------
95 |
96 | This library, *TiDAKeyboardControl*, is free software ("Licensed Software"); you can
97 | redistribute it and/or modify it under the terms of the [GNU Lesser General
98 | Public License](http://www.gnu.org/licenses/lgpl-2.1.html) as published by the
99 | Free Software Foundation; either version 2.1 of the License, or (at your
100 | option) any later version.
101 |
102 | This library is distributed in the hope that it will be useful, but WITHOUT ANY
103 | WARRANTY; including but not limited to, the implied warranty of MERCHANTABILITY,
104 | NONINFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
105 | Public License for more details.
106 |
107 | You should have received a copy of the [GNU Lesser General Public
108 | License](http://www.gnu.org/licenses/lgpl-2.1.html) along with this library; if
109 | not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
110 | Floor, Boston, MA 02110-1301 USA
111 |
--------------------------------------------------------------------------------
/TiDAKeyboardControl.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXAggregateTarget section */
10 | 24416B8111C4CA220047AFDD /* Build & Test */ = {
11 | isa = PBXAggregateTarget;
12 | buildConfigurationList = 24416B8A11C4CA520047AFDD /* Build configuration list for PBXAggregateTarget "Build & Test" */;
13 | buildPhases = (
14 | 24416B8011C4CA220047AFDD /* ShellScript */,
15 | );
16 | dependencies = (
17 | 24416B8511C4CA280047AFDD /* PBXTargetDependency */,
18 | );
19 | name = "Build & Test";
20 | productName = "Build & test";
21 | };
22 | /* End PBXAggregateTarget section */
23 |
24 | /* Begin PBXBuildFile section */
25 | 24DD6CF91134B3F500162E58 /* ItSmcDakeyboardcontrolModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 24DD6CF71134B3F500162E58 /* ItSmcDakeyboardcontrolModule.h */; };
26 | 24DD6CFA1134B3F500162E58 /* ItSmcDakeyboardcontrolModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 24DD6CF81134B3F500162E58 /* ItSmcDakeyboardcontrolModule.m */; };
27 | 24DE9E1111C5FE74003F90F6 /* ItSmcDakeyboardcontrolModuleAssets.h in Headers */ = {isa = PBXBuildFile; fileRef = 24DE9E0F11C5FE74003F90F6 /* ItSmcDakeyboardcontrolModuleAssets.h */; };
28 | 24DE9E1211C5FE74003F90F6 /* ItSmcDakeyboardcontrolModuleAssets.m in Sources */ = {isa = PBXBuildFile; fileRef = 24DE9E1011C5FE74003F90F6 /* ItSmcDakeyboardcontrolModuleAssets.m */; };
29 | 96C68C141897A4F7005FEC06 /* DAKeyboardControl.h in Headers */ = {isa = PBXBuildFile; fileRef = 96C68C121897A4F7005FEC06 /* DAKeyboardControl.h */; };
30 | 96C68C151897A4F7005FEC06 /* DAKeyboardControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 96C68C131897A4F7005FEC06 /* DAKeyboardControl.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; };
31 | 96C68C181897A645005FEC06 /* TiViewProxy+KeyboardControl.h in Headers */ = {isa = PBXBuildFile; fileRef = 96C68C161897A645005FEC06 /* TiViewProxy+KeyboardControl.h */; };
32 | 96C68C191897A645005FEC06 /* TiViewProxy+KeyboardControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 96C68C171897A645005FEC06 /* TiViewProxy+KeyboardControl.m */; };
33 | AA747D9F0F9514B9006C5449 /* ItSmcDakeyboardcontrol_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = AA747D9E0F9514B9006C5449 /* ItSmcDakeyboardcontrol_Prefix.pch */; };
34 | AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACBBE490F95108600F1A2B1 /* Foundation.framework */; };
35 | /* End PBXBuildFile section */
36 |
37 | /* Begin PBXContainerItemProxy section */
38 | 24416B8411C4CA280047AFDD /* PBXContainerItemProxy */ = {
39 | isa = PBXContainerItemProxy;
40 | containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
41 | proxyType = 1;
42 | remoteGlobalIDString = D2AAC07D0554694100DB518D;
43 | remoteInfo = TiDAKeyboardControl;
44 | };
45 | /* End PBXContainerItemProxy section */
46 |
47 | /* Begin PBXFileReference section */
48 | 24DD6CF71134B3F500162E58 /* ItSmcDakeyboardcontrolModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ItSmcDakeyboardcontrolModule.h; path = Classes/ItSmcDakeyboardcontrolModule.h; sourceTree = ""; };
49 | 24DD6CF81134B3F500162E58 /* ItSmcDakeyboardcontrolModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ItSmcDakeyboardcontrolModule.m; path = Classes/ItSmcDakeyboardcontrolModule.m; sourceTree = ""; };
50 | 24DD6D1B1134B66800162E58 /* titanium.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = titanium.xcconfig; sourceTree = ""; };
51 | 24DE9E0F11C5FE74003F90F6 /* ItSmcDakeyboardcontrolModuleAssets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ItSmcDakeyboardcontrolModuleAssets.h; path = Classes/ItSmcDakeyboardcontrolModuleAssets.h; sourceTree = ""; };
52 | 24DE9E1011C5FE74003F90F6 /* ItSmcDakeyboardcontrolModuleAssets.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ItSmcDakeyboardcontrolModuleAssets.m; path = Classes/ItSmcDakeyboardcontrolModuleAssets.m; sourceTree = ""; };
53 | 96C68C121897A4F7005FEC06 /* DAKeyboardControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DAKeyboardControl.h; sourceTree = ""; };
54 | 96C68C131897A4F7005FEC06 /* DAKeyboardControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DAKeyboardControl.m; sourceTree = ""; };
55 | 96C68C161897A645005FEC06 /* TiViewProxy+KeyboardControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "TiViewProxy+KeyboardControl.h"; path = "Classes/TiViewProxy+KeyboardControl.h"; sourceTree = ""; };
56 | 96C68C171897A645005FEC06 /* TiViewProxy+KeyboardControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "TiViewProxy+KeyboardControl.m"; path = "Classes/TiViewProxy+KeyboardControl.m"; sourceTree = ""; };
57 | AA747D9E0F9514B9006C5449 /* ItSmcDakeyboardcontrol_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ItSmcDakeyboardcontrol_Prefix.pch; sourceTree = SOURCE_ROOT; };
58 | AACBBE490F95108600F1A2B1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
59 | D2AAC07E0554694100DB518D /* libItSmcDakeyboardcontrol.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libItSmcDakeyboardcontrol.a; sourceTree = BUILT_PRODUCTS_DIR; };
60 | /* End PBXFileReference section */
61 |
62 | /* Begin PBXFrameworksBuildPhase section */
63 | D2AAC07C0554694100DB518D /* Frameworks */ = {
64 | isa = PBXFrameworksBuildPhase;
65 | buildActionMask = 2147483647;
66 | files = (
67 | AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */,
68 | );
69 | runOnlyForDeploymentPostprocessing = 0;
70 | };
71 | /* End PBXFrameworksBuildPhase section */
72 |
73 | /* Begin PBXGroup section */
74 | 034768DFFF38A50411DB9C8B /* Products */ = {
75 | isa = PBXGroup;
76 | children = (
77 | D2AAC07E0554694100DB518D /* libItSmcDakeyboardcontrol.a */,
78 | );
79 | name = Products;
80 | sourceTree = "";
81 | };
82 | 0867D691FE84028FC02AAC07 /* TiDAKeyboardControl */ = {
83 | isa = PBXGroup;
84 | children = (
85 | 08FB77AEFE84172EC02AAC07 /* Classes */,
86 | 32C88DFF0371C24200C91783 /* Other Sources */,
87 | 0867D69AFE84028FC02AAC07 /* Frameworks */,
88 | 034768DFFF38A50411DB9C8B /* Products */,
89 | );
90 | name = TiDAKeyboardControl;
91 | sourceTree = "";
92 | };
93 | 0867D69AFE84028FC02AAC07 /* Frameworks */ = {
94 | isa = PBXGroup;
95 | children = (
96 | AACBBE490F95108600F1A2B1 /* Foundation.framework */,
97 | );
98 | name = Frameworks;
99 | sourceTree = "";
100 | };
101 | 08FB77AEFE84172EC02AAC07 /* Classes */ = {
102 | isa = PBXGroup;
103 | children = (
104 | 96C68C111897A4F7005FEC06 /* DAKeyboardControl */,
105 | 24DE9E0F11C5FE74003F90F6 /* ItSmcDakeyboardcontrolModuleAssets.h */,
106 | 24DE9E1011C5FE74003F90F6 /* ItSmcDakeyboardcontrolModuleAssets.m */,
107 | 24DD6CF71134B3F500162E58 /* ItSmcDakeyboardcontrolModule.h */,
108 | 24DD6CF81134B3F500162E58 /* ItSmcDakeyboardcontrolModule.m */,
109 | 96C68C161897A645005FEC06 /* TiViewProxy+KeyboardControl.h */,
110 | 96C68C171897A645005FEC06 /* TiViewProxy+KeyboardControl.m */,
111 | );
112 | name = Classes;
113 | sourceTree = "";
114 | };
115 | 32C88DFF0371C24200C91783 /* Other Sources */ = {
116 | isa = PBXGroup;
117 | children = (
118 | AA747D9E0F9514B9006C5449 /* ItSmcDakeyboardcontrol_Prefix.pch */,
119 | 24DD6D1B1134B66800162E58 /* titanium.xcconfig */,
120 | );
121 | name = "Other Sources";
122 | sourceTree = "";
123 | };
124 | 96C68C111897A4F7005FEC06 /* DAKeyboardControl */ = {
125 | isa = PBXGroup;
126 | children = (
127 | 96C68C121897A4F7005FEC06 /* DAKeyboardControl.h */,
128 | 96C68C131897A4F7005FEC06 /* DAKeyboardControl.m */,
129 | );
130 | name = DAKeyboardControl;
131 | path = DAKeyboardControl/DAKeyboardControl;
132 | sourceTree = "";
133 | };
134 | /* End PBXGroup section */
135 |
136 | /* Begin PBXHeadersBuildPhase section */
137 | D2AAC07A0554694100DB518D /* Headers */ = {
138 | isa = PBXHeadersBuildPhase;
139 | buildActionMask = 2147483647;
140 | files = (
141 | 96C68C141897A4F7005FEC06 /* DAKeyboardControl.h in Headers */,
142 | 96C68C181897A645005FEC06 /* TiViewProxy+KeyboardControl.h in Headers */,
143 | AA747D9F0F9514B9006C5449 /* ItSmcDakeyboardcontrol_Prefix.pch in Headers */,
144 | 24DD6CF91134B3F500162E58 /* ItSmcDakeyboardcontrolModule.h in Headers */,
145 | 24DE9E1111C5FE74003F90F6 /* ItSmcDakeyboardcontrolModuleAssets.h in Headers */,
146 | );
147 | runOnlyForDeploymentPostprocessing = 0;
148 | };
149 | /* End PBXHeadersBuildPhase section */
150 |
151 | /* Begin PBXNativeTarget section */
152 | D2AAC07D0554694100DB518D /* TiDAKeyboardControl */ = {
153 | isa = PBXNativeTarget;
154 | buildConfigurationList = 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "TiDAKeyboardControl" */;
155 | buildPhases = (
156 | D2AAC07A0554694100DB518D /* Headers */,
157 | D2AAC07B0554694100DB518D /* Sources */,
158 | D2AAC07C0554694100DB518D /* Frameworks */,
159 | );
160 | buildRules = (
161 | );
162 | dependencies = (
163 | );
164 | name = TiDAKeyboardControl;
165 | productName = TiDAKeyboardControl;
166 | productReference = D2AAC07E0554694100DB518D /* libItSmcDakeyboardcontrol.a */;
167 | productType = "com.apple.product-type.library.static";
168 | };
169 | /* End PBXNativeTarget section */
170 |
171 | /* Begin PBXProject section */
172 | 0867D690FE84028FC02AAC07 /* Project object */ = {
173 | isa = PBXProject;
174 | attributes = {
175 | LastUpgradeCheck = 0610;
176 | };
177 | buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "TiDAKeyboardControl" */;
178 | compatibilityVersion = "Xcode 3.2";
179 | developmentRegion = English;
180 | hasScannedForEncodings = 1;
181 | knownRegions = (
182 | English,
183 | Japanese,
184 | French,
185 | German,
186 | );
187 | mainGroup = 0867D691FE84028FC02AAC07 /* TiDAKeyboardControl */;
188 | productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
189 | projectDirPath = "";
190 | projectRoot = "";
191 | targets = (
192 | D2AAC07D0554694100DB518D /* TiDAKeyboardControl */,
193 | 24416B8111C4CA220047AFDD /* Build & Test */,
194 | );
195 | };
196 | /* End PBXProject section */
197 |
198 | /* Begin PBXShellScriptBuildPhase section */
199 | 24416B8011C4CA220047AFDD /* ShellScript */ = {
200 | isa = PBXShellScriptBuildPhase;
201 | buildActionMask = 2147483647;
202 | files = (
203 | );
204 | inputPaths = (
205 | );
206 | outputPaths = (
207 | );
208 | runOnlyForDeploymentPostprocessing = 0;
209 | shellPath = /bin/sh;
210 | shellScript = "# shell script goes here\n\npython \"${TITANIUM_SDK}/titanium.py\" run --dir=\"${PROJECT_DIR}\"\nexit $?\n";
211 | };
212 | /* End PBXShellScriptBuildPhase section */
213 |
214 | /* Begin PBXSourcesBuildPhase section */
215 | D2AAC07B0554694100DB518D /* Sources */ = {
216 | isa = PBXSourcesBuildPhase;
217 | buildActionMask = 2147483647;
218 | files = (
219 | 24DD6CFA1134B3F500162E58 /* ItSmcDakeyboardcontrolModule.m in Sources */,
220 | 96C68C151897A4F7005FEC06 /* DAKeyboardControl.m in Sources */,
221 | 24DE9E1211C5FE74003F90F6 /* ItSmcDakeyboardcontrolModuleAssets.m in Sources */,
222 | 96C68C191897A645005FEC06 /* TiViewProxy+KeyboardControl.m in Sources */,
223 | );
224 | runOnlyForDeploymentPostprocessing = 0;
225 | };
226 | /* End PBXSourcesBuildPhase section */
227 |
228 | /* Begin PBXTargetDependency section */
229 | 24416B8511C4CA280047AFDD /* PBXTargetDependency */ = {
230 | isa = PBXTargetDependency;
231 | target = D2AAC07D0554694100DB518D /* TiDAKeyboardControl */;
232 | targetProxy = 24416B8411C4CA280047AFDD /* PBXContainerItemProxy */;
233 | };
234 | /* End PBXTargetDependency section */
235 |
236 | /* Begin XCBuildConfiguration section */
237 | 1DEB921F08733DC00010E9CD /* Debug */ = {
238 | isa = XCBuildConfiguration;
239 | baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */;
240 | buildSettings = {
241 | CODE_SIGN_IDENTITY = "iPhone Developer";
242 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
243 | DSTROOT = /tmp/ItSmcDakeyboardcontrol.dst;
244 | GCC_C_LANGUAGE_STANDARD = c99;
245 | GCC_OPTIMIZATION_LEVEL = 0;
246 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
247 | GCC_PREFIX_HEADER = ItSmcDakeyboardcontrol_Prefix.pch;
248 | GCC_PREPROCESSOR_DEFINITIONS = "TI_VERSION=$(TI_VERSION)";
249 | GCC_TREAT_WARNINGS_AS_ERRORS = NO;
250 | GCC_VERSION = "";
251 | GCC_WARN_ABOUT_RETURN_TYPE = NO;
252 | GCC_WARN_MISSING_PARENTHESES = NO;
253 | GCC_WARN_SHADOW = NO;
254 | GCC_WARN_STRICT_SELECTOR_MATCH = NO;
255 | GCC_WARN_UNUSED_FUNCTION = YES;
256 | GCC_WARN_UNUSED_PARAMETER = NO;
257 | GCC_WARN_UNUSED_VALUE = NO;
258 | GCC_WARN_UNUSED_VARIABLE = NO;
259 | INSTALL_PATH = /usr/local/lib;
260 | LIBRARY_SEARCH_PATHS = "";
261 | OTHER_CFLAGS = (
262 | "-DDEBUG",
263 | "-DTI_POST_1_2",
264 | );
265 | OTHER_LDFLAGS = "-ObjC";
266 | PRODUCT_NAME = ItSmcDakeyboardcontrol;
267 | PROVISIONING_PROFILE = "";
268 | "PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
269 | RUN_CLANG_STATIC_ANALYZER = NO;
270 | SDKROOT = iphoneos;
271 | USER_HEADER_SEARCH_PATHS = "";
272 | };
273 | name = Debug;
274 | };
275 | 1DEB922008733DC00010E9CD /* Release */ = {
276 | isa = XCBuildConfiguration;
277 | baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */;
278 | buildSettings = {
279 | ALWAYS_SEARCH_USER_PATHS = NO;
280 | DSTROOT = /tmp/ItSmcDakeyboardcontrol.dst;
281 | GCC_C_LANGUAGE_STANDARD = c99;
282 | GCC_MODEL_TUNING = G5;
283 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
284 | GCC_PREFIX_HEADER = ItSmcDakeyboardcontrol_Prefix.pch;
285 | GCC_PREPROCESSOR_DEFINITIONS = "TI_VERSION=$(TI_VERSION)";
286 | GCC_TREAT_WARNINGS_AS_ERRORS = NO;
287 | GCC_VERSION = "";
288 | GCC_WARN_ABOUT_RETURN_TYPE = NO;
289 | GCC_WARN_MISSING_PARENTHESES = NO;
290 | GCC_WARN_SHADOW = NO;
291 | GCC_WARN_STRICT_SELECTOR_MATCH = NO;
292 | GCC_WARN_UNUSED_FUNCTION = YES;
293 | GCC_WARN_UNUSED_PARAMETER = NO;
294 | GCC_WARN_UNUSED_VALUE = NO;
295 | GCC_WARN_UNUSED_VARIABLE = NO;
296 | INSTALL_PATH = /usr/local/lib;
297 | IPHONEOS_DEPLOYMENT_TARGET = 4.0;
298 | LIBRARY_SEARCH_PATHS = "";
299 | OTHER_CFLAGS = "-DTI_POST_1_2";
300 | OTHER_LDFLAGS = "-ObjC";
301 | PRODUCT_NAME = ItSmcDakeyboardcontrol;
302 | RUN_CLANG_STATIC_ANALYZER = NO;
303 | SDKROOT = iphoneos;
304 | USER_HEADER_SEARCH_PATHS = "";
305 | };
306 | name = Release;
307 | };
308 | 1DEB922308733DC00010E9CD /* Debug */ = {
309 | isa = XCBuildConfiguration;
310 | baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */;
311 | buildSettings = {
312 | CODE_SIGN_IDENTITY = "iPhone Developer";
313 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
314 | DSTROOT = /tmp/ItSmcDakeyboardcontrol.dst;
315 | GCC_C_LANGUAGE_STANDARD = c99;
316 | GCC_OPTIMIZATION_LEVEL = 0;
317 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
318 | GCC_PREFIX_HEADER = ItSmcDakeyboardcontrol_Prefix.pch;
319 | GCC_PREPROCESSOR_DEFINITIONS = "TI_VERSION=$(TI_VERSION)";
320 | GCC_TREAT_WARNINGS_AS_ERRORS = NO;
321 | GCC_VERSION = "";
322 | GCC_WARN_ABOUT_RETURN_TYPE = NO;
323 | GCC_WARN_MISSING_PARENTHESES = NO;
324 | GCC_WARN_SHADOW = NO;
325 | GCC_WARN_STRICT_SELECTOR_MATCH = NO;
326 | GCC_WARN_UNUSED_FUNCTION = YES;
327 | GCC_WARN_UNUSED_PARAMETER = NO;
328 | GCC_WARN_UNUSED_VALUE = NO;
329 | GCC_WARN_UNUSED_VARIABLE = NO;
330 | INSTALL_PATH = /usr/local/lib;
331 | IPHONEOS_DEPLOYMENT_TARGET = 6.0;
332 | ONLY_ACTIVE_ARCH = YES;
333 | OTHER_CFLAGS = (
334 | "-DDEBUG",
335 | "-DTI_POST_1_2",
336 | );
337 | OTHER_LDFLAGS = "-ObjC";
338 | PRODUCT_NAME = ItSmcDakeyboardcontrol;
339 | PROVISIONING_PROFILE = "";
340 | "PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
341 | RUN_CLANG_STATIC_ANALYZER = NO;
342 | SDKROOT = iphoneos;
343 | USER_HEADER_SEARCH_PATHS = "";
344 | };
345 | name = Debug;
346 | };
347 | 1DEB922408733DC00010E9CD /* Release */ = {
348 | isa = XCBuildConfiguration;
349 | baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */;
350 | buildSettings = {
351 | ALWAYS_SEARCH_USER_PATHS = NO;
352 | DSTROOT = /tmp/ItSmcDakeyboardcontrol.dst;
353 | GCC_C_LANGUAGE_STANDARD = c99;
354 | GCC_MODEL_TUNING = G5;
355 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
356 | GCC_PREFIX_HEADER = ItSmcDakeyboardcontrol_Prefix.pch;
357 | GCC_PREPROCESSOR_DEFINITIONS = "TI_VERSION=$(TI_VERSION)";
358 | GCC_TREAT_WARNINGS_AS_ERRORS = NO;
359 | GCC_VERSION = "";
360 | GCC_WARN_ABOUT_RETURN_TYPE = NO;
361 | GCC_WARN_MISSING_PARENTHESES = NO;
362 | GCC_WARN_SHADOW = NO;
363 | GCC_WARN_STRICT_SELECTOR_MATCH = NO;
364 | GCC_WARN_UNUSED_FUNCTION = YES;
365 | GCC_WARN_UNUSED_PARAMETER = NO;
366 | GCC_WARN_UNUSED_VALUE = NO;
367 | GCC_WARN_UNUSED_VARIABLE = NO;
368 | INSTALL_PATH = /usr/local/lib;
369 | IPHONEOS_DEPLOYMENT_TARGET = 6.0;
370 | OTHER_CFLAGS = "-DTI_POST_1_2";
371 | OTHER_LDFLAGS = "-ObjC";
372 | PRODUCT_NAME = ItSmcDakeyboardcontrol;
373 | RUN_CLANG_STATIC_ANALYZER = NO;
374 | SDKROOT = iphoneos;
375 | USER_HEADER_SEARCH_PATHS = "";
376 | };
377 | name = Release;
378 | };
379 | 24416B8211C4CA220047AFDD /* Debug */ = {
380 | isa = XCBuildConfiguration;
381 | baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */;
382 | buildSettings = {
383 | COPY_PHASE_STRIP = NO;
384 | GCC_DYNAMIC_NO_PIC = NO;
385 | GCC_OPTIMIZATION_LEVEL = 0;
386 | PRODUCT_NAME = "Build & test";
387 | };
388 | name = Debug;
389 | };
390 | 24416B8311C4CA220047AFDD /* Release */ = {
391 | isa = XCBuildConfiguration;
392 | baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */;
393 | buildSettings = {
394 | COPY_PHASE_STRIP = YES;
395 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
396 | GCC_ENABLE_FIX_AND_CONTINUE = NO;
397 | PRODUCT_NAME = "Build & test";
398 | ZERO_LINK = NO;
399 | };
400 | name = Release;
401 | };
402 | /* End XCBuildConfiguration section */
403 |
404 | /* Begin XCConfigurationList section */
405 | 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "TiDAKeyboardControl" */ = {
406 | isa = XCConfigurationList;
407 | buildConfigurations = (
408 | 1DEB921F08733DC00010E9CD /* Debug */,
409 | 1DEB922008733DC00010E9CD /* Release */,
410 | );
411 | defaultConfigurationIsVisible = 0;
412 | defaultConfigurationName = Release;
413 | };
414 | 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "TiDAKeyboardControl" */ = {
415 | isa = XCConfigurationList;
416 | buildConfigurations = (
417 | 1DEB922308733DC00010E9CD /* Debug */,
418 | 1DEB922408733DC00010E9CD /* Release */,
419 | );
420 | defaultConfigurationIsVisible = 0;
421 | defaultConfigurationName = Release;
422 | };
423 | 24416B8A11C4CA520047AFDD /* Build configuration list for PBXAggregateTarget "Build & Test" */ = {
424 | isa = XCConfigurationList;
425 | buildConfigurations = (
426 | 24416B8211C4CA220047AFDD /* Debug */,
427 | 24416B8311C4CA220047AFDD /* Release */,
428 | );
429 | defaultConfigurationIsVisible = 0;
430 | defaultConfigurationName = Release;
431 | };
432 | /* End XCConfigurationList section */
433 | };
434 | rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
435 | }
436 |
--------------------------------------------------------------------------------
/TiDAKeyboardControl.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/TiDAKeyboardControl.xcodeproj/project.xcworkspace/xcshareddata/TiDAKeyboardControl.xccheckout:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDESourceControlProjectFavoriteDictionaryKey
6 |
7 | IDESourceControlProjectIdentifier
8 | 58A99BC2-FEEC-41A1-BFAA-D44D447B947A
9 | IDESourceControlProjectName
10 | TiDAKeyboardControl
11 | IDESourceControlProjectOriginsDictionary
12 |
13 | 9ADB17431677F397B8611AC781EA9F5D347FDD0F
14 | github.com:smclab/TiDAKeyboardControl.git
15 | F5750516C1B1014B205F3FCCB08DDD0226AAA141
16 | github.com:danielamitay/DAKeyboardControl.git
17 |
18 | IDESourceControlProjectPath
19 | TiDAKeyboardControl.xcodeproj
20 | IDESourceControlProjectRelativeInstallPathDictionary
21 |
22 | 9ADB17431677F397B8611AC781EA9F5D347FDD0F
23 | ../..
24 | F5750516C1B1014B205F3FCCB08DDD0226AAA141
25 | ../..DAKeyboardControl/
26 |
27 | IDESourceControlProjectURL
28 | github.com:smclab/TiDAKeyboardControl.git
29 | IDESourceControlProjectVersion
30 | 111
31 | IDESourceControlProjectWCCIdentifier
32 | 9ADB17431677F397B8611AC781EA9F5D347FDD0F
33 | IDESourceControlProjectWCConfigurations
34 |
35 |
36 | IDESourceControlRepositoryExtensionIdentifierKey
37 | public.vcs.git
38 | IDESourceControlWCCIdentifierKey
39 | F5750516C1B1014B205F3FCCB08DDD0226AAA141
40 | IDESourceControlWCCName
41 | DAKeyboardControl
42 |
43 |
44 | IDESourceControlRepositoryExtensionIdentifierKey
45 | public.vcs.git
46 | IDESourceControlWCCIdentifierKey
47 | 9ADB17431677F397B8611AC781EA9F5D347FDD0F
48 | IDESourceControlWCCName
49 | TiDAKeyboardControl
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/TiDAKeyboardControl.xcodeproj/project.xcworkspace/xcuserdata/pier.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/smclab/TiDAKeyboardControl/eff7406ba07687cec131ec0553f2dd94edf51c90/TiDAKeyboardControl.xcodeproj/project.xcworkspace/xcuserdata/pier.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/TiDAKeyboardControl.xcodeproj/project.xcworkspace/xcuserdata/pier.xcuserdatad/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges
6 |
7 | SnapshotAutomaticallyBeforeSignificantChanges
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/TiDAKeyboardControl.xcodeproj/xcuserdata/pier.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/TiDAKeyboardControl.xcodeproj/xcuserdata/pier.xcuserdatad/xcschemes/Build & Test.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
42 |
43 |
49 |
50 |
51 |
52 |
53 |
54 |
60 |
61 |
63 |
64 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/TiDAKeyboardControl.xcodeproj/xcuserdata/pier.xcuserdatad/xcschemes/TiDAKeyboardControl.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
42 |
43 |
49 |
50 |
51 |
52 |
53 |
54 |
60 |
61 |
63 |
64 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/TiDAKeyboardControl.xcodeproj/xcuserdata/pier.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Build & Test.xcscheme
8 |
9 | orderHint
10 | 1
11 |
12 | TiDAKeyboardControl.xcscheme
13 |
14 | orderHint
15 | 0
16 |
17 |
18 | SuppressBuildableAutocreation
19 |
20 | 24416B8111C4CA220047AFDD
21 |
22 | primary
23 |
24 |
25 | D2AAC07D0554694100DB518D
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/assets/README:
--------------------------------------------------------------------------------
1 | Place your assets like PNG files in this directory and they will be packaged with your module.
2 |
3 | If you create a file named it.smc.dakeyboardcontrol.js in this directory, it will be
4 | compiled and used as your module. This allows you to run pure Javascript
5 | modules that are pre-compiled.
6 |
7 |
--------------------------------------------------------------------------------
/build.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | #
3 | # Appcelerator Titanium Module Packager
4 | #
5 | #
6 | import os, subprocess, sys, glob, string, optparse, subprocess
7 | import zipfile
8 | from datetime import date
9 |
10 | cwd = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
11 | os.chdir(cwd)
12 | required_module_keys = ['name','version','moduleid','description','copyright','license','copyright','platform','minsdk']
13 | module_defaults = {
14 | 'description':'My module',
15 | 'author': 'Your Name',
16 | 'license' : 'Specify your license',
17 | 'copyright' : 'Copyright (c) %s by Your Company' % str(date.today().year),
18 | }
19 | module_license_default = "TODO: place your license here and we'll include it in the module distribution"
20 |
21 | def find_sdk(config):
22 | sdk = config['TITANIUM_SDK']
23 | return os.path.expandvars(os.path.expanduser(sdk))
24 |
25 | def replace_vars(config,token):
26 | idx = token.find('$(')
27 | while idx != -1:
28 | idx2 = token.find(')',idx+2)
29 | if idx2 == -1: break
30 | key = token[idx+2:idx2]
31 | if not config.has_key(key): break
32 | token = token.replace('$(%s)' % key, config[key])
33 | idx = token.find('$(')
34 | return token
35 |
36 |
37 | def read_ti_xcconfig():
38 | contents = open(os.path.join(cwd,'titanium.xcconfig')).read()
39 | config = {}
40 | for line in contents.splitlines(False):
41 | line = line.strip()
42 | if line[0:2]=='//': continue
43 | idx = line.find('=')
44 | if idx > 0:
45 | key = line[0:idx].strip()
46 | value = line[idx+1:].strip()
47 | config[key] = replace_vars(config,value)
48 | return config
49 |
50 | def generate_doc(config):
51 | docdir = os.path.join(cwd,'documentation')
52 | if not os.path.exists(docdir):
53 | warn("Couldn't find documentation file at: %s" % docdir)
54 | return None
55 |
56 | try:
57 | import markdown2 as markdown
58 | except ImportError:
59 | import markdown
60 | documentation = []
61 | for file in os.listdir(docdir):
62 | if file in ignoreFiles or os.path.isdir(os.path.join(docdir, file)):
63 | continue
64 | md = open(os.path.join(docdir,file)).read()
65 | html = markdown.markdown(md)
66 | documentation.append({file:html});
67 | return documentation
68 |
69 | def compile_js(manifest,config):
70 | js_file = os.path.join(cwd,'assets','it.smc.dakeyboardcontrol.js')
71 | if not os.path.exists(js_file): return
72 |
73 | from compiler import Compiler
74 | try:
75 | import json
76 | except:
77 | import simplejson as json
78 |
79 | compiler = Compiler(cwd, manifest['moduleid'], manifest['name'], 'commonjs')
80 | root_asset, module_assets = compiler.compile_module()
81 |
82 | root_asset_content = """
83 | %s
84 |
85 | return filterDataInRange([NSData dataWithBytesNoCopy:data length:sizeof(data) freeWhenDone:NO], ranges[0]);
86 | """ % root_asset
87 |
88 | module_asset_content = """
89 | %s
90 |
91 | NSNumber *index = [map objectForKey:path];
92 | if (index == nil) {
93 | return nil;
94 | }
95 | return filterDataInRange([NSData dataWithBytesNoCopy:data length:sizeof(data) freeWhenDone:NO], ranges[index.integerValue]);
96 | """ % module_assets
97 |
98 | from tools import splice_code
99 |
100 | assets_router = os.path.join(cwd,'Classes','ItSmcDakeyboardcontrolModuleAssets.m')
101 | splice_code(assets_router, 'asset', root_asset_content)
102 | splice_code(assets_router, 'resolve_asset', module_asset_content)
103 |
104 | # Generate the exports after crawling all of the available JS source
105 | exports = open('metadata.json','w')
106 | json.dump({'exports':compiler.exports }, exports)
107 | exports.close()
108 |
109 | def die(msg):
110 | print msg
111 | sys.exit(1)
112 |
113 | def info(msg):
114 | print "[INFO] %s" % msg
115 |
116 | def warn(msg):
117 | print "[WARN] %s" % msg
118 |
119 | def validate_license():
120 | c = open(os.path.join(cwd,'LICENSE')).read()
121 | if c.find(module_license_default)!=-1:
122 | warn('please update the LICENSE file with your license text before distributing')
123 |
124 | def validate_manifest():
125 | path = os.path.join(cwd,'manifest')
126 | f = open(path)
127 | if not os.path.exists(path): die("missing %s" % path)
128 | manifest = {}
129 | for line in f.readlines():
130 | line = line.strip()
131 | if line[0:1]=='#': continue
132 | if line.find(':') < 0: continue
133 | key,value = line.split(':')
134 | manifest[key.strip()]=value.strip()
135 | for key in required_module_keys:
136 | if not manifest.has_key(key): die("missing required manifest key '%s'" % key)
137 | if module_defaults.has_key(key):
138 | defvalue = module_defaults[key]
139 | curvalue = manifest[key]
140 | if curvalue==defvalue: warn("please update the manifest key: '%s' to a non-default value" % key)
141 | return manifest,path
142 |
143 | ignoreFiles = ['.DS_Store','.gitignore','libTitanium.a','titanium.jar','README']
144 | ignoreDirs = ['.DS_Store','.svn','.git','CVSROOT']
145 |
146 | def zip_dir(zf,dir,basepath,ignoreExt=[]):
147 | if not os.path.exists(dir): return
148 | for root, dirs, files in os.walk(dir):
149 | for name in ignoreDirs:
150 | if name in dirs:
151 | dirs.remove(name) # don't visit ignored directories
152 | for file in files:
153 | if file in ignoreFiles: continue
154 | e = os.path.splitext(file)
155 | if len(e) == 2 and e[1] in ignoreExt: continue
156 | from_ = os.path.join(root, file)
157 | to_ = from_.replace(dir, '%s/%s'%(basepath,dir), 1)
158 | zf.write(from_, to_)
159 |
160 | def glob_libfiles():
161 | files = []
162 | for libfile in glob.glob('build/**/*.a'):
163 | if libfile.find('Release-')!=-1:
164 | files.append(libfile)
165 | return files
166 |
167 | def build_module(manifest,config):
168 | from tools import ensure_dev_path
169 | ensure_dev_path()
170 |
171 | rc = os.system("xcodebuild -sdk iphoneos -configuration Release")
172 | if rc != 0:
173 | die("xcodebuild failed")
174 | rc = os.system("xcodebuild -sdk iphonesimulator -configuration Release")
175 | if rc != 0:
176 | die("xcodebuild failed")
177 | # build the merged library using lipo
178 | moduleid = manifest['moduleid']
179 | libpaths = ''
180 | for libfile in glob_libfiles():
181 | libpaths+='%s ' % libfile
182 |
183 | os.system("lipo %s -create -output build/lib%s.a" %(libpaths,moduleid))
184 |
185 | def generate_apidoc(apidoc_build_path):
186 | global options
187 |
188 | if options.skip_docs:
189 | info("Skipping documentation generation.")
190 | return False
191 | else:
192 | info("Module apidoc generation can be skipped using --skip-docs")
193 | apidoc_path = os.path.join(cwd, "apidoc")
194 | if not os.path.exists(apidoc_path):
195 | warn("Skipping apidoc generation. No apidoc folder found at: %s" % apidoc_path)
196 | return False
197 |
198 | if not os.path.exists(apidoc_build_path):
199 | os.makedirs(apidoc_build_path)
200 | ti_root = string.strip(subprocess.check_output(["echo $TI_ROOT"], shell=True))
201 | if not len(ti_root) > 0:
202 | warn("Not generating documentation from the apidoc folder. The titanium_mobile repo could not be found.")
203 | warn("Set the TI_ROOT environment variable to the parent folder where the titanium_mobile repo resides (eg.'export TI_ROOT=/Path').")
204 | return False
205 | docgen = os.path.join(ti_root, "titanium_mobile", "apidoc", "docgen.py")
206 | if not os.path.exists(docgen):
207 | warn("Not generating documentation from the apidoc folder. Couldn't find docgen.py at: %s" % docgen)
208 | return False
209 |
210 | info("Generating documentation from the apidoc folder.")
211 | rc = os.system("\"%s\" --format=jsca,modulehtml --css=styles.css -o \"%s\" -e \"%s\"" % (docgen, apidoc_build_path, apidoc_path))
212 | if rc != 0:
213 | die("docgen failed")
214 | return True
215 |
216 | def package_module(manifest,mf,config):
217 | name = manifest['name'].lower()
218 | moduleid = manifest['moduleid'].lower()
219 | version = manifest['version']
220 | modulezip = '%s-iphone-%s.zip' % (moduleid,version)
221 | if os.path.exists(modulezip): os.remove(modulezip)
222 | zf = zipfile.ZipFile(modulezip, 'w', zipfile.ZIP_DEFLATED)
223 | modulepath = 'modules/iphone/%s/%s' % (moduleid,version)
224 | zf.write(mf,'%s/manifest' % modulepath)
225 | libname = 'lib%s.a' % moduleid
226 | zf.write('build/%s' % libname, '%s/%s' % (modulepath,libname))
227 | docs = generate_doc(config)
228 | if docs!=None:
229 | for doc in docs:
230 | for file, html in doc.iteritems():
231 | filename = string.replace(file,'.md','.html')
232 | zf.writestr('%s/documentation/%s'%(modulepath,filename),html)
233 |
234 | apidoc_build_path = os.path.join(cwd, "build", "apidoc")
235 | if generate_apidoc(apidoc_build_path):
236 | for file in os.listdir(apidoc_build_path):
237 | if file in ignoreFiles or os.path.isdir(os.path.join(apidoc_build_path, file)):
238 | continue
239 | zf.write(os.path.join(apidoc_build_path, file), '%s/documentation/apidoc/%s' % (modulepath, file))
240 |
241 | zip_dir(zf,'assets',modulepath,['.pyc','.js'])
242 | zip_dir(zf,'example',modulepath,['.pyc'])
243 | zip_dir(zf,'platform',modulepath,['.pyc','.js'])
244 | zf.write('LICENSE','%s/LICENSE' % modulepath)
245 | zf.write('module.xcconfig','%s/module.xcconfig' % modulepath)
246 | exports_file = 'metadata.json'
247 | if os.path.exists(exports_file):
248 | zf.write(exports_file, '%s/%s' % (modulepath, exports_file))
249 | zf.close()
250 |
251 |
252 | if __name__ == '__main__':
253 | global options
254 |
255 | parser = optparse.OptionParser()
256 | parser.add_option("-s", "--skip-docs",
257 | dest="skip_docs",
258 | action="store_true",
259 | help="Will skip building documentation in apidoc folder",
260 | default=False)
261 | (options, args) = parser.parse_args()
262 |
263 | manifest,mf = validate_manifest()
264 | validate_license()
265 | config = read_ti_xcconfig()
266 |
267 | sdk = find_sdk(config)
268 | sys.path.insert(0,os.path.join(sdk,'iphone'))
269 | sys.path.append(os.path.join(sdk, "common"))
270 |
271 | compile_js(manifest,config)
272 | build_module(manifest,config)
273 | package_module(manifest,mf,config)
274 | sys.exit(0)
275 |
276 |
--------------------------------------------------------------------------------
/documentation/index.md:
--------------------------------------------------------------------------------
1 | # TiDAKeyboardControl Module
2 |
3 | ## Description
4 |
5 | Do you want to create a perfect clone of the iMessage compose interface? ***Fear no more!*** You can now respond to keyboard events (show, hide and interactive changes) and customize how much space will be used as an offset during interactive panning.
6 |
7 | Titanium SDK wrapper for the awesome [DAKeyboardControl][dakc] from [@danielamitay][da]! (iOS only)
8 |
9 | ## Accessing the TiDAKeyboardControl Module
10 |
11 | What you have to do is just install the module, nothing more!
12 |
13 | Thanks to the native implementation using Objective-C categories to extend classes, TiDAKeyboardControl Module does not need the **require( )** method to access the module from JavaScript.
14 |
15 |
16 | ## Usage
17 |
18 | ###Properties
19 | - ``keyboardTriggerOffset``: *number*,
20 | How much space must be took on top of the keyboard.
21 |
22 | - ``keyboardPanning``: *number*, This activates the panning feature.
23 | - ``lockedViews``: *[View]*, Automatically add the specified View as a locked view.
24 |
25 |
26 | An extensive example can be found in `example/app.js`, the following one just acts as an overview.
27 | To clear up every doubts please read [this](../example/README.md).
28 |
29 |
30 | ```js
31 |
32 | var textarea = Ti.UI.createTextArea({
33 | right: 0,
34 | bottom: 0,
35 | left: 0,
36 | scrollable: false,
37 | suppressReturn: false,
38 | height: Ti.UI.SIZE,
39 | });
40 |
41 | var window = Ti.UI.createWindow({
42 | keyboardTriggerOffset: 0,
43 | keyboardPanning: true,
44 | lockedViews: [ textarea ]
45 | });
46 |
47 | window.addEventListener('close', function (event) {
48 | // Very important! Releases what needs to be released
49 | event.source.keyboardPanning = false;
50 | });
51 |
52 | window.add(textarea);
53 |
54 | // The window is now the host for keyboard events
55 | window.addEventListener('keyboardchange', function (event) {
56 | Ti.API.error("Notification of keyboard change: y=" + event.y + " height="+event.height);
57 | });
58 |
59 | // Multiline text-area
60 | textarea.addEventListener('postlayout', function (event) {
61 | window.keyboardTriggerOffset = event.source.rect.height;
62 | });
63 |
64 | window.open();
65 | ```
66 |
67 |
68 | ## Author
69 |
70 | Kudos to @danielamitay for the development of DAKeyboardControl.
71 |
72 | Humbly made by the spry ladies and gents at SMC.
73 |
74 |
75 | [dakc]: https://github.com/danielamitay/DAKeyboardControl
76 | [da]: http://danielamitay.com
77 |
78 |
79 | ## License
80 |
81 | This library, *TiDAKeyboardControl*, is free software ("Licensed Software"); you can
82 | redistribute it and/or modify it under the terms of the [GNU Lesser General
83 | Public License](http://www.gnu.org/licenses/lgpl-2.1.html) as published by the
84 | Free Software Foundation; either version 2.1 of the License, or (at your
85 | option) any later version.
86 |
87 | This library is distributed in the hope that it will be useful, but WITHOUT ANY
88 | WARRANTY; including but not limited to, the implied warranty of MERCHANTABILITY,
89 | NONINFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
90 | Public License for more details.
91 |
92 | You should have received a copy of the [GNU Lesser General Public
93 | License](http://www.gnu.org/licenses/lgpl-2.1.html) along with this library; if
94 | not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
95 | Floor, Boston, MA 02110-1301 USA
96 |
97 |
98 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 |
2 | Example code for TiDAKeyboardControl
3 | ====================================
4 |
5 | In this folder you’ll find 2 different files. This is the explanation of both.
6 |
7 |
8 | `automatic.js`
9 | --------------
10 |
11 | This example file shows the preferred way of using this module.
12 |
13 | Instead of listening to `keyboardchange` events and moving the ‘toolbar’ accordingly, we just let the module manage it for us.
14 |
15 | This happens in three steps.
16 |
17 | ```js
18 | Ti.UI.createWindow({ /* 1 */
19 | keyboardPanning: true, /* 2 */
20 | lockedViews: [ textareaview ] /* 3 */
21 | });
22 | ```
23 |
24 | 1. Create a container view which will be the host for keyboard notifications;
25 | 2. setup the notifications with `keyboardPanning: true`;
26 | 3. add our ‘toolbar’ to the list of views whose `.transform` will be managed by *TiDAKeyboardControl*.
27 |
28 | `manual.js`
29 | -----------
30 |
31 | This example code uses the `"keyboardchange"` event in the host container view to update manually the `.transform` property of our ‘toolbar’.
32 |
33 | This kind of implementation may cause a little glitch scrolling up and down the keyboard.
34 | The slowness during the toolbar's repositioning is caused by a performance issue but shows how we can do pretty whatever we want with this module.
35 |
--------------------------------------------------------------------------------
/example/app.js:
--------------------------------------------------------------------------------
1 | var automatic = require('automatic');
2 | var manual = require('manual');
3 |
4 | var win = Ti.UI.createWindow({
5 | layout:'vertical'
6 | });
7 |
8 | var automaticButton = Ti.UI.createButton({
9 | title: 'Automatic',
10 | width: 150,
11 | height: 50
12 | });
13 |
14 | var manualButton = Ti.UI.createButton({
15 | title: 'Manual',
16 | width: 150,
17 | height: 50
18 | });
19 |
20 | automaticButton.addEventListener('click', automatic);
21 | manualButton.addEventListener('click', manual);
22 |
23 | win.add(automaticButton);
24 | win.add(manualButton);
25 |
26 | win.open();
27 |
--------------------------------------------------------------------------------
/example/automatic.js:
--------------------------------------------------------------------------------
1 | module.exports = function () {
2 |
3 | var window = Ti.UI.createWindow({
4 | orientationModes: [
5 | Ti.UI.PORTRAIT,
6 | Ti.UI.LANDSCAPE_LEFT,
7 | Ti.UI.LANDSCAPE_RIGHT
8 | ],
9 | backgroundColor: '#fff',
10 |
11 | // How much space must be took on top of the keyboard
12 | keyboardTriggerOffset: 0,
13 | // This activates the panning feature
14 | keyboardPanning: true
15 | });
16 |
17 | window.addEventListener('close', function (event) {
18 | // Very important! Releases what needs to be released
19 | event.source.keyboardPanning = false;
20 | });
21 |
22 | var textarea = Ti.UI.createTextArea({
23 | top: 5,
24 | right: 80,
25 | bottom: 5,
26 | left: 5,
27 | scrollable: false,
28 | suppressReturn: false,
29 | height: Ti.UI.SIZE,
30 | backgroundColor: '#fff',
31 | borderRadius: 3,
32 | borderWidth: '1px',
33 | borderColor: '#BBB'
34 | });
35 |
36 | var submit = Ti.UI.createButton({
37 | title: 'Send',
38 | width: 70,
39 | right: 5
40 | });
41 |
42 | var textareaview = Ti.UI.createView({
43 | height: Ti.UI.SIZE,
44 | right: 0,
45 | bottom: 0, // This value will not be updated!
46 | left: 0,
47 | backgroundColor: '#eee'
48 | });
49 |
50 | textareaview.add(textarea);
51 | textareaview.add(submit);
52 |
53 | window.add(textareaview);
54 |
55 | // Automatically add the textarea as a locked view
56 | window.lockedViews = [ textareaview ];
57 |
58 | // The textarea will change in size, because it’s multi-line.
59 | // I need to update the correct offset for the panning.
60 | textareaview.addEventListener('postlayout', function (event) {
61 | window.keyboardTriggerOffset = event.source.rect.height;
62 | });
63 |
64 | // Just an example programmatic dismissal.
65 | submit.addEventListener('click', function () {
66 | textarea.value = '';
67 | textarea.blur();
68 |
69 | setTimeout(function () {
70 | window.close();
71 | }, 4000);
72 | });
73 |
74 | window.open();
75 | };
--------------------------------------------------------------------------------
/example/manual.js:
--------------------------------------------------------------------------------
1 | module.exports = function(){
2 |
3 | var window = Ti.UI.createWindow({
4 | orientationModes: [
5 | Ti.UI.PORTRAIT,
6 | Ti.UI.LANDSCAPE_LEFT,
7 | Ti.UI.LANDSCAPE_RIGHT
8 | ],
9 | backgroundColor: '#fff',
10 |
11 | // How much space must be took on top of the keyboard
12 | keyboardTriggerOffset: 0,
13 | // This activates the panning feature
14 | keyboardPanning: true
15 | });
16 |
17 | window.addEventListener('close', function (event) {
18 | // Very important! Releases what needs to be released
19 | event.source.keyboardPanning = false;
20 | });
21 |
22 | var textarea = Ti.UI.createTextArea({
23 | top: 5,
24 | right: 80,
25 | bottom: 5,
26 | left: 5,
27 | scrollable: false,
28 | suppressReturn: false,
29 | height: Ti.UI.SIZE,
30 | backgroundColor: '#fff',
31 | borderRadius: 3,
32 | borderWidth: '1px',
33 | borderColor: '#BBB'
34 | });
35 |
36 | var submit = Ti.UI.createButton({
37 | title: 'Send',
38 | width: 70,
39 | right: 5
40 | });
41 |
42 | var textareaview = Ti.UI.createView({
43 | height: Ti.UI.SIZE,
44 | right: 0,
45 | bottom: 0,
46 | left: 0,
47 | backgroundColor: '#eee'
48 | });
49 |
50 | textareaview.add(textarea);
51 | textareaview.add(submit);
52 |
53 | window.add(textareaview);
54 |
55 | var last = 0;
56 |
57 | window.addEventListener('keyboardchange', function (event) {
58 |
59 | var next = event.height ? (window.rect.height - event.y) : 0;
60 | var delta = Math.abs(next - last);
61 | var transform = Ti.UI.create2DMatrix().translate(0, -next);
62 |
63 | if (delta > 40) {
64 | textareaview.animate({
65 | curve: 7, // Undocumented (by Apple) iOS7 animation curve
66 | duration: 300,
67 | transform: transform
68 | });
69 | }
70 | else if (delta > 0) {
71 | textareaview.transform = transform;
72 | }
73 |
74 | last = next;
75 | });
76 |
77 | // The textarea will change in size, because it’s multi-line.
78 | // I need to update the correct offset for the panning.
79 | textareaview.addEventListener('postlayout', function (event) {
80 | window.keyboardTriggerOffset = event.source.rect.height;
81 | });
82 |
83 | // Just an example programmatic dismissal.
84 | submit.addEventListener('click', function () {
85 | textarea.value = '';
86 | textarea.blur();
87 |
88 | setTimeout(function () {
89 | window.close();
90 | }, 4000);
91 | });
92 |
93 | window.open();
94 | };
--------------------------------------------------------------------------------
/hooks/README:
--------------------------------------------------------------------------------
1 | These files are not yet supported as of 1.4.0 but will be in a near future release.
2 |
--------------------------------------------------------------------------------
/hooks/add.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | #
3 | # This is the module project add hook that will be
4 | # called when your module is added to a project
5 | #
6 | import os, sys
7 |
8 | def dequote(s):
9 | if s[0:1] == '"':
10 | return s[1:-1]
11 | return s
12 |
13 | def main(args,argc):
14 | # You will get the following command line arguments
15 | # in the following order:
16 | #
17 | # project_dir = the full path to the project root directory
18 | # project_type = the type of project (desktop, mobile, ipad)
19 | # project_name = the name of the project
20 | #
21 | project_dir = dequote(os.path.expanduser(args[1]))
22 | project_type = dequote(args[2])
23 | project_name = dequote(args[3])
24 |
25 | # TODO: write your add hook here (optional)
26 |
27 |
28 | # exit
29 | sys.exit(0)
30 |
31 |
32 |
33 | if __name__ == '__main__':
34 | main(sys.argv,len(sys.argv))
35 |
36 |
--------------------------------------------------------------------------------
/hooks/install.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | #
3 | # This is the module install hook that will be
4 | # called when your module is first installed
5 | #
6 | import os, sys
7 |
8 | def main(args,argc):
9 |
10 | # TODO: write your install hook here (optional)
11 |
12 | # exit
13 | sys.exit(0)
14 |
15 |
16 |
17 | if __name__ == '__main__':
18 | main(sys.argv,len(sys.argv))
19 |
20 |
--------------------------------------------------------------------------------
/hooks/remove.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | #
3 | # This is the module project remove hook that will be
4 | # called when your module is remove from a project
5 | #
6 | import os, sys
7 |
8 | def dequote(s):
9 | if s[0:1] == '"':
10 | return s[1:-1]
11 | return s
12 |
13 | def main(args,argc):
14 | # You will get the following command line arguments
15 | # in the following order:
16 | #
17 | # project_dir = the full path to the project root directory
18 | # project_type = the type of project (desktop, mobile, ipad)
19 | # project_name = the name of the project
20 | #
21 | project_dir = dequote(os.path.expanduser(args[1]))
22 | project_type = dequote(args[2])
23 | project_name = dequote(args[3])
24 |
25 | # TODO: write your remove hook here (optional)
26 |
27 | # exit
28 | sys.exit(0)
29 |
30 |
31 |
32 | if __name__ == '__main__':
33 | main(sys.argv,len(sys.argv))
34 |
35 |
--------------------------------------------------------------------------------
/hooks/uninstall.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | #
3 | # This is the module uninstall hook that will be
4 | # called when your module is uninstalled
5 | #
6 | import os, sys
7 |
8 | def main(args,argc):
9 |
10 | # TODO: write your uninstall hook here (optional)
11 |
12 | # exit
13 | sys.exit(0)
14 |
15 |
16 | if __name__ == '__main__':
17 | main(sys.argv,len(sys.argv))
18 |
19 |
--------------------------------------------------------------------------------
/launch:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ./build.py
3 | rm -rf ~/Library/Application\ Support/Titanium/modules/iphone/it.smc.dakeyboardcontrol
4 | unzip \
5 | it.smc.dakeyboardcontrol-iphone-0.2.1.zip \
6 | -d ~/Library/Application\ Support/Titanium/
7 |
--------------------------------------------------------------------------------
/manifest:
--------------------------------------------------------------------------------
1 | #
2 | # this is your module manifest and used by Titanium
3 | # during compilation, packaging, distribution, etc.
4 | #
5 | version: 0.4.0
6 | apiversion: 2
7 | description: TiDAKeyboardControl offers some advanced behaviour for the keyboard in Titanium SDK, kudos to @danielamitay
8 | author: Pier Paolo Ramon
9 | license: LGPL2.1
10 | copyright: Copyright (c) 2014 SMC Treviso s.r.l.
11 |
12 |
13 | # these should not be edited
14 | name: TiDAKeyboardControl
15 | moduleid: it.smc.dakeyboardcontrol
16 | guid: 1d7767b0-9492-466b-ac7d-7a0d593eec42
17 | platform: iphone
18 | architectures: armv7 arm64 i386 x86_64
19 | minsdk: 3.5.0.GA
20 |
--------------------------------------------------------------------------------
/module.xcconfig:
--------------------------------------------------------------------------------
1 | //
2 | // PLACE ANY BUILD DEFINITIONS IN THIS FILE AND THEY WILL BE
3 | // PICKED UP DURING THE APP BUILD FOR YOUR MODULE
4 | //
5 | // see the following webpage for instructions on the settings
6 | // for this file:
7 | // http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/XcodeBuildSystem/400-Build_Configurations/build_configs.html
8 | //
9 |
10 | //
11 | // How to add a Framework (example)
12 | //
13 | // OTHER_LDFLAGS=$(inherited) -framework Foo
14 | //
15 | // Adding a framework for a specific version(s) of iPhone:
16 | //
17 | // OTHER_LDFLAGS[sdk=iphoneos4*]=$(inherited) -framework Foo
18 | // OTHER_LDFLAGS[sdk=iphonesimulator4*]=$(inherited) -framework Foo
19 | //
20 | //
21 | // How to add a compiler define:
22 | //
23 | // OTHER_CFLAGS=$(inherited) -DFOO=1
24 | //
25 | //
26 | // IMPORTANT NOTE: always use $(inherited) in your overrides
27 | //
28 |
--------------------------------------------------------------------------------
/platform/README:
--------------------------------------------------------------------------------
1 | You can place platform-specific files here in sub-folders named "android" and/or "iphone", just as you can with normal Titanium Mobile SDK projects. Any folders and files you place here will be merged with the platform-specific files in a Titanium Mobile project that uses this module.
2 |
3 | When a Titanium Mobile project that uses this module is built, the files from this platform/ folder will be treated the same as files (if any) from the Titanium Mobile project's platform/ folder.
4 |
--------------------------------------------------------------------------------
/timodule.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/titanium.xcconfig:
--------------------------------------------------------------------------------
1 | //
2 | //
3 | // CHANGE THESE VALUES TO REFLECT THE VERSION (AND LOCATION IF DIFFERENT)
4 | // OF YOUR TITANIUM SDK YOU'RE BUILDING FOR
5 | //
6 | //
7 | TITANIUM_SDK_VERSION = 3.2.0.GA
8 |
9 |
10 | //
11 | // THESE SHOULD BE OK GENERALLY AS-IS
12 | //
13 | TITANIUM_SDK = ~/Library/Application Support/Titanium/mobilesdk/osx/$(TITANIUM_SDK_VERSION)
14 | TITANIUM_BASE_SDK = "$(TITANIUM_SDK)/iphone/include"
15 | TITANIUM_BASE_SDK2 = "$(TITANIUM_SDK)/iphone/include/TiCore"
16 | HEADER_SEARCH_PATHS= $(TITANIUM_BASE_SDK) $(TITANIUM_BASE_SDK2)
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------