2015-12-28 08:39:17 +00:00
|
|
|
/*
|
|
|
|
Copyright 2015 OpenMarket Ltd
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#import <MatrixKit/MatrixKit.h>
|
|
|
|
|
|
|
|
/**
|
2015-12-28 15:50:08 +00:00
|
|
|
The `VectorSearch` category adds the management of the search bar in Vector screens.
|
2015-12-28 08:39:17 +00:00
|
|
|
*/
|
|
|
|
|
2016-01-05 15:27:50 +00:00
|
|
|
@interface UIViewController (VectorSearch) <UISearchBarDelegate>
|
2015-12-28 08:39:17 +00:00
|
|
|
|
|
|
|
/**
|
2015-12-30 16:28:41 +00:00
|
|
|
The search bar.
|
2015-12-28 08:39:17 +00:00
|
|
|
*/
|
2015-12-28 15:50:08 +00:00
|
|
|
@property (nonatomic, readonly) UISearchBar *searchBar;
|
2015-12-28 08:39:17 +00:00
|
|
|
|
2015-12-30 16:28:41 +00:00
|
|
|
/**
|
|
|
|
The search bar state.
|
|
|
|
*/
|
|
|
|
@property (nonatomic, readonly) BOOL searchBarHidden;
|
|
|
|
|
2016-01-05 15:03:58 +00:00
|
|
|
/**
|
|
|
|
The Vector empty search background image (champagne bubbles).
|
|
|
|
The image adapts its width to its parent view width.
|
|
|
|
Its bottom is aligned to the top of the keyboard.
|
|
|
|
*/
|
|
|
|
@property (nonatomic, readonly) UIImageView *backgroundImageView;
|
|
|
|
|
2016-05-30 14:11:24 +00:00
|
|
|
@property (nonatomic, readonly) NSLayoutConstraint *backgroundImageViewBottomConstraint;
|
|
|
|
|
2015-12-28 08:39:17 +00:00
|
|
|
/**
|
|
|
|
Show/Hide the search bar.
|
2015-12-28 15:50:08 +00:00
|
|
|
|
|
|
|
@param animated or not.
|
2015-12-28 08:39:17 +00:00
|
|
|
*/
|
|
|
|
- (void)showSearch:(BOOL)animated;
|
|
|
|
- (void)hideSearch:(BOOL)animated;
|
|
|
|
|
2016-01-05 15:03:58 +00:00
|
|
|
/**
|
|
|
|
Initialise `backgroundImageView` and add it to the passed parent view.
|
|
|
|
|
|
|
|
@param view the view to add `backgroundImageView` to.
|
|
|
|
*/
|
|
|
|
- (void)addBackgroundImageViewToView:(UIView*)view;
|
|
|
|
|
2016-01-05 15:27:50 +00:00
|
|
|
/**
|
|
|
|
Provide the new height of the keyboard to align `backgroundImageView`
|
|
|
|
|
|
|
|
@param keyboardHeight the keyboard height.
|
|
|
|
*/
|
|
|
|
- (void)setKeyboardHeightForBackgroundImage:(CGFloat)keyboardHeight;
|
|
|
|
|
2015-12-28 08:39:17 +00:00
|
|
|
@end
|