From eaadd9626703482e5456be6a4491c8332e8f5e3a Mon Sep 17 00:00:00 2001 From: ylecollen Date: Wed, 14 Jan 2015 09:29:52 +0100 Subject: [PATCH] Add GrowingTextView to the project --- matrixConsole/External/.DS_Store | Bin 0 -> 6148 bytes .../External/GrowingTextView/.gitignore | 16 + .../GrowingTextView/HPGrowingTextView.podspec | 13 + .../External/GrowingTextView/LICENSE.txt | 21 + .../External/GrowingTextView/README.md | 59 ++ .../GrowingTextView/class/HPGrowingTextView.h | 126 ++++ .../GrowingTextView/class/HPGrowingTextView.m | 666 ++++++++++++++++++ .../class/HPTextViewInternal.h | 37 + .../class/HPTextViewInternal.m | 126 ++++ .../GrowingTextViewExampleAppDelegate.h | 41 ++ .../GrowingTextViewExampleAppDelegate.m | 104 +++ .../GrowingTextViewExampleViewController.h | 39 + .../GrowingTextViewExampleViewController.m | 202 ++++++ .../example/Default-568h@2x.png | Bin 0 -> 18594 bytes .../example/GrowingTextViewExample-Info.plist | 30 + .../project.pbxproj | 320 +++++++++ .../example/GrowingTextViewExample_Prefix.pch | 8 + .../GrowingTextView/example/MainWindow.xib | 417 +++++++++++ .../example/MessageEntryBackground.png | Bin 0 -> 181 bytes .../example/MessageEntryBackground@2x.png | Bin 0 -> 274 bytes .../example/MessageEntryInputField.png | Bin 0 -> 1356 bytes .../example/MessageEntryInputField@2x.png | Bin 0 -> 3177 bytes .../example/MessageEntrySendButton.png | Bin 0 -> 1037 bytes .../example/MessageEntrySendButton@2x.png | Bin 0 -> 2466 bytes .../example/MessageEntrySendButtonPressed.png | Bin 0 -> 1008 bytes .../MessageEntrySendButtonPressed@2x.png | Bin 0 -> 2365 bytes .../External/GrowingTextView/example/main.m | 36 + 27 files changed, 2261 insertions(+) create mode 100644 matrixConsole/External/.DS_Store create mode 100755 matrixConsole/External/GrowingTextView/.gitignore create mode 100755 matrixConsole/External/GrowingTextView/HPGrowingTextView.podspec create mode 100755 matrixConsole/External/GrowingTextView/LICENSE.txt create mode 100755 matrixConsole/External/GrowingTextView/README.md create mode 100755 matrixConsole/External/GrowingTextView/class/HPGrowingTextView.h create mode 100755 matrixConsole/External/GrowingTextView/class/HPGrowingTextView.m create mode 100755 matrixConsole/External/GrowingTextView/class/HPTextViewInternal.h create mode 100755 matrixConsole/External/GrowingTextView/class/HPTextViewInternal.m create mode 100755 matrixConsole/External/GrowingTextView/example/Classes/GrowingTextViewExampleAppDelegate.h create mode 100755 matrixConsole/External/GrowingTextView/example/Classes/GrowingTextViewExampleAppDelegate.m create mode 100755 matrixConsole/External/GrowingTextView/example/Classes/GrowingTextViewExampleViewController.h create mode 100755 matrixConsole/External/GrowingTextView/example/Classes/GrowingTextViewExampleViewController.m create mode 100755 matrixConsole/External/GrowingTextView/example/Default-568h@2x.png create mode 100755 matrixConsole/External/GrowingTextView/example/GrowingTextViewExample-Info.plist create mode 100755 matrixConsole/External/GrowingTextView/example/GrowingTextViewExample.xcodeproj/project.pbxproj create mode 100755 matrixConsole/External/GrowingTextView/example/GrowingTextViewExample_Prefix.pch create mode 100755 matrixConsole/External/GrowingTextView/example/MainWindow.xib create mode 100755 matrixConsole/External/GrowingTextView/example/MessageEntryBackground.png create mode 100755 matrixConsole/External/GrowingTextView/example/MessageEntryBackground@2x.png create mode 100755 matrixConsole/External/GrowingTextView/example/MessageEntryInputField.png create mode 100755 matrixConsole/External/GrowingTextView/example/MessageEntryInputField@2x.png create mode 100755 matrixConsole/External/GrowingTextView/example/MessageEntrySendButton.png create mode 100755 matrixConsole/External/GrowingTextView/example/MessageEntrySendButton@2x.png create mode 100755 matrixConsole/External/GrowingTextView/example/MessageEntrySendButtonPressed.png create mode 100755 matrixConsole/External/GrowingTextView/example/MessageEntrySendButtonPressed@2x.png create mode 100755 matrixConsole/External/GrowingTextView/example/main.m diff --git a/matrixConsole/External/.DS_Store b/matrixConsole/External/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 'MIT', :file => 'LICENSE.txt' } + s.author = { "Hans Pinckaers" => "hans.pinckaers@gmail.com" } + s.source = { :git => "https://github.com/HansPinckaers/GrowingTextView.git", :tag => s.version.to_s } + s.platform = :ios + s.source_files = 'Classes', 'class/**/*.{h,m}' + s.requires_arc = true +end diff --git a/matrixConsole/External/GrowingTextView/LICENSE.txt b/matrixConsole/External/GrowingTextView/LICENSE.txt new file mode 100755 index 000000000..954f712fb --- /dev/null +++ b/matrixConsole/External/GrowingTextView/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2011 Hans Pinckaers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/matrixConsole/External/GrowingTextView/README.md b/matrixConsole/External/GrowingTextView/README.md new file mode 100755 index 000000000..ca281caf2 --- /dev/null +++ b/matrixConsole/External/GrowingTextView/README.md @@ -0,0 +1,59 @@ +HPGrowingTextView +================= + +Multi-line/Autoresizing UITextView similar as in the SMS-app. The example project mimicks the look of Apple's SMS-app. + +![Screenshot](http://f.cl.ly/items/270f2F3q3d3q142m140A/ss.png) + +Properties +---------- + +```objective-c +int maxNumberOfLines; // Stops growing at this amount of lines. +int minNumberOfLines; // Starts growing at this amount of lines. +int maxHeight; // Specify the maximum height in points instead of lines. +int minHeight; // Specify the minimum height in points instead of lines. +BOOL animateHeightChange; // Animate the growing +NSTimeInterval animationDuration; // Adjust the duration of the growth animation. +``` + +UITextView borrowed properties +---------------- + +```objective-c +NSString *text; +UIFont *font; +UIColor *textColor; +NSTextAlignment textAlignment; +NSRange selectedRange; +BOOL editable; +UIDataDetectorTypes dataDetectorTypes; +UIReturnKeyType returnKeyType; +``` + +If you want to set other UITextView properties, use .internalTextView + +Delegate methods +--------------- + +```objective-c +-(BOOL)growingTextViewShouldBeginEditing:(HPGrowingTextView *)growingTextView; +-(BOOL)growingTextViewShouldEndEditing:(HPGrowingTextView *)growingTextView; + +-(void)growingTextViewDidBeginEditing:(HPGrowingTextView *)growingTextView; +-(void)growingTextViewDidEndEditing:(HPGrowingTextView *)growingTextView; + +-(BOOL)growingTextView:(HPGrowingTextView *)growingTextView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text; +-(void)growingTextViewDidChange:(HPGrowingTextView *)growingTextView; + +// Called WITHIN animation block! +-(void)growingTextView:(HPGrowingTextView *)growingTextView willChangeHeight:(float)height; + +// Called after animation +-(void)growingTextView:(HPGrowingTextView *)growingTextView didChangeHeight:(float)height; + +-(void)growingTextViewDidChangeSelection:(HPGrowingTextView *)growingTextView; +-(BOOL)growingTextViewShouldReturn:(HPGrowingTextView *)growingTextView; +``` + +For more info, see blogpost: http://www.hanspinckaers.com/multi-line-uitextview-similar-to-sms diff --git a/matrixConsole/External/GrowingTextView/class/HPGrowingTextView.h b/matrixConsole/External/GrowingTextView/class/HPGrowingTextView.h new file mode 100755 index 000000000..8b343c5be --- /dev/null +++ b/matrixConsole/External/GrowingTextView/class/HPGrowingTextView.h @@ -0,0 +1,126 @@ +// +// HPTextView.h +// +// Created by Hans Pinckaers on 29-06-10. +// +// MIT License +// +// Copyright (c) 2011 Hans Pinckaers +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +#if __IPHONE_OS_VERSION_MAX_ALLOWED < 60000 + // UITextAlignment is deprecated in iOS 6.0+, use NSTextAlignment instead. + // Reference: https://developer.apple.com/library/ios/documentation/uikit/reference/NSString_UIKit_Additions/Reference/Reference.html + #define NSTextAlignment UITextAlignment +#endif + +@class HPGrowingTextView; +@class HPTextViewInternal; + +@protocol HPGrowingTextViewDelegate + +@optional +- (BOOL)growingTextViewShouldBeginEditing:(HPGrowingTextView *)growingTextView; +- (BOOL)growingTextViewShouldEndEditing:(HPGrowingTextView *)growingTextView; + +- (void)growingTextViewDidBeginEditing:(HPGrowingTextView *)growingTextView; +- (void)growingTextViewDidEndEditing:(HPGrowingTextView *)growingTextView; + +- (BOOL)growingTextView:(HPGrowingTextView *)growingTextView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text; +- (void)growingTextViewDidChange:(HPGrowingTextView *)growingTextView; + +- (void)growingTextView:(HPGrowingTextView *)growingTextView willChangeHeight:(float)height; +- (void)growingTextView:(HPGrowingTextView *)growingTextView didChangeHeight:(float)height; + +- (void)growingTextViewDidChangeSelection:(HPGrowingTextView *)growingTextView; +- (BOOL)growingTextViewShouldReturn:(HPGrowingTextView *)growingTextView; +@end + +@interface HPGrowingTextView : UIView { + HPTextViewInternal *internalTextView; + + int minHeight; + int maxHeight; + + //class properties + int maxNumberOfLines; + int minNumberOfLines; + + BOOL animateHeightChange; + NSTimeInterval animationDuration; + + //uitextview properties + NSObject *__unsafe_unretained delegate; + NSTextAlignment textAlignment; + NSRange selectedRange; + BOOL editable; + UIDataDetectorTypes dataDetectorTypes; + UIReturnKeyType returnKeyType; + UIKeyboardType keyboardType; + + UIEdgeInsets contentInset; +} + +//real class properties +@property int maxNumberOfLines; +@property int minNumberOfLines; +@property (nonatomic) int maxHeight; +@property (nonatomic) int minHeight; +@property BOOL animateHeightChange; +@property NSTimeInterval animationDuration; +@property (nonatomic, strong) NSString *placeholder; +@property (nonatomic, strong) UIColor *placeholderColor; +@property (nonatomic, strong) UITextView *internalTextView; + + +//uitextview properties +@property(unsafe_unretained) NSObject *delegate; +@property(nonatomic,strong) NSString *text; +@property(nonatomic,strong) UIFont *font; +@property(nonatomic,strong) UIColor *textColor; +@property(nonatomic) NSTextAlignment textAlignment; // default is NSTextAlignmentLeft +@property(nonatomic) NSRange selectedRange; // only ranges of length 0 are supported +@property(nonatomic,getter=isEditable) BOOL editable; +@property(nonatomic) UIDataDetectorTypes dataDetectorTypes __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_3_0); +@property (nonatomic) UIReturnKeyType returnKeyType; +@property (nonatomic) UIKeyboardType keyboardType; +@property (assign) UIEdgeInsets contentInset; +@property (nonatomic) BOOL isScrollable; +@property(nonatomic) BOOL enablesReturnKeyAutomatically; + +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 +- (id)initWithFrame:(CGRect)frame textContainer:(NSTextContainer *)textContainer; +#endif + +//uitextview methods +//need others? use .internalTextView +- (BOOL)becomeFirstResponder; +- (BOOL)resignFirstResponder; +- (BOOL)isFirstResponder; + +- (BOOL)hasText; +- (void)scrollRangeToVisible:(NSRange)range; + +// call to force a height change (e.g. after you change max/min lines) +- (void)refreshHeight; + +@end diff --git a/matrixConsole/External/GrowingTextView/class/HPGrowingTextView.m b/matrixConsole/External/GrowingTextView/class/HPGrowingTextView.m new file mode 100755 index 000000000..9871c6fa9 --- /dev/null +++ b/matrixConsole/External/GrowingTextView/class/HPGrowingTextView.m @@ -0,0 +1,666 @@ +// +// HPTextView.m +// +// Created by Hans Pinckaers on 29-06-10. +// +// MIT License +// +// Copyright (c) 2011 Hans Pinckaers +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "HPGrowingTextView.h" +#import "HPTextViewInternal.h" + +@interface HPGrowingTextView(private) +-(void)commonInitialiser; +-(void)resizeTextView:(NSInteger)newSizeH; +-(void)growDidStop; +@end + +@implementation HPGrowingTextView +@synthesize internalTextView; +@synthesize delegate; +@synthesize maxHeight; +@synthesize minHeight; +@synthesize font; +@synthesize textColor; +@synthesize textAlignment; +@synthesize selectedRange; +@synthesize editable; +@synthesize dataDetectorTypes; +@synthesize animateHeightChange; +@synthesize animationDuration; +@synthesize returnKeyType; +@dynamic placeholder; +@dynamic placeholderColor; + +// having initwithcoder allows us to use HPGrowingTextView in a Nib. -- aob, 9/2011 +- (id)initWithCoder:(NSCoder *)aDecoder +{ + if ((self = [super initWithCoder:aDecoder])) { + [self commonInitialiser]; + } + return self; +} + +- (id)initWithFrame:(CGRect)frame { + if ((self = [super initWithFrame:frame])) { + [self commonInitialiser]; + } + return self; +} + +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 +- (id)initWithFrame:(CGRect)frame textContainer:(NSTextContainer *)textContainer { + if ((self = [super initWithFrame:frame])) { + [self commonInitialiser:textContainer]; + } + return self; +} + +-(void)commonInitialiser { + [self commonInitialiser:nil]; +} + +-(void)commonInitialiser:(NSTextContainer *)textContainer +#else +-(void)commonInitialiser +#endif +{ + // Initialization code + CGRect r = self.frame; + r.origin.y = 0; + r.origin.x = 0; +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 + internalTextView = [[HPTextViewInternal alloc] initWithFrame:r textContainer:textContainer]; +#else + internalTextView = [[HPTextViewInternal alloc] initWithFrame:r]; +#endif + internalTextView.delegate = self; + internalTextView.scrollEnabled = NO; + internalTextView.font = [UIFont fontWithName:@"Helvetica" size:13]; + internalTextView.contentInset = UIEdgeInsetsZero; + internalTextView.showsHorizontalScrollIndicator = NO; + internalTextView.text = @"-"; + internalTextView.contentMode = UIViewContentModeRedraw; + [self addSubview:internalTextView]; + + minHeight = internalTextView.frame.size.height; + minNumberOfLines = 1; + + animateHeightChange = YES; + animationDuration = 0.1f; + + internalTextView.text = @""; + + [self setMaxNumberOfLines:3]; + + [self setPlaceholderColor:[UIColor lightGrayColor]]; + internalTextView.displayPlaceHolder = YES; +} + +-(CGSize)sizeThatFits:(CGSize)size +{ + if (self.text.length == 0) { + size.height = minHeight; + } + return size; +} + +-(void)layoutSubviews +{ + [super layoutSubviews]; + + CGRect r = self.bounds; + r.origin.y = 0; + r.origin.x = contentInset.left; + r.size.width -= contentInset.left + contentInset.right; + + internalTextView.frame = r; +} + +-(void)setContentInset:(UIEdgeInsets)inset +{ + contentInset = inset; + + CGRect r = self.frame; + r.origin.y = inset.top - inset.bottom; + r.origin.x = inset.left; + r.size.width -= inset.left + inset.right; + + internalTextView.frame = r; + + [self setMaxNumberOfLines:maxNumberOfLines]; + [self setMinNumberOfLines:minNumberOfLines]; +} + +-(UIEdgeInsets)contentInset +{ + return contentInset; +} + +-(void)setMaxNumberOfLines:(int)n +{ + if(n == 0 && maxHeight > 0) return; // the user specified a maxHeight themselves. + + // Use internalTextView for height calculations, thanks to Gwynne + NSString *saveText = internalTextView.text, *newText = @"-"; + + internalTextView.delegate = nil; + internalTextView.hidden = YES; + + for (int i = 1; i < n; ++i) + newText = [newText stringByAppendingString:@"\n|W|"]; + + internalTextView.text = newText; + + maxHeight = [self measureHeight]; + + internalTextView.text = saveText; + internalTextView.hidden = NO; + internalTextView.delegate = self; + + [self sizeToFit]; + + maxNumberOfLines = n; +} + +-(int)maxNumberOfLines +{ + return maxNumberOfLines; +} + +- (void)setMaxHeight:(int)height +{ + maxHeight = height; + maxNumberOfLines = 0; +} + +-(void)setMinNumberOfLines:(int)m +{ + if(m == 0 && minHeight > 0) return; // the user specified a minHeight themselves. + + // Use internalTextView for height calculations, thanks to Gwynne + NSString *saveText = internalTextView.text, *newText = @"-"; + + internalTextView.delegate = nil; + internalTextView.hidden = YES; + + for (int i = 1; i < m; ++i) + newText = [newText stringByAppendingString:@"\n|W|"]; + + internalTextView.text = newText; + + minHeight = [self measureHeight]; + + internalTextView.text = saveText; + internalTextView.hidden = NO; + internalTextView.delegate = self; + + [self sizeToFit]; + + minNumberOfLines = m; +} + +-(int)minNumberOfLines +{ + return minNumberOfLines; +} + +- (void)setMinHeight:(int)height +{ + minHeight = height; + minNumberOfLines = 0; +} + +- (NSString *)placeholder +{ + return internalTextView.placeholder; +} + +- (void)setPlaceholder:(NSString *)placeholder +{ + [internalTextView setPlaceholder:placeholder]; + [internalTextView setNeedsDisplay]; +} + +- (UIColor *)placeholderColor +{ + return internalTextView.placeholderColor; +} + +- (void)setPlaceholderColor:(UIColor *)placeholderColor +{ + [internalTextView setPlaceholderColor:placeholderColor]; +} + +- (void)textViewDidChange:(UITextView *)textView +{ + [self refreshHeight]; +} + +- (void)refreshHeight +{ + //size of content, so we can set the frame of self + NSInteger newSizeH = [self measureHeight]; + if (newSizeH < minHeight || !internalTextView.hasText) { + newSizeH = minHeight; //not smalles than minHeight + } + else if (maxHeight && newSizeH > maxHeight) { + newSizeH = maxHeight; // not taller than maxHeight + } + + if (internalTextView.frame.size.height != newSizeH) + { + // if our new height is greater than the maxHeight + // sets not set the height or move things + // around and enable scrolling + if (newSizeH >= maxHeight) + { + if(!internalTextView.scrollEnabled){ + internalTextView.scrollEnabled = YES; + [internalTextView flashScrollIndicators]; + } + + } else { + internalTextView.scrollEnabled = NO; + } + + // [fixed] Pasting too much text into the view failed to fire the height change, + // thanks to Gwynne + if (newSizeH <= maxHeight) + { + if(animateHeightChange) { + + if ([UIView resolveClassMethod:@selector(animateWithDuration:animations:)]) { +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000 + [UIView animateWithDuration:animationDuration + delay:0 + options:(UIViewAnimationOptionAllowUserInteraction| + UIViewAnimationOptionBeginFromCurrentState) + animations:^(void) { + [self resizeTextView:newSizeH]; + } + completion:^(BOOL finished) { + if ([delegate respondsToSelector:@selector(growingTextView:didChangeHeight:)]) { + [delegate growingTextView:self didChangeHeight:newSizeH]; + } + }]; +#endif + } else { + [UIView beginAnimations:@"" context:nil]; + [UIView setAnimationDuration:animationDuration]; + [UIView setAnimationDelegate:self]; + [UIView setAnimationDidStopSelector:@selector(growDidStop)]; + [UIView setAnimationBeginsFromCurrentState:YES]; + [self resizeTextView:newSizeH]; + [UIView commitAnimations]; + } + } else { + [self resizeTextView:newSizeH]; + // [fixed] The growingTextView:didChangeHeight: delegate method was not called at all when not animating height changes. + // thanks to Gwynne + + if ([delegate respondsToSelector:@selector(growingTextView:didChangeHeight:)]) { + [delegate growingTextView:self didChangeHeight:newSizeH]; + } + } + } + } + // Display (or not) the placeholder string + + BOOL wasDisplayingPlaceholder = internalTextView.displayPlaceHolder; + internalTextView.displayPlaceHolder = self.internalTextView.text.length == 0; + + if (wasDisplayingPlaceholder != internalTextView.displayPlaceHolder) { + [internalTextView setNeedsDisplay]; + } + + + // scroll to caret (needed on iOS7) + if ([self respondsToSelector:@selector(snapshotViewAfterScreenUpdates:)]) + { + [self performSelector:@selector(resetScrollPositionForIOS7) withObject:nil afterDelay:0.1f]; + } + + // Tell the delegate that the text view changed + if ([delegate respondsToSelector:@selector(growingTextViewDidChange:)]) { + [delegate growingTextViewDidChange:self]; + } +} + +// Code from apple developer forum - @Steve Krulewitz, @Mark Marszal, @Eric Silverberg +- (CGFloat)measureHeight +{ + if ([self respondsToSelector:@selector(snapshotViewAfterScreenUpdates:)]) + { + return ceilf([self.internalTextView sizeThatFits:self.internalTextView.frame.size].height); + } + else { + return self.internalTextView.contentSize.height; + } +} + +- (void)resetScrollPositionForIOS7 +{ + CGRect r = [internalTextView caretRectForPosition:internalTextView.selectedTextRange.end]; + CGFloat caretY = MAX(r.origin.y - internalTextView.frame.size.height + r.size.height + 8, 0); + if (internalTextView.contentOffset.y < caretY && r.origin.y != INFINITY) + internalTextView.contentOffset = CGPointMake(0, caretY); +} + +-(void)resizeTextView:(NSInteger)newSizeH +{ + if ([delegate respondsToSelector:@selector(growingTextView:willChangeHeight:)]) { + [delegate growingTextView:self willChangeHeight:newSizeH]; + } + + CGRect internalTextViewFrame = self.frame; + internalTextViewFrame.size.height = newSizeH; // + padding + self.frame = internalTextViewFrame; + + internalTextViewFrame.origin.y = contentInset.top - contentInset.bottom; + internalTextViewFrame.origin.x = contentInset.left; + + if(!CGRectEqualToRect(internalTextView.frame, internalTextViewFrame)) internalTextView.frame = internalTextViewFrame; +} + +- (void)growDidStop +{ + // scroll to caret (needed on iOS7) + if ([self respondsToSelector:@selector(snapshotViewAfterScreenUpdates:)]) + { + [self resetScrollPositionForIOS7]; + } + + if ([delegate respondsToSelector:@selector(growingTextView:didChangeHeight:)]) { + [delegate growingTextView:self didChangeHeight:self.frame.size.height]; + } +} + +-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event +{ + [internalTextView becomeFirstResponder]; +} + +- (BOOL)becomeFirstResponder +{ + [super becomeFirstResponder]; + return [self.internalTextView becomeFirstResponder]; +} + +-(BOOL)resignFirstResponder +{ + [super resignFirstResponder]; + return [internalTextView resignFirstResponder]; +} + +-(BOOL)isFirstResponder +{ + return [self.internalTextView isFirstResponder]; +} + + + +/////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark UITextView properties +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setText:(NSString *)newText +{ + internalTextView.text = newText; + + // include this line to analyze the height of the textview. + // fix from Ankit Thakur + [self performSelector:@selector(textViewDidChange:) withObject:internalTextView]; +} + +-(NSString*) text +{ + return internalTextView.text; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setFont:(UIFont *)afont +{ + internalTextView.font= afont; + + [self setMaxNumberOfLines:maxNumberOfLines]; + [self setMinNumberOfLines:minNumberOfLines]; +} + +-(UIFont *)font +{ + return internalTextView.font; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setTextColor:(UIColor *)color +{ + internalTextView.textColor = color; +} + +-(UIColor*)textColor{ + return internalTextView.textColor; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setBackgroundColor:(UIColor *)backgroundColor +{ + [super setBackgroundColor:backgroundColor]; + internalTextView.backgroundColor = backgroundColor; +} + +-(UIColor*)backgroundColor +{ + return internalTextView.backgroundColor; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setTextAlignment:(NSTextAlignment)aligment +{ + internalTextView.textAlignment = aligment; +} + +-(NSTextAlignment)textAlignment +{ + return internalTextView.textAlignment; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setSelectedRange:(NSRange)range +{ + internalTextView.selectedRange = range; +} + +-(NSRange)selectedRange +{ + return internalTextView.selectedRange; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +- (void)setIsScrollable:(BOOL)isScrollable +{ + internalTextView.scrollEnabled = isScrollable; +} + +- (BOOL)isScrollable +{ + return internalTextView.scrollEnabled; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setEditable:(BOOL)beditable +{ + internalTextView.editable = beditable; +} + +-(BOOL)isEditable +{ + return internalTextView.editable; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setReturnKeyType:(UIReturnKeyType)keyType +{ + internalTextView.returnKeyType = keyType; +} + +-(UIReturnKeyType)returnKeyType +{ + return internalTextView.returnKeyType; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +- (void)setKeyboardType:(UIKeyboardType)keyType +{ + internalTextView.keyboardType = keyType; +} + +- (UIKeyboardType)keyboardType +{ + return internalTextView.keyboardType; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +- (void)setEnablesReturnKeyAutomatically:(BOOL)enablesReturnKeyAutomatically +{ + internalTextView.enablesReturnKeyAutomatically = enablesReturnKeyAutomatically; +} + +- (BOOL)enablesReturnKeyAutomatically +{ + return internalTextView.enablesReturnKeyAutomatically; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setDataDetectorTypes:(UIDataDetectorTypes)datadetector +{ + internalTextView.dataDetectorTypes = datadetector; +} + +-(UIDataDetectorTypes)dataDetectorTypes +{ + return internalTextView.dataDetectorTypes; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +- (BOOL)hasText{ + return [internalTextView hasText]; +} + +- (void)scrollRangeToVisible:(NSRange)range +{ + [internalTextView scrollRangeToVisible:range]; +} + +///////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark - +#pragma mark UITextViewDelegate + + +/////////////////////////////////////////////////////////////////////////////////////////////////// +- (BOOL)textViewShouldBeginEditing:(UITextView *)textView { + if ([delegate respondsToSelector:@selector(growingTextViewShouldBeginEditing:)]) { + return [delegate growingTextViewShouldBeginEditing:self]; + + } else { + return YES; + } +} + + +/////////////////////////////////////////////////////////////////////////////////////////////////// +- (BOOL)textViewShouldEndEditing:(UITextView *)textView { + if ([delegate respondsToSelector:@selector(growingTextViewShouldEndEditing:)]) { + return [delegate growingTextViewShouldEndEditing:self]; + + } else { + return YES; + } +} + + +/////////////////////////////////////////////////////////////////////////////////////////////////// +- (void)textViewDidBeginEditing:(UITextView *)textView { + if ([delegate respondsToSelector:@selector(growingTextViewDidBeginEditing:)]) { + [delegate growingTextViewDidBeginEditing:self]; + } +} + + +/////////////////////////////////////////////////////////////////////////////////////////////////// +- (void)textViewDidEndEditing:(UITextView *)textView { + if ([delegate respondsToSelector:@selector(growingTextViewDidEndEditing:)]) { + [delegate growingTextViewDidEndEditing:self]; + } +} + + +/////////////////////////////////////////////////////////////////////////////////////////////////// +- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range + replacementText:(NSString *)atext { + + //weird 1 pixel bug when clicking backspace when textView is empty + if(![textView hasText] && [atext isEqualToString:@""]) return NO; + + //Added by bretdabaker: sometimes we want to handle this ourselves + if ([delegate respondsToSelector:@selector(growingTextView:shouldChangeTextInRange:replacementText:)]) + return [delegate growingTextView:self shouldChangeTextInRange:range replacementText:atext]; + + if ([atext isEqualToString:@"\n"]) { + if ([delegate respondsToSelector:@selector(growingTextViewShouldReturn:)]) { + if (![delegate performSelector:@selector(growingTextViewShouldReturn:) withObject:self]) { + return YES; + } else { + [textView resignFirstResponder]; + return NO; + } + } + } + + return YES; + + +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +- (void)textViewDidChangeSelection:(UITextView *)textView { + if ([delegate respondsToSelector:@selector(growingTextViewDidChangeSelection:)]) { + [delegate growingTextViewDidChangeSelection:self]; + } +} + + + +@end diff --git a/matrixConsole/External/GrowingTextView/class/HPTextViewInternal.h b/matrixConsole/External/GrowingTextView/class/HPTextViewInternal.h new file mode 100755 index 000000000..175f4d472 --- /dev/null +++ b/matrixConsole/External/GrowingTextView/class/HPTextViewInternal.h @@ -0,0 +1,37 @@ +// +// HPTextViewInternal.h +// +// Created by Hans Pinckaers on 29-06-10. +// +// MIT License +// +// Copyright (c) 2011 Hans Pinckaers +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + + +@interface HPTextViewInternal : UITextView + +@property (nonatomic, strong) NSString *placeholder; +@property (nonatomic, strong) UIColor *placeholderColor; +@property (nonatomic) BOOL displayPlaceHolder; + +@end diff --git a/matrixConsole/External/GrowingTextView/class/HPTextViewInternal.m b/matrixConsole/External/GrowingTextView/class/HPTextViewInternal.m new file mode 100755 index 000000000..f3a6a1d60 --- /dev/null +++ b/matrixConsole/External/GrowingTextView/class/HPTextViewInternal.m @@ -0,0 +1,126 @@ +// +// HPTextViewInternal.m +// +// Created by Hans Pinckaers on 29-06-10. +// +// MIT License +// +// Copyright (c) 2011 Hans Pinckaers +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "HPTextViewInternal.h" + + +@implementation HPTextViewInternal + +-(void)setText:(NSString *)text +{ + BOOL originalValue = self.scrollEnabled; + //If one of GrowingTextView's superviews is a scrollView, and self.scrollEnabled == NO, + //setting the text programatically will cause UIKit to search upwards until it finds a scrollView with scrollEnabled==yes + //then scroll it erratically. Setting scrollEnabled temporarily to YES prevents this. + [self setScrollEnabled:YES]; + [super setText:text]; + [self setScrollEnabled:originalValue]; +} + +- (void)setScrollable:(BOOL)isScrollable +{ + [super setScrollEnabled:isScrollable]; +} + +-(void)setContentOffset:(CGPoint)s +{ + if(self.tracking || self.decelerating){ + //initiated by user... + + UIEdgeInsets insets = self.contentInset; + insets.bottom = 0; + insets.top = 0; + self.contentInset = insets; + + } else { + + float bottomOffset = (self.contentSize.height - self.frame.size.height + self.contentInset.bottom); + if(s.y < bottomOffset && self.scrollEnabled){ + UIEdgeInsets insets = self.contentInset; + insets.bottom = 8; + insets.top = 0; + self.contentInset = insets; + } + } + + // Fix "overscrolling" bug + if (s.y > self.contentSize.height - self.frame.size.height && !self.decelerating && !self.tracking && !self.dragging) + s = CGPointMake(s.x, self.contentSize.height - self.frame.size.height); + + [super setContentOffset:s]; +} + +-(void)setContentInset:(UIEdgeInsets)s +{ + UIEdgeInsets insets = s; + + if(s.bottom>8) insets.bottom = 0; + insets.top = 0; + + [super setContentInset:insets]; +} + +-(void)setContentSize:(CGSize)contentSize +{ + // is this an iOS5 bug? Need testing! + if(self.contentSize.height > contentSize.height) + { + UIEdgeInsets insets = self.contentInset; + insets.bottom = 0; + insets.top = 0; + self.contentInset = insets; + } + + [super setContentSize:contentSize]; +} + +- (void)drawRect:(CGRect)rect +{ + [super drawRect:rect]; + if (self.displayPlaceHolder && self.placeholder && self.placeholderColor) + { + if ([self respondsToSelector:@selector(snapshotViewAfterScreenUpdates:)]) + { + NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; + paragraphStyle.alignment = self.textAlignment; + [self.placeholder drawInRect:CGRectMake(5, 8 + self.contentInset.top, self.frame.size.width-self.contentInset.left, self.frame.size.height- self.contentInset.top) withAttributes:@{NSFontAttributeName:self.font, NSForegroundColorAttributeName:self.placeholderColor, NSParagraphStyleAttributeName:paragraphStyle}]; + } + else { + [self.placeholderColor set]; + [self.placeholder drawInRect:CGRectMake(8.0f, 8.0f, self.frame.size.width - 16.0f, self.frame.size.height - 16.0f) withFont:self.font]; + } + } +} + +-(void)setPlaceholder:(NSString *)placeholder +{ + _placeholder = placeholder; + + [self setNeedsDisplay]; +} + +@end diff --git a/matrixConsole/External/GrowingTextView/example/Classes/GrowingTextViewExampleAppDelegate.h b/matrixConsole/External/GrowingTextView/example/Classes/GrowingTextViewExampleAppDelegate.h new file mode 100755 index 000000000..fc649c315 --- /dev/null +++ b/matrixConsole/External/GrowingTextView/example/Classes/GrowingTextViewExampleAppDelegate.h @@ -0,0 +1,41 @@ +// +// GrowingTextViewExampleAppDelegate.h +// +// Created by Hans Pinckaers on 29-06-10. +// +// MIT License +// +// Copyright (c) 2011 Hans Pinckaers +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +@class GrowingTextViewExampleViewController; + +@interface GrowingTextViewExampleAppDelegate : NSObject { + UIWindow *window; + GrowingTextViewExampleViewController *viewController; +} + +@property (nonatomic, strong) IBOutlet UIWindow *window; +@property (nonatomic, strong) GrowingTextViewExampleViewController *viewController; + +@end + diff --git a/matrixConsole/External/GrowingTextView/example/Classes/GrowingTextViewExampleAppDelegate.m b/matrixConsole/External/GrowingTextView/example/Classes/GrowingTextViewExampleAppDelegate.m new file mode 100755 index 000000000..9cf8920af --- /dev/null +++ b/matrixConsole/External/GrowingTextView/example/Classes/GrowingTextViewExampleAppDelegate.m @@ -0,0 +1,104 @@ +// +// GrowingTextViewExampleAppDelegate.m +// +// Created by Hans Pinckaers on 29-06-10. +// +// MIT License +// +// Copyright (c) 2011 Hans Pinckaers +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "GrowingTextViewExampleAppDelegate.h" +#import "GrowingTextViewExampleViewController.h" + +@implementation GrowingTextViewExampleAppDelegate + +@synthesize window; +@synthesize viewController; + + +#pragma mark - +#pragma mark Application lifecycle + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + + // Override point for customization after application launch. + + viewController = [[GrowingTextViewExampleViewController alloc] init]; + + // Add the view controller's view to the window and display. + [window addSubview:viewController.view]; + [window makeKeyAndVisible]; + + return YES; +} + + +- (void)applicationWillResignActive:(UIApplication *)application { + /* + Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + */ +} + + +- (void)applicationDidEnterBackground:(UIApplication *)application { + /* + Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + If your application supports background execution, called instead of applicationWillTerminate: when the user quits. + */ +} + + +- (void)applicationWillEnterForeground:(UIApplication *)application { + /* + Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. + */ +} + + +- (void)applicationDidBecomeActive:(UIApplication *)application { + /* + Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + */ +} + + +- (void)applicationWillTerminate:(UIApplication *)application { + /* + Called when the application is about to terminate. + See also applicationDidEnterBackground:. + */ +} + + +#pragma mark - +#pragma mark Memory management + +- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { + /* + Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. + */ +} + + + + +@end diff --git a/matrixConsole/External/GrowingTextView/example/Classes/GrowingTextViewExampleViewController.h b/matrixConsole/External/GrowingTextView/example/Classes/GrowingTextViewExampleViewController.h new file mode 100755 index 000000000..260417baa --- /dev/null +++ b/matrixConsole/External/GrowingTextView/example/Classes/GrowingTextViewExampleViewController.h @@ -0,0 +1,39 @@ +// +// GrowingTextViewExampleViewController.h +// +// Created by Hans Pinckaers on 29-06-10. +// +// MIT License +// +// Copyright (c) 2011 Hans Pinckaers +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import +#import "HPGrowingTextView.h" + +@interface GrowingTextViewExampleViewController : UIViewController { + UIView *containerView; + HPGrowingTextView *textView; +} + +-(void)resignTextView; + +@end + diff --git a/matrixConsole/External/GrowingTextView/example/Classes/GrowingTextViewExampleViewController.m b/matrixConsole/External/GrowingTextView/example/Classes/GrowingTextViewExampleViewController.m new file mode 100755 index 000000000..6a80fd3bf --- /dev/null +++ b/matrixConsole/External/GrowingTextView/example/Classes/GrowingTextViewExampleViewController.m @@ -0,0 +1,202 @@ +// +// GrowingTextViewExampleViewController.m +// +// Created by Hans Pinckaers on 29-06-10. +// +// MIT License +// +// Copyright (c) 2011 Hans Pinckaers +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "GrowingTextViewExampleViewController.h" + +@implementation GrowingTextViewExampleViewController + + +-(id)init +{ + self = [super init]; + if(self){ + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(keyboardWillShow:) + name:UIKeyboardWillShowNotification + object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(keyboardWillHide:) + name:UIKeyboardWillHideNotification + object:nil]; + } + + return self; +} + + + +// Implement loadView to create a view hierarchy programmatically, without using a nib. +- (void)loadView { + self.view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; + self.view.backgroundColor = [UIColor colorWithRed:219.0f/255.0f green:226.0f/255.0f blue:237.0f/255.0f alpha:1]; + + containerView = [[UIView alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height - 40, 320, 40)]; + + textView = [[HPGrowingTextView alloc] initWithFrame:CGRectMake(6, 3, 240, 40)]; + textView.isScrollable = NO; + textView.contentInset = UIEdgeInsetsMake(0, 5, 0, 5); + + textView.minNumberOfLines = 1; + textView.maxNumberOfLines = 6; + // you can also set the maximum height in points with maxHeight + // textView.maxHeight = 200.0f; + textView.returnKeyType = UIReturnKeyGo; //just as an example + textView.font = [UIFont systemFontOfSize:15.0f]; + textView.delegate = self; + textView.internalTextView.scrollIndicatorInsets = UIEdgeInsetsMake(5, 0, 5, 0); + textView.backgroundColor = [UIColor whiteColor]; + textView.placeholder = @"Type to see the textView grow!"; + + // textView.text = @"test\n\ntest"; + // textView.animateHeightChange = NO; //turns off animation + + [self.view addSubview:containerView]; + + UIImage *rawEntryBackground = [UIImage imageNamed:@"MessageEntryInputField.png"]; + UIImage *entryBackground = [rawEntryBackground stretchableImageWithLeftCapWidth:13 topCapHeight:22]; + UIImageView *entryImageView = [[UIImageView alloc] initWithImage:entryBackground]; + entryImageView.frame = CGRectMake(5, 0, 248, 40); + entryImageView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; + + UIImage *rawBackground = [UIImage imageNamed:@"MessageEntryBackground.png"]; + UIImage *background = [rawBackground stretchableImageWithLeftCapWidth:13 topCapHeight:22]; + UIImageView *imageView = [[UIImageView alloc] initWithImage:background]; + imageView.frame = CGRectMake(0, 0, containerView.frame.size.width, containerView.frame.size.height); + imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; + + textView.autoresizingMask = UIViewAutoresizingFlexibleWidth; + + // view hierachy + [containerView addSubview:imageView]; + [containerView addSubview:textView]; + [containerView addSubview:entryImageView]; + + UIImage *sendBtnBackground = [[UIImage imageNamed:@"MessageEntrySendButton.png"] stretchableImageWithLeftCapWidth:13 topCapHeight:0]; + UIImage *selectedSendBtnBackground = [[UIImage imageNamed:@"MessageEntrySendButton.png"] stretchableImageWithLeftCapWidth:13 topCapHeight:0]; + + UIButton *doneBtn = [UIButton buttonWithType:UIButtonTypeCustom]; + doneBtn.frame = CGRectMake(containerView.frame.size.width - 69, 8, 63, 27); + doneBtn.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleLeftMargin; + [doneBtn setTitle:@"Done" forState:UIControlStateNormal]; + + [doneBtn setTitleShadowColor:[UIColor colorWithWhite:0 alpha:0.4] forState:UIControlStateNormal]; + doneBtn.titleLabel.shadowOffset = CGSizeMake (0.0, -1.0); + doneBtn.titleLabel.font = [UIFont boldSystemFontOfSize:18.0f]; + + [doneBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; + [doneBtn addTarget:self action:@selector(resignTextView) forControlEvents:UIControlEventTouchUpInside]; + [doneBtn setBackgroundImage:sendBtnBackground forState:UIControlStateNormal]; + [doneBtn setBackgroundImage:selectedSendBtnBackground forState:UIControlStateSelected]; + [containerView addSubview:doneBtn]; + containerView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin; +} + +-(void)resignTextView +{ + [textView resignFirstResponder]; +} + +//Code from Brett Schumann +-(void) keyboardWillShow:(NSNotification *)note{ + // get keyboard size and loctaion + CGRect keyboardBounds; + [[note.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] getValue: &keyboardBounds]; + NSNumber *duration = [note.userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey]; + NSNumber *curve = [note.userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey]; + + // Need to translate the bounds to account for rotation. + keyboardBounds = [self.view convertRect:keyboardBounds toView:nil]; + + // get a rect for the textView frame + CGRect containerFrame = containerView.frame; + containerFrame.origin.y = self.view.bounds.size.height - (keyboardBounds.size.height + containerFrame.size.height); + // animations settings + [UIView beginAnimations:nil context:NULL]; + [UIView setAnimationBeginsFromCurrentState:YES]; + [UIView setAnimationDuration:[duration doubleValue]]; + [UIView setAnimationCurve:[curve intValue]]; + + // set views with new info + containerView.frame = containerFrame; + + + // commit animations + [UIView commitAnimations]; +} + +-(void) keyboardWillHide:(NSNotification *)note{ + NSNumber *duration = [note.userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey]; + NSNumber *curve = [note.userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey]; + + // get a rect for the textView frame + CGRect containerFrame = containerView.frame; + containerFrame.origin.y = self.view.bounds.size.height - containerFrame.size.height; + + // animations settings + [UIView beginAnimations:nil context:NULL]; + [UIView setAnimationBeginsFromCurrentState:YES]; + [UIView setAnimationDuration:[duration doubleValue]]; + [UIView setAnimationCurve:[curve intValue]]; + + // set views with new info + containerView.frame = containerFrame; + + // commit animations + [UIView commitAnimations]; +} + +- (void)growingTextView:(HPGrowingTextView *)growingTextView willChangeHeight:(float)height +{ + float diff = (growingTextView.frame.size.height - height); + + CGRect r = containerView.frame; + r.size.height -= diff; + r.origin.y += diff; + containerView.frame = r; +} + +-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation +{ + return YES; +} + +- (void)didReceiveMemoryWarning { + // Releases the view if it doesn't have a superview. + [super didReceiveMemoryWarning]; + + // Release any cached data, images, etc that aren't in use. +} + +- (void)viewDidUnload { + // Release any retained subviews of the main view. + // e.g. self.myOutlet = nil; +} + + + +@end diff --git a/matrixConsole/External/GrowingTextView/example/Default-568h@2x.png b/matrixConsole/External/GrowingTextView/example/Default-568h@2x.png new file mode 100755 index 0000000000000000000000000000000000000000..0891b7aabfcf3422423b109c8beed2bab838c607 GIT binary patch literal 18594 zcmeI4X;f257Jx&9fS`ixvS;&$x8J@slQFSel)6zJN=?13FB7H(lQjRkSy8x_-S~tvu2gzn1oS+dLcF#eqtq$ z%tf9TTvX?`)R@}3uBI;jzS-=ZR-Td&MHaS&;!0?Ni*#$#`n*~CcQK)Q9vAQ~TUpnI!j)a2biYK^R)M~A5wUDZhx?ULMX z3x1P&qt=trOY6P2U67L=m=U?F|5#Uj(eCueNTZaHs_ceWiHeET+j+tp3Jt9g(ekqP z2WOvfR{qV+9r+o4J5?qK>7;;^+I7tGv-i)es$X_D=EoKF+S?zsyj^oRFElP}c}JT< zd8SUs-?O?}2YD#ngKbnHgzHBcboxK_2r9l(?eNCl-pEzkJm}fY?WC*jnS?VBE4EpY zO$fEejz6fU;W2Kl>JeQBZBl-%Irg`obSlg*@4QB;Dd1H7^Oi5wvt4d{RZ!8Og?^aE z)k0$1g+V3fd(gdQ3d&q2q-FL*uy#}|bc^=VhFsl0jBgUGJ+-s3U8MK9A!YJJMxpci z5hJ%|{DwV48fZn0{n5l$N_KcSb#NKE4plB`9I6Zt=Z!~-zw0{9tg$L&Ju1F0X)Cy8 zKF;(&lJ>x)Jw(=;p~sF(Sd9VWGwFE2rnyS9!f^DZ8+aCLq zQ};>lcJ1GDLqjm6Hd>|Eabno@P`~Bn(~6^aD_#yoEH(a?Nm1S<;S+hSxI5d16^<1lEM3NPFi zkqPrpL)+ zgnseFikg`gJVBha1&7C4;O6>h=dt~`ND+;Zd?W(4v2JIb7Pt>Td42%M-Ju-XAH#Pns762L}K3 zDhvsRqN0Ni(1UrishD2YvV?4*h2iFj$+&N||Fn$4n|^NSU+o?~jq`0jVQt8T9l{7b zXiwwODFh2V!Q6sqP9S>WH$oOf$N~=d0-bqTlD61!=`&0eAP-F>XN?*|gtOXX{ zQVTWyYo4ZK0GAw!GHf|pz9`D;-bbb*5LBX*{bnz|+)$@&P9|ORM2o?95{;ejvo&r- zq8cBhTN6nn)7~W>54U)%-F_-b?YKdfk5I8MHcuzBD5)!;yv#Z&R&^y=@=>VTIMy#r zX&U<=BsPkdqcMe<_}2+>H%XKyrr5ZR8_KVe>ZqYN z^=^~TFD};;rHJ$U;{~w^hYojl4hRI@SH$^K{YEo=sg)WY87r!*7blQK&qnpDo0`Vn zkl)9u9g=mCh&ZCJS(L4yN3k0kQ zuvg$h2KEEk51T+O0JQ+r0`R>g{jvqM0Mr6d3qUOZwE!?PI7HY@CE|dr sfw?Q;rAv?G4&^^8-z_>&sWXMxvD*gPOU4CBe-*@OtE+wfmVJNyHv)PfH~;_u literal 0 HcmV?d00001 diff --git a/matrixConsole/External/GrowingTextView/example/GrowingTextViewExample-Info.plist b/matrixConsole/External/GrowingTextView/example/GrowingTextViewExample-Info.plist new file mode 100755 index 000000000..32894445d --- /dev/null +++ b/matrixConsole/External/GrowingTextView/example/GrowingTextViewExample-Info.plist @@ -0,0 +1,30 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.yourcompany.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + NSMainNibFile + MainWindow + + diff --git a/matrixConsole/External/GrowingTextView/example/GrowingTextViewExample.xcodeproj/project.pbxproj b/matrixConsole/External/GrowingTextView/example/GrowingTextViewExample.xcodeproj/project.pbxproj new file mode 100755 index 000000000..53f47ed4c --- /dev/null +++ b/matrixConsole/External/GrowingTextView/example/GrowingTextViewExample.xcodeproj/project.pbxproj @@ -0,0 +1,320 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1D3623260D0F684500981E51 /* GrowingTextViewExampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* GrowingTextViewExampleAppDelegate.m */; }; + 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; + 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; + 28D7ACF80DDB3853001CB0EB /* GrowingTextViewExampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* GrowingTextViewExampleViewController.m */; }; + 3A5B30CE13EC633200DB7A65 /* HPGrowingTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A5B30CB13EC633200DB7A65 /* HPGrowingTextView.m */; }; + 3A5B30CF13EC633200DB7A65 /* HPTextViewInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A5B30CD13EC633200DB7A65 /* HPTextViewInternal.m */; }; + 3A6144DE17719E8500311E3E /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3A6144DD17719E8500311E3E /* Default-568h@2x.png */; }; + 3AC80F9613EC953D00712F9A /* MessageEntryBackground.png in Resources */ = {isa = PBXBuildFile; fileRef = 3AC80F9213EC953D00712F9A /* MessageEntryBackground.png */; }; + 3AC80F9713EC953D00712F9A /* MessageEntryBackground@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3AC80F9313EC953D00712F9A /* MessageEntryBackground@2x.png */; }; + 3AC80F9813EC953D00712F9A /* MessageEntryInputField.png in Resources */ = {isa = PBXBuildFile; fileRef = 3AC80F9413EC953D00712F9A /* MessageEntryInputField.png */; }; + 3AC80F9913EC953D00712F9A /* MessageEntryInputField@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3AC80F9513EC953D00712F9A /* MessageEntryInputField@2x.png */; }; + 3ADB373513EE98D60006E262 /* MessageEntrySendButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 3ADB373113EE98D60006E262 /* MessageEntrySendButton.png */; }; + 3ADB373613EE98D60006E262 /* MessageEntrySendButton@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3ADB373213EE98D60006E262 /* MessageEntrySendButton@2x.png */; }; + 3ADB373713EE98D60006E262 /* MessageEntrySendButtonPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = 3ADB373313EE98D60006E262 /* MessageEntrySendButtonPressed.png */; }; + 3ADB373813EE98D60006E262 /* MessageEntrySendButtonPressed@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3ADB373413EE98D60006E262 /* MessageEntrySendButtonPressed@2x.png */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 1D3623240D0F684500981E51 /* GrowingTextViewExampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GrowingTextViewExampleAppDelegate.h; sourceTree = ""; }; + 1D3623250D0F684500981E51 /* GrowingTextViewExampleAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GrowingTextViewExampleAppDelegate.m; sourceTree = ""; }; + 1D6058910D05DD3D006BFB54 /* GrowingTextViewExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GrowingTextViewExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; + 28D7ACF60DDB3853001CB0EB /* GrowingTextViewExampleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GrowingTextViewExampleViewController.h; sourceTree = ""; }; + 28D7ACF70DDB3853001CB0EB /* GrowingTextViewExampleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GrowingTextViewExampleViewController.m; sourceTree = ""; }; + 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 32CA4F630368D1EE00C91783 /* GrowingTextViewExample_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GrowingTextViewExample_Prefix.pch; sourceTree = ""; }; + 3A5B30CA13EC633200DB7A65 /* HPGrowingTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HPGrowingTextView.h; sourceTree = ""; }; + 3A5B30CB13EC633200DB7A65 /* HPGrowingTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HPGrowingTextView.m; sourceTree = ""; }; + 3A5B30CC13EC633200DB7A65 /* HPTextViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HPTextViewInternal.h; sourceTree = ""; }; + 3A5B30CD13EC633200DB7A65 /* HPTextViewInternal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HPTextViewInternal.m; sourceTree = ""; }; + 3A6144DD17719E8500311E3E /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; + 3AC80F9213EC953D00712F9A /* MessageEntryBackground.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = MessageEntryBackground.png; sourceTree = ""; }; + 3AC80F9313EC953D00712F9A /* MessageEntryBackground@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "MessageEntryBackground@2x.png"; sourceTree = ""; }; + 3AC80F9413EC953D00712F9A /* MessageEntryInputField.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = MessageEntryInputField.png; sourceTree = ""; }; + 3AC80F9513EC953D00712F9A /* MessageEntryInputField@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "MessageEntryInputField@2x.png"; sourceTree = ""; }; + 3ADB373113EE98D60006E262 /* MessageEntrySendButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = MessageEntrySendButton.png; sourceTree = ""; }; + 3ADB373213EE98D60006E262 /* MessageEntrySendButton@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "MessageEntrySendButton@2x.png"; sourceTree = ""; }; + 3ADB373313EE98D60006E262 /* MessageEntrySendButtonPressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = MessageEntrySendButtonPressed.png; sourceTree = ""; }; + 3ADB373413EE98D60006E262 /* MessageEntrySendButtonPressed@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "MessageEntrySendButtonPressed@2x.png"; sourceTree = ""; }; + 8D1107310486CEB800E47090 /* GrowingTextViewExample-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GrowingTextViewExample-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, + 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 080E96DDFE201D6D7F000001 /* Classes */ = { + isa = PBXGroup; + children = ( + 3A5B30C913EC633200DB7A65 /* HPGrowingTextView */, + 1D3623240D0F684500981E51 /* GrowingTextViewExampleAppDelegate.h */, + 1D3623250D0F684500981E51 /* GrowingTextViewExampleAppDelegate.m */, + 28D7ACF60DDB3853001CB0EB /* GrowingTextViewExampleViewController.h */, + 28D7ACF70DDB3853001CB0EB /* GrowingTextViewExampleViewController.m */, + ); + path = Classes; + sourceTree = ""; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 1D6058910D05DD3D006BFB54 /* GrowingTextViewExample.app */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { + isa = PBXGroup; + children = ( + 080E96DDFE201D6D7F000001 /* Classes */, + 29B97315FDCFA39411CA2CEA /* Other Sources */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = CustomTemplate; + sourceTree = ""; + }; + 29B97315FDCFA39411CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + 3A6144DD17719E8500311E3E /* Default-568h@2x.png */, + 32CA4F630368D1EE00C91783 /* GrowingTextViewExample_Prefix.pch */, + 29B97316FDCFA39411CA2CEA /* main.m */, + ); + name = "Other Sources"; + sourceTree = ""; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + 3ADB373113EE98D60006E262 /* MessageEntrySendButton.png */, + 3ADB373213EE98D60006E262 /* MessageEntrySendButton@2x.png */, + 3ADB373313EE98D60006E262 /* MessageEntrySendButtonPressed.png */, + 3ADB373413EE98D60006E262 /* MessageEntrySendButtonPressed@2x.png */, + 3AC80F9213EC953D00712F9A /* MessageEntryBackground.png */, + 3AC80F9313EC953D00712F9A /* MessageEntryBackground@2x.png */, + 3AC80F9413EC953D00712F9A /* MessageEntryInputField.png */, + 3AC80F9513EC953D00712F9A /* MessageEntryInputField@2x.png */, + 28AD733E0D9D9553002E5188 /* MainWindow.xib */, + 8D1107310486CEB800E47090 /* GrowingTextViewExample-Info.plist */, + ); + name = Resources; + sourceTree = ""; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, + 1D30AB110D05D00D00671497 /* Foundation.framework */, + 288765A40DF7441C002DB57D /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 3A5B30C913EC633200DB7A65 /* HPGrowingTextView */ = { + isa = PBXGroup; + children = ( + 3A5B30CA13EC633200DB7A65 /* HPGrowingTextView.h */, + 3A5B30CB13EC633200DB7A65 /* HPGrowingTextView.m */, + 3A5B30CC13EC633200DB7A65 /* HPTextViewInternal.h */, + 3A5B30CD13EC633200DB7A65 /* HPTextViewInternal.m */, + ); + name = HPGrowingTextView; + path = ../../class; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 1D6058900D05DD3D006BFB54 /* GrowingTextViewExample */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "GrowingTextViewExample" */; + buildPhases = ( + 1D60588D0D05DD3D006BFB54 /* Resources */, + 1D60588E0D05DD3D006BFB54 /* Sources */, + 1D60588F0D05DD3D006BFB54 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = GrowingTextViewExample; + productName = GrowingTextViewExample; + productReference = 1D6058910D05DD3D006BFB54 /* GrowingTextViewExample.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0460; + }; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "GrowingTextViewExample" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 1D6058900D05DD3D006BFB54 /* GrowingTextViewExample */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 1D60588D0D05DD3D006BFB54 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, + 3AC80F9613EC953D00712F9A /* MessageEntryBackground.png in Resources */, + 3AC80F9713EC953D00712F9A /* MessageEntryBackground@2x.png in Resources */, + 3AC80F9813EC953D00712F9A /* MessageEntryInputField.png in Resources */, + 3AC80F9913EC953D00712F9A /* MessageEntryInputField@2x.png in Resources */, + 3ADB373513EE98D60006E262 /* MessageEntrySendButton.png in Resources */, + 3ADB373613EE98D60006E262 /* MessageEntrySendButton@2x.png in Resources */, + 3ADB373713EE98D60006E262 /* MessageEntrySendButtonPressed.png in Resources */, + 3ADB373813EE98D60006E262 /* MessageEntrySendButtonPressed@2x.png in Resources */, + 3A6144DE17719E8500311E3E /* Default-568h@2x.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 1D60588E0D05DD3D006BFB54 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1D60589B0D05DD56006BFB54 /* main.m in Sources */, + 1D3623260D0F684500981E51 /* GrowingTextViewExampleAppDelegate.m in Sources */, + 28D7ACF80DDB3853001CB0EB /* GrowingTextViewExampleViewController.m in Sources */, + 3A5B30CE13EC633200DB7A65 /* HPGrowingTextView.m in Sources */, + 3A5B30CF13EC633200DB7A65 /* HPTextViewInternal.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 1D6058940D05DD3E006BFB54 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_OBJC_ARC = YES; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = GrowingTextViewExample_Prefix.pch; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + INFOPLIST_FILE = "GrowingTextViewExample-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + PRODUCT_NAME = GrowingTextViewExample; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 1D6058950D05DD3E006BFB54 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_OBJC_ARC = YES; + COPY_PHASE_STRIP = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = GrowingTextViewExample_Prefix.pch; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + INFOPLIST_FILE = "GrowingTextViewExample-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + PRODUCT_NAME = GrowingTextViewExample; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + SDKROOT = iphoneos; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "GrowingTextViewExample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1D6058940D05DD3E006BFB54 /* Debug */, + 1D6058950D05DD3E006BFB54 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "GrowingTextViewExample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/matrixConsole/External/GrowingTextView/example/GrowingTextViewExample_Prefix.pch b/matrixConsole/External/GrowingTextView/example/GrowingTextViewExample_Prefix.pch new file mode 100755 index 000000000..277fdfb6d --- /dev/null +++ b/matrixConsole/External/GrowingTextView/example/GrowingTextViewExample_Prefix.pch @@ -0,0 +1,8 @@ +// +// Prefix header for all source files of the 'GrowingTextViewExample' target in the 'GrowingTextViewExample' project +// + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/matrixConsole/External/GrowingTextView/example/MainWindow.xib b/matrixConsole/External/GrowingTextView/example/MainWindow.xib new file mode 100755 index 000000000..edaefc18b --- /dev/null +++ b/matrixConsole/External/GrowingTextView/example/MainWindow.xib @@ -0,0 +1,417 @@ + + + + 1024 + 10F569 + 788 + 1038.29 + 461.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 117 + + + YES + + + + YES + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + YES + + YES + + + YES + + + + YES + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + IBCocoaTouchFramework + + + + 292 + {320, 480} + + + 1 + MSAxIDEAA + + NO + NO + + IBCocoaTouchFramework + YES + + + + + YES + + + delegate + + + + 4 + + + + window + + + + 14 + + + + + YES + + 0 + + + + + + -1 + + + File's Owner + + + 3 + + + GrowingTextViewExample App Delegate + + + -2 + + + + + 12 + + + + + + + YES + + YES + -1.CustomClassName + -2.CustomClassName + 12.IBEditorWindowLastContentRect + 12.IBPluginDependency + 3.CustomClassName + 3.IBPluginDependency + + + YES + UIApplication + UIResponder + {{525, 276}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + GrowingTextViewExampleAppDelegate + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 15 + + + + YES + + GrowingTextViewExampleAppDelegate + NSObject + + YES + + YES + viewController + window + + + YES + GrowingTextViewExampleViewController + UIWindow + + + + YES + + YES + viewController + window + + + YES + + viewController + GrowingTextViewExampleViewController + + + window + UIWindow + + + + + IBProjectSource + Classes/GrowingTextViewExampleAppDelegate.h + + + + GrowingTextViewExampleAppDelegate + NSObject + + IBUserSource + + + + + GrowingTextViewExampleViewController + UIViewController + + IBProjectSource + Classes/GrowingTextViewExampleViewController.h + + + + UIWindow + UIView + + IBUserSource + + + + + + YES + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIAccessibility.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UINibLoading.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIResponder.h + + + + UIApplication + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIApplication.h + + + + UIResponder + NSObject + + + + UISearchBar + UIView + + IBFrameworkSource + UIKit.framework/Headers/UISearchBar.h + + + + UISearchDisplayController + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UISearchDisplayController.h + + + + UIView + + IBFrameworkSource + UIKit.framework/Headers/UITextField.h + + + + UIView + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIView.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UINavigationController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UIPopoverController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UISplitViewController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UITabBarController.h + + + + UIViewController + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIViewController.h + + + + UIWindow + UIView + + IBFrameworkSource + UIKit.framework/Headers/UIWindow.h + + + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 + + + YES + GrowingTextViewExample.xcodeproj + 3 + 117 + + diff --git a/matrixConsole/External/GrowingTextView/example/MessageEntryBackground.png b/matrixConsole/External/GrowingTextView/example/MessageEntryBackground.png new file mode 100755 index 0000000000000000000000000000000000000000..1db2bcea77a12d2b9f6d1fccdf2c0432e9690895 GIT binary patch literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^96+qW!2~3I4(hxDQZ=3~jv*SNb0-J#H5hO>&wTh# z+^9++*@mg~&-a-=c99vGr;pXmd6?x<^!LQ;x72`1#-QE2t*OrW=b^PT z7B{pk^!VA&S+In4TIh_Yzvr;$hklA!`RQMsiihwEy-AM^uNWQQ#n-qu$1^aXAk0|f g$%fAF#~VAv|Mw>-NH#9;0lI_1)78&qol`;+03n!3ssI20 literal 0 HcmV?d00001 diff --git a/matrixConsole/External/GrowingTextView/example/MessageEntryBackground@2x.png b/matrixConsole/External/GrowingTextView/example/MessageEntryBackground@2x.png new file mode 100755 index 0000000000000000000000000000000000000000..53d805a209540b08f5eb73eaff15259917fc6663 GIT binary patch literal 274 zcmeAS@N?(olHy`uVBq!ia0vp^0ze$V!2~4dpG=AZQk(@Ik;M!QVyYm_=ozH)0VsIH z)5S5wgZJ(=N4~=b94>)Dg);MRr~8h22WQ%mvv4FO#m8hanAq% literal 0 HcmV?d00001 diff --git a/matrixConsole/External/GrowingTextView/example/MessageEntryInputField.png b/matrixConsole/External/GrowingTextView/example/MessageEntryInputField.png new file mode 100755 index 0000000000000000000000000000000000000000..f784561c17f4c2f4d0ae0f26e5c3544fb822db84 GIT binary patch literal 1356 zcmV-S1+)5zP)7`^Y!<9D>w08fGxsKby(K$u`sAav0tvZ&V7xG)+Q*kD>$uGFMyDXm!3cIC!| zlt>pQu8c-&7p0{O8%isbpP6Z}fJMrW9ZFjfh8bXHJZIoe9^pN}7BXLQGH>p?-#OpU zz3<%_rS)oCM8wgQ2rQ2JLi0U*6i5zR#fHU`-V*!9e=PQ zfXT_pnV)|Aq5s_3GaY`ve-un(0EL6VA`k*-Hb4WC00#0>YHDiEr=NXZaq#VTc4cN} zK8LY&O&J~gI~Ksm$oJXk=p_j-4Va0`igCpmgWz0Z4hVoNl9Q8dudO{)h3}RY z4WO&5bMV}mvlPDrOafeVvh)kMX5VGz#sDxZc%RjgRg&}XfRj5#FE4+sfD_G34TrXlaa%*^y3n7~EH(pzOO17R@onr)E*umbcY$0#|;O$}~oGboo^+lFgi-}f~ft^>?| z24ERUN+D((%^CzUdkhJIeJ?jYKV?g}CQ<;0zO}UT@!DxHSPVYxYt0kc2GTDq)Tr z%`k^PYz;ZcMa~IoL=c}DG`G8teV+nk=CZdN5{F;Z7{qc*j6sldiW*o3rlxs39`>CJ zM`pfm#->aw2gxBTF-;AtLTZSbt5}LNPA2nIK}bJv(mz%SYFJUKr7qX=n5->3Je4qf z%}fTNQ6n4)3p1$YuJSB+^JNmv9-o^L1UX~?c4|bzcn+9AD=I0@!{oG05(do*V-RW7 zusV5Zj-3uCCZz*>fNEC2jXjSufTsM1k66fvYMd) O0000d-h2TZQQu=f|tS;S+HP13e)$z&;?m4 zD-b!?)04{ly~w$9DK3DQ+B3ilr*!>`d?dvSz>9cZN-qMcfE1qtU-y6%-v_A&r1%{8 zx(TNIGI$}y=Ri`I!N!J$o{v7-)wz53?#{Zpx{mht_OpBU>}l`n>gr{+&CbqFUv$eY z6J?n*X3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*2CvgQm>W|^)8XEy%3 z<>JM8N zf4I87g!|P_*yYi*+zyQQp8;F{ug}8ke)Lq^iqn01q2zF&p5Vl+Bb4m;$@_oV*h@(* zog^%bEXs=<121o@KlruTfwyqky|D9RU4A?;J}wA*C=$~j-1KzY%6B^Y%Op$&lTdL* zU4bMg1CDk2yZj!x&C&prK=Q(Gm4(S;YicL;{P9=y`&FOg?>Ot*FwABdyJZ8$N27Dm z1F*G+IX*v;?*o_VvHE^i)5y^V0?Au4)0HVBQm^?n%6a5xmLUg69m4 z6|M*~8Vs+!;Zo}f@L)%x)U&*Gut|oAoTFaBc{m|lg#8=FvrKzocibidmbq9FR!U)I zF#d^{1q;9mV1=+z!SFp-X$N3~urTZ_j8k_H>=G?NR)iSpWb407*qoM6N<$f?55=IRF3v literal 0 HcmV?d00001 diff --git a/matrixConsole/External/GrowingTextView/example/MessageEntrySendButtonPressed.png b/matrixConsole/External/GrowingTextView/example/MessageEntrySendButtonPressed.png new file mode 100755 index 0000000000000000000000000000000000000000..f7397d1c0b21e744e8cc0e8a9e788b446567d5cb GIT binary patch literal 1008 zcmV%D7>LDY1D1v(Esh8|OC<=Ozs9u8Z zlu-~Ah~1%x%+w4s#arIj%Z|;=PQTycih1dRpgMp-Bi8SDRDUkF+<%I^d4X)cHcN0<8R%@k+wI&fd0gOj zIl!J^1FOXXg1|x3q99L9z}R>MhQp&UI24BA;gP$*^cxe+_io|?%qp|YY|Hj$YXHZ+ zZs&1-qR-?{@_{Idvj)z*p{gqM^!7tfU%xUiJaSP0xEN`=-7>x3Z)WD)vXwTgc-AL* zcBH4JK!VLWz3)Grk4I!^@92j9!J!8cSv~Xf%gqn*fm3EQBfBl(yw@j%GSgFma~ALO z-*q&qLu-2{4D=5^9E*&fh|h59{W$E7Qx2yil%5vAH~`Raz(NXf6jci`&fAf5j98ow zmb?RHg2_}7@F&qF(334x#33GWiBH#@!rLb~E4-2eDV>UE_=AONA_`Ud?d!7AR5(xe0Z|g-L2!rViw|)4-fb~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