mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-07 00:17:43 +02:00
Search background image: Use new UIViewController+VectorSerch feature in the search in the homeVC
This commit is contained in:
@@ -157,16 +157,26 @@
|
||||
|
||||
self.searchInternals.backgroundImageView = backgroundImageView;
|
||||
self.searchInternals.backgroundImageViewBottomConstraint = bottomConstraint;
|
||||
|
||||
// It will be showed once the keyboard appears
|
||||
backgroundImageView.hidden = YES;
|
||||
}
|
||||
|
||||
- (void)setKeyboardHeightForBackgroundImage:(CGFloat)keyboardHeight
|
||||
{
|
||||
// keyboardHeight = 0 means no keyboard, so filter it out
|
||||
// keyboardHeight = 0 means no keyboard
|
||||
if (keyboardHeight > 0)
|
||||
{
|
||||
self.searchInternals.backgroundImageView.hidden = NO;
|
||||
|
||||
// 60 = 18 + 42 from the Vector design
|
||||
self.searchInternals.backgroundImageViewBottomConstraint.constant = keyboardHeight - 60;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Hide the search
|
||||
self.searchInternals.backgroundImageView.hidden = YES;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - UISearchBarDelegate
|
||||
|
||||
@@ -68,8 +68,9 @@
|
||||
[super viewDidLoad];
|
||||
|
||||
self.navigationItem.title = NSLocalizedStringFromTable(@"recents", @"Vector", nil);
|
||||
|
||||
self.backgroundImageView.image = [UIImage imageNamed:@"search_bg"];
|
||||
|
||||
// Add the Vector background image when search bar is empty
|
||||
[self addBackgroundImageViewToView:self.view];
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
@@ -311,6 +312,15 @@
|
||||
[self performSegueWithIdentifier:@"showDirectory" sender:self];
|
||||
}
|
||||
|
||||
#pragma mark - Override MXKViewController
|
||||
|
||||
- (void)setKeyboardHeight:(CGFloat)keyboardHeight
|
||||
{
|
||||
[self setKeyboardHeightForBackgroundImage:keyboardHeight];
|
||||
|
||||
[super setKeyboardHeight:keyboardHeight];
|
||||
}
|
||||
|
||||
#pragma mark - Override SegmentedViewController
|
||||
|
||||
- (void)setSelectedIndex:(NSUInteger)selectedIndex
|
||||
@@ -423,6 +433,7 @@
|
||||
|
||||
createNewRoomImageView.hidden = NO;
|
||||
tableViewMaskLayer.hidden = NO;
|
||||
self.backgroundImageView.hidden = YES;
|
||||
|
||||
[recentsDataSource searchWithPatterns:nil];
|
||||
|
||||
@@ -440,6 +451,7 @@
|
||||
if (self.searchBar.text.length)
|
||||
{
|
||||
self.selectedViewController.view.hidden = NO;
|
||||
self.backgroundImageView.hidden = YES;
|
||||
|
||||
// Forward the search request to the data source
|
||||
if (self.selectedViewController == recentsViewController)
|
||||
@@ -468,6 +480,7 @@
|
||||
{
|
||||
// Nothing to search = Show nothing
|
||||
self.selectedViewController.view.hidden = YES;
|
||||
self.backgroundImageView.hidden = NO;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ limitations under the License.
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *selectionContainerTopConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *selectionContainerHeightConstraint;
|
||||
@property (weak, nonatomic) IBOutlet UIView *viewControllerContainer;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *backgroundImageView;
|
||||
|
||||
/**
|
||||
The index of the view controller that currently has the focus.
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9531"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="SegmentedViewController">
|
||||
<connections>
|
||||
<outlet property="backgroundImageView" destination="KfM-OD-fTP" id="AXh-ac-GWQ"/>
|
||||
<outlet property="selectionContainer" destination="ynH-uD-aQj" id="taa-CW-XgW"/>
|
||||
<outlet property="selectionContainerHeightConstraint" destination="fZ1-SQ-nxS" id="kQ4-n9-Gmt"/>
|
||||
<outlet property="selectionContainerTopConstraint" destination="eLe-5q-IfV" id="UhZ-9k-P1r"/>
|
||||
@@ -22,30 +21,15 @@
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ynH-uD-aQj" userLabel="Selection Container">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
|
||||
<animations/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="44" id="fZ1-SQ-nxS"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Hbe-uP-aJY" userLabel="Selected UITableView Container">
|
||||
<rect key="frame" x="0.0" y="44" width="600" height="556"/>
|
||||
<subviews>
|
||||
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleAspectFit" translatesAutoresizingMaskIntoConstraints="NO" id="KfM-OD-fTP">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="556"/>
|
||||
<animations/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<animations/>
|
||||
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstItem="KfM-OD-fTP" firstAttribute="height" secondItem="Hbe-uP-aJY" secondAttribute="height" id="GBi-kq-bMR"/>
|
||||
<constraint firstItem="KfM-OD-fTP" firstAttribute="leading" secondItem="Hbe-uP-aJY" secondAttribute="leading" id="cmW-5l-b7z"/>
|
||||
<constraint firstItem="KfM-OD-fTP" firstAttribute="width" secondItem="Hbe-uP-aJY" secondAttribute="width" id="hVX-eX-wxE"/>
|
||||
<constraint firstItem="KfM-OD-fTP" firstAttribute="top" secondItem="Hbe-uP-aJY" secondAttribute="top" id="snt-Kj-GGz"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="Hbe-uP-aJY" secondAttribute="bottom" id="GHr-ci-L7A"/>
|
||||
|
||||
Reference in New Issue
Block a user