mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 01:22:46 +02:00
Fix size of media on iPad when multitasking.
This commit is contained in:
@@ -1,123 +0,0 @@
|
||||
/*
|
||||
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 <MatrixSDK/MatrixSDK.h>
|
||||
|
||||
#import "MXKViewController.h"
|
||||
#import "MXKAttachment.h"
|
||||
#import "MXKAttachmentAnimator.h"
|
||||
|
||||
@protocol MXKAttachmentsViewControllerDelegate;
|
||||
|
||||
/**
|
||||
This view controller is used to display attachments of a room.
|
||||
Only one attachment is displayed at once, the user is able to swipe one by one the attachment.
|
||||
*/
|
||||
@interface MXKAttachmentsViewController : MXKViewController <UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, UIDocumentInteractionControllerDelegate, MXKDestinationAttachmentAnimatorDelegate>
|
||||
|
||||
@property (nonatomic) IBOutlet UICollectionView *attachmentsCollection;
|
||||
@property (nonatomic) IBOutlet UINavigationBar *navigationBar;
|
||||
@property (unsafe_unretained, nonatomic) IBOutlet UIBarButtonItem *backButton;
|
||||
|
||||
/**
|
||||
The attachments array.
|
||||
*/
|
||||
@property (nonatomic, readonly) NSArray *attachments;
|
||||
|
||||
/**
|
||||
Tell whether all attachments have been retrieved from the room history (In that case no attachment can be added at the beginning of attachments array).
|
||||
*/
|
||||
@property (nonatomic) BOOL complete;
|
||||
|
||||
/**
|
||||
The delegate notified when inputs are ready.
|
||||
*/
|
||||
@property (nonatomic, weak) id<MXKAttachmentsViewControllerDelegate> delegate;
|
||||
|
||||
#pragma mark - Class methods
|
||||
|
||||
/**
|
||||
Returns the `UINib` object initialized for a `MXKAttachmentsViewController`.
|
||||
|
||||
@return The initialized `UINib` object or `nil` if there were errors during initialization
|
||||
or the nib file could not be located.
|
||||
|
||||
@discussion You may override this method to provide a customized nib. If you do,
|
||||
you should also override `roomViewController` to return your
|
||||
view controller loaded from your custom nib.
|
||||
*/
|
||||
+ (UINib *)nib;
|
||||
|
||||
/**
|
||||
Creates and returns a new `MXKAttachmentsViewController` object.
|
||||
|
||||
@discussion This is the designated initializer for programmatic instantiation.
|
||||
@return An initialized `MXKAttachmentsViewController` object if successful, `nil` otherwise.
|
||||
*/
|
||||
+ (instancetype)attachmentsViewController;
|
||||
|
||||
/**
|
||||
Creates and returns a new `MXKAttachmentsViewController` object, also sets sets up environment for animated interactive transitions.
|
||||
*/
|
||||
+ (instancetype)animatedAttachmentsViewControllerWithSourceViewController:(UIViewController <MXKSourceAttachmentAnimatorDelegate> *)sourceViewController;
|
||||
|
||||
/**
|
||||
Display attachments of a room.
|
||||
|
||||
The provided event id is used to select the attachment to display first. Use nil to unchange the current displayed attachment.
|
||||
By default the first attachment is displayed.
|
||||
If the back pagination spinner is currently displayed and provided event id is nil,
|
||||
the viewer will display the first added attachment during back pagination.
|
||||
|
||||
@param attachmentArray the array of attachments (MXKAttachment instances).
|
||||
@param eventId the identifier of the attachment to display first.
|
||||
|
||||
*/
|
||||
- (void)displayAttachments:(NSArray*)attachmentArray focusOn:(NSString*)eventId;
|
||||
|
||||
/**
|
||||
Action used to handle the `backButton` in the navigation bar.
|
||||
*/
|
||||
- (IBAction)onButtonPressed:(id)sender;
|
||||
|
||||
@end
|
||||
|
||||
@protocol MXKAttachmentsViewControllerDelegate <NSObject>
|
||||
|
||||
/**
|
||||
Ask the delegate for more attachments.
|
||||
This method is called only if 'complete' is NO.
|
||||
|
||||
When some attachments are available, the delegate update the attachmnet list by using
|
||||
[MXKAttachmentsViewController displayAttachments: focusOn:].
|
||||
When no new attachment is available, the delegate must update the property 'complete'.
|
||||
|
||||
@param attachmentsViewController the attachments view controller.
|
||||
@param eventId the event identifier of the current first attachment.
|
||||
@return a boolean which tells whether some new attachments may be added or not.
|
||||
*/
|
||||
- (BOOL)attachmentsViewController:(MXKAttachmentsViewController*)attachmentsViewController paginateAttachmentBefore:(NSString*)eventId;
|
||||
|
||||
@optional
|
||||
|
||||
/**
|
||||
Informs the delegate that a new attachment has been shown
|
||||
the parameter eventId is used by the delegate to identify the attachment
|
||||
*/
|
||||
- (void)displayedNewAttachmentWithEventId:(NSString *)eventId;
|
||||
|
||||
|
||||
@end
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,69 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MXKAttachmentsViewController">
|
||||
<connections>
|
||||
<outlet property="attachmentsCollection" destination="LOp-cf-Sji" id="4Zx-KZ-fkh"/>
|
||||
<outlet property="backButton" destination="VjO-K2-a0w" id="VlD-Iw-NT5"/>
|
||||
<outlet property="navigationBar" destination="orb-yb-k6g" id="ILw-DO-IH2"/>
|
||||
<outlet property="view" destination="iN0-l3-epB" id="ieV-u7-rXU"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view contentMode="scaleToFill" id="iN0-l3-epB">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleAspectFit" alwaysBounceHorizontal="YES" pagingEnabled="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="LOp-cf-Sji">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<collectionViewFlowLayout key="collectionViewLayout" scrollDirection="horizontal" minimumLineSpacing="0.0" minimumInteritemSpacing="0.0" id="RrA-v8-THJ">
|
||||
<size key="itemSize" width="600" height="600"/>
|
||||
<size key="headerReferenceSize" width="0.0" height="0.0"/>
|
||||
<size key="footerReferenceSize" width="0.0" height="0.0"/>
|
||||
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
</collectionViewFlowLayout>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="-1" id="gLX-KL-R8w"/>
|
||||
<outlet property="delegate" destination="-1" id="z1d-ep-n4n"/>
|
||||
</connections>
|
||||
</collectionView>
|
||||
<navigationBar contentMode="scaleToFill" translucent="NO" translatesAutoresizingMaskIntoConstraints="NO" id="orb-yb-k6g">
|
||||
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
|
||||
<items>
|
||||
<navigationItem id="lP4-eZ-AQ8">
|
||||
<barButtonItem key="leftBarButtonItem" image="back_icon.png" style="plain" id="VjO-K2-a0w">
|
||||
<connections>
|
||||
<action selector="onButtonPressed:" destination="-1" id="PEa-WB-Up1"/>
|
||||
</connections>
|
||||
</barButtonItem>
|
||||
</navigationItem>
|
||||
</items>
|
||||
</navigationBar>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="orb-yb-k6g" firstAttribute="top" secondItem="kHK-qN-rPN" secondAttribute="top" id="GGy-ix-LRO"/>
|
||||
<constraint firstItem="LOp-cf-Sji" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="RQT-el-TH0"/>
|
||||
<constraint firstAttribute="trailing" secondItem="LOp-cf-Sji" secondAttribute="trailing" id="Vgl-Wc-CI1"/>
|
||||
<constraint firstAttribute="trailing" secondItem="orb-yb-k6g" secondAttribute="trailing" id="bFh-tc-Lub"/>
|
||||
<constraint firstAttribute="bottom" secondItem="LOp-cf-Sji" secondAttribute="bottom" id="d22-2K-BEZ"/>
|
||||
<constraint firstItem="LOp-cf-Sji" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="jEc-aG-zZn"/>
|
||||
<constraint firstItem="orb-yb-k6g" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="toe-s8-clE"/>
|
||||
</constraints>
|
||||
<nil key="simulatedStatusBarMetrics"/>
|
||||
<viewLayoutGuide key="safeArea" id="kHK-qN-rPN"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="back_icon.png" width="13.5" height="23"/>
|
||||
</resources>
|
||||
</document>
|
||||
Reference in New Issue
Block a user