mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Fixing popover orientation issues. Also fixing activities/saved stories.
This commit is contained in:
parent
8186eae9c3
commit
f3096fe958
6 changed files with 3715 additions and 23 deletions
|
@ -1240,12 +1240,13 @@
|
|||
feedDetailView.storiesCollection.isRiverView = YES;
|
||||
NSString *folderName = [self.dictFoldersArray objectAtIndex:[folder intValue]];
|
||||
|
||||
if ([folderName isEqualToString:@"saved_stories"]) {
|
||||
if ([folder isEqualToString:@"saved_stories"] || [folderName isEqualToString:@"saved_stories"]) {
|
||||
feedDetailView.storiesCollection.isSavedView = YES;
|
||||
} else if ([folderName isEqualToString:@"read_stories"]) {
|
||||
[feedDetailView.storiesCollection setActiveFolder:@"saved_stories"];
|
||||
} else if ([folder isEqualToString:@"read_stories"] || [folderName isEqualToString:@"read_stories"]) {
|
||||
feedDetailView.storiesCollection.isReadView = YES;
|
||||
[feedDetailView.storiesCollection setActiveFolder:@"read_stories"];
|
||||
}
|
||||
[feedDetailView.storiesCollection setActiveFolder:folderName];
|
||||
NSArray *originalFolder = [self.dictFolders objectForKey:folderName];
|
||||
NSArray *activeFeedLocations = [self.feedsViewController.activeFeedLocations objectForKey:folderName];
|
||||
for (int l=0; l < [activeFeedLocations count]; l++) {
|
||||
|
|
|
@ -262,8 +262,8 @@
|
|||
FF6281FA1A09614C00271FDB /* all@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = FF6281F91A09614C00271FDB /* all@3x.png */; };
|
||||
FF6281FC1A0962FA00271FDB /* unread_green@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = FF6281FB1A0962FA00271FDB /* unread_green@3x.png */; };
|
||||
FF6281FE1A09641100271FDB /* unread_yellow@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = FF6281FD1A09641100271FDB /* unread_yellow@3x.png */; };
|
||||
FF6282031A09685800271FDB /* WYPopoverController.m in Sources */ = {isa = PBXBuildFile; fileRef = FF6282001A09685800271FDB /* WYPopoverController.m */; };
|
||||
FF6282041A09685800271FDB /* WYStoryboardPopoverSegue.m in Sources */ = {isa = PBXBuildFile; fileRef = FF6282021A09685800271FDB /* WYStoryboardPopoverSegue.m */; };
|
||||
FF62820A1A098EA800271FDB /* WYPopoverController.m in Sources */ = {isa = PBXBuildFile; fileRef = FF6282071A098EA800271FDB /* WYPopoverController.m */; };
|
||||
FF62820B1A098EA800271FDB /* WYStoryboardPopoverSegue.m in Sources */ = {isa = PBXBuildFile; fileRef = FF6282091A098EA800271FDB /* WYStoryboardPopoverSegue.m */; };
|
||||
FF6618C8176184560039913B /* NBNotifier.m in Sources */ = {isa = PBXBuildFile; fileRef = FF6618C7176184560039913B /* NBNotifier.m */; };
|
||||
FF67D3B2168924C40057A7DA /* TrainerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FF67D3B1168924C40057A7DA /* TrainerViewController.m */; };
|
||||
FF67D3B7168977690057A7DA /* TrainerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = FF67D3B6168977690057A7DA /* TrainerViewController.xib */; };
|
||||
|
@ -1042,10 +1042,10 @@
|
|||
FF6281F91A09614C00271FDB /* all@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "all@3x.png"; sourceTree = "<group>"; };
|
||||
FF6281FB1A0962FA00271FDB /* unread_green@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unread_green@3x.png"; sourceTree = "<group>"; };
|
||||
FF6281FD1A09641100271FDB /* unread_yellow@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unread_yellow@3x.png"; sourceTree = "<group>"; };
|
||||
FF6281FF1A09685800271FDB /* WYPopoverController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WYPopoverController.h; path = "../../../../../Downloads/WYPopoverController-master/WYPopoverController/WYPopoverController.h"; sourceTree = "<group>"; };
|
||||
FF6282001A09685800271FDB /* WYPopoverController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WYPopoverController.m; path = "../../../../../Downloads/WYPopoverController-master/WYPopoverController/WYPopoverController.m"; sourceTree = "<group>"; };
|
||||
FF6282011A09685800271FDB /* WYStoryboardPopoverSegue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WYStoryboardPopoverSegue.h; path = "../../../../../Downloads/WYPopoverController-master/WYPopoverController/WYStoryboardPopoverSegue.h"; sourceTree = "<group>"; };
|
||||
FF6282021A09685800271FDB /* WYStoryboardPopoverSegue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WYStoryboardPopoverSegue.m; path = "../../../../../Downloads/WYPopoverController-master/WYPopoverController/WYStoryboardPopoverSegue.m"; sourceTree = "<group>"; };
|
||||
FF6282061A098EA800271FDB /* WYPopoverController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WYPopoverController.h; sourceTree = "<group>"; };
|
||||
FF6282071A098EA800271FDB /* WYPopoverController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WYPopoverController.m; sourceTree = "<group>"; };
|
||||
FF6282081A098EA800271FDB /* WYStoryboardPopoverSegue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WYStoryboardPopoverSegue.h; sourceTree = "<group>"; };
|
||||
FF6282091A098EA800271FDB /* WYStoryboardPopoverSegue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WYStoryboardPopoverSegue.m; sourceTree = "<group>"; };
|
||||
FF6618C6176184560039913B /* NBNotifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NBNotifier.h; sourceTree = "<group>"; };
|
||||
FF6618C7176184560039913B /* NBNotifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NBNotifier.m; sourceTree = "<group>"; };
|
||||
FF67D3B0168924C40057A7DA /* TrainerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrainerViewController.h; sourceTree = "<group>"; };
|
||||
|
@ -1750,7 +1750,7 @@
|
|||
FFF1E498177504CA00BF59D3 /* InAppSettingsKit */,
|
||||
FF753CC2175858FC00344EC9 /* fmdb */,
|
||||
FF22FE5316E53ADC0046165A /* Underscore */,
|
||||
43A4BABE15C8663600F3B8D4 /* Popover */,
|
||||
FF6282051A098EA800271FDB /* WYPopoverController */,
|
||||
FF1F13CC18A9C2BE00FDA816 /* TMCache */,
|
||||
43A3912E15B73A7B0074B212 /* AFNetworking */,
|
||||
FFFC60821716578E00DC22E2 /* THCircularProgressView.h */,
|
||||
|
@ -2224,17 +2224,6 @@
|
|||
path = AFNetworking;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
43A4BABE15C8663600F3B8D4 /* Popover */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
FF6281FF1A09685800271FDB /* WYPopoverController.h */,
|
||||
FF6282001A09685800271FDB /* WYPopoverController.m */,
|
||||
FF6282011A09685800271FDB /* WYStoryboardPopoverSegue.h */,
|
||||
FF6282021A09685800271FDB /* WYStoryboardPopoverSegue.m */,
|
||||
);
|
||||
path = Popover;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
43B8F017156603170008733D /* Resources-iPhone */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -2456,6 +2445,18 @@
|
|||
path = Reachability;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
FF6282051A098EA800271FDB /* WYPopoverController */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
FF6282061A098EA800271FDB /* WYPopoverController.h */,
|
||||
FF6282071A098EA800271FDB /* WYPopoverController.m */,
|
||||
FF6282081A098EA800271FDB /* WYStoryboardPopoverSegue.h */,
|
||||
FF6282091A098EA800271FDB /* WYStoryboardPopoverSegue.m */,
|
||||
);
|
||||
name = WYPopoverController;
|
||||
path = "Other Sources/WYPopoverController";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
FF753CC2175858FC00344EC9 /* fmdb */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -3624,6 +3625,7 @@
|
|||
784B50ED127E3F68008F90EA /* LoginViewController.m in Sources */,
|
||||
FFA0482E19CA54A800618DC4 /* OSKTwitterActivity.m in Sources */,
|
||||
78095E34128EF30C00230C8E /* ASIAuthenticationDialog.m in Sources */,
|
||||
FF62820B1A098EA800271FDB /* WYStoryboardPopoverSegue.m in Sources */,
|
||||
78095E35128EF30D00230C8E /* ASIDownloadCache.m in Sources */,
|
||||
78095E36128EF30D00230C8E /* ASIFormDataRequest.m in Sources */,
|
||||
FFA0482C19CA54A800618DC4 /* OSKTextViewAttachmentView.m in Sources */,
|
||||
|
@ -3640,6 +3642,7 @@
|
|||
FF5EA47F143B691000B7563D /* AddSiteViewController.m in Sources */,
|
||||
FF1F13D818AAC97900FDA816 /* UIImage+Resize.m in Sources */,
|
||||
FFD887F01445F1E800385399 /* AddSiteAutocompleteCell.m in Sources */,
|
||||
FF62820A1A098EA800271FDB /* WYPopoverController.m in Sources */,
|
||||
FFE5322F144C8AC300ACFDE0 /* Utilities.m in Sources */,
|
||||
FFD1D7311459B63500E46F89 /* BaseViewController.m in Sources */,
|
||||
FFA0481419CA54A800618DC4 /* OSKOAuthUtility.m in Sources */,
|
||||
|
@ -3786,7 +3789,6 @@
|
|||
FF753CD0175858FC00344EC9 /* FMDatabasePool.m in Sources */,
|
||||
FF753CD1175858FC00344EC9 /* FMDatabaseQueue.m in Sources */,
|
||||
FF753CD3175858FC00344EC9 /* FMResultSet.m in Sources */,
|
||||
FF6282041A09685800271FDB /* WYStoryboardPopoverSegue.m in Sources */,
|
||||
FF6618C8176184560039913B /* NBNotifier.m in Sources */,
|
||||
FF03AFF319F87F2E0063002A /* TUSafariActivity.m in Sources */,
|
||||
FFA0482419CA54A800618DC4 /* OSKSessionController_Pad.m in Sources */,
|
||||
|
@ -3809,7 +3811,6 @@
|
|||
FFF1E4BC177504CA00BF59D3 /* IASKSettingsReader.m in Sources */,
|
||||
FFA0480719CA54A800618DC4 /* OSKInstapaperUtility.m in Sources */,
|
||||
FFF1E4BD177504CA00BF59D3 /* IASKSettingsStore.m in Sources */,
|
||||
FF6282031A09685800271FDB /* WYPopoverController.m in Sources */,
|
||||
FFF1E4BE177504CA00BF59D3 /* IASKSettingsStoreFile.m in Sources */,
|
||||
FFF1E4BF177504CA00BF59D3 /* IASKSettingsStoreUserDefaults.m in Sources */,
|
||||
FFF1E4C0177504CA00BF59D3 /* IASKSpecifier.m in Sources */,
|
||||
|
|
258
clients/ios/Other Sources/WYPopoverController/WYPopoverController.h
Executable file
258
clients/ios/Other Sources/WYPopoverController/WYPopoverController.h
Executable file
|
@ -0,0 +1,258 @@
|
|||
/*
|
||||
Version 0.2.2
|
||||
|
||||
WYPopoverController is available under the MIT license.
|
||||
|
||||
Copyright © 2013 Nicolas CHENG
|
||||
|
||||
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 <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
||||
@protocol WYPopoverControllerDelegate;
|
||||
@class WYPopoverTheme;
|
||||
|
||||
#ifndef WY_POPOVER_DEFAULT_ANIMATION_DURATION
|
||||
#define WY_POPOVER_DEFAULT_ANIMATION_DURATION .25f
|
||||
#endif
|
||||
|
||||
#ifndef WY_POPOVER_MIN_SIZE
|
||||
#define WY_POPOVER_MIN_SIZE CGSizeMake(240, 160)
|
||||
#endif
|
||||
|
||||
typedef NS_OPTIONS(NSUInteger, WYPopoverArrowDirection) {
|
||||
WYPopoverArrowDirectionUp = 1UL << 0,
|
||||
WYPopoverArrowDirectionDown = 1UL << 1,
|
||||
WYPopoverArrowDirectionLeft = 1UL << 2,
|
||||
WYPopoverArrowDirectionRight = 1UL << 3,
|
||||
WYPopoverArrowDirectionNone = 1UL << 4,
|
||||
WYPopoverArrowDirectionAny = WYPopoverArrowDirectionUp | WYPopoverArrowDirectionDown | WYPopoverArrowDirectionLeft | WYPopoverArrowDirectionRight,
|
||||
WYPopoverArrowDirectionUnknown = NSUIntegerMax
|
||||
};
|
||||
|
||||
typedef NS_OPTIONS(NSUInteger, WYPopoverAnimationOptions) {
|
||||
WYPopoverAnimationOptionFade = 1UL << 0, // default
|
||||
WYPopoverAnimationOptionScale = 1UL << 1,
|
||||
WYPopoverAnimationOptionFadeWithScale = WYPopoverAnimationOptionFade | WYPopoverAnimationOptionScale
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@interface WYPopoverBackgroundView : UIView
|
||||
|
||||
@property (nonatomic, strong) NSNumber *usesRoundedArrow UI_APPEARANCE_SELECTOR;
|
||||
@property (nonatomic, strong) NSNumber *adjustsTintColor UI_APPEARANCE_SELECTOR;
|
||||
@property (nonatomic, strong) UIColor *tintColor UI_APPEARANCE_SELECTOR;
|
||||
@property (nonatomic, strong) UIColor *fillTopColor UI_APPEARANCE_SELECTOR;
|
||||
@property (nonatomic, strong) UIColor *fillBottomColor UI_APPEARANCE_SELECTOR;
|
||||
|
||||
@property (nonatomic, strong) UIColor *glossShadowColor UI_APPEARANCE_SELECTOR;
|
||||
@property (nonatomic, assign) CGSize glossShadowOffset UI_APPEARANCE_SELECTOR;
|
||||
@property (nonatomic, assign) NSUInteger glossShadowBlurRadius UI_APPEARANCE_SELECTOR;
|
||||
|
||||
@property (nonatomic, assign) NSUInteger borderWidth UI_APPEARANCE_SELECTOR;
|
||||
@property (nonatomic, assign) NSUInteger arrowBase UI_APPEARANCE_SELECTOR;
|
||||
@property (nonatomic, assign) NSUInteger arrowHeight UI_APPEARANCE_SELECTOR;
|
||||
|
||||
@property (nonatomic, strong) UIColor *outerShadowColor UI_APPEARANCE_SELECTOR;
|
||||
@property (nonatomic, strong) UIColor *outerStrokeColor UI_APPEARANCE_SELECTOR;
|
||||
@property (nonatomic, assign) NSUInteger outerShadowBlurRadius UI_APPEARANCE_SELECTOR;
|
||||
@property (nonatomic, assign) CGSize outerShadowOffset UI_APPEARANCE_SELECTOR;
|
||||
@property (nonatomic, assign) NSUInteger outerCornerRadius UI_APPEARANCE_SELECTOR;
|
||||
@property (nonatomic, assign) NSUInteger minOuterCornerRadius UI_APPEARANCE_SELECTOR;
|
||||
|
||||
@property (nonatomic, strong) UIColor *innerShadowColor UI_APPEARANCE_SELECTOR;
|
||||
@property (nonatomic, strong) UIColor *innerStrokeColor UI_APPEARANCE_SELECTOR;
|
||||
@property (nonatomic, assign) NSUInteger innerShadowBlurRadius UI_APPEARANCE_SELECTOR;
|
||||
@property (nonatomic, assign) CGSize innerShadowOffset UI_APPEARANCE_SELECTOR;
|
||||
@property (nonatomic, assign) NSUInteger innerCornerRadius UI_APPEARANCE_SELECTOR;
|
||||
|
||||
@property (nonatomic, assign) UIEdgeInsets viewContentInsets UI_APPEARANCE_SELECTOR;
|
||||
|
||||
@property (nonatomic, strong) UIColor *overlayColor UI_APPEARANCE_SELECTOR;
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@interface WYPopoverController : NSObject <UIAppearanceContainer>
|
||||
|
||||
@property (nonatomic, weak) id <WYPopoverControllerDelegate> delegate;
|
||||
|
||||
@property (nonatomic, copy) NSArray *passthroughViews;
|
||||
@property (nonatomic, assign) BOOL wantsDefaultContentAppearance;
|
||||
@property (nonatomic, assign) UIEdgeInsets popoverLayoutMargins;
|
||||
@property (nonatomic, readonly, getter=isPopoverVisible) BOOL popoverVisible;
|
||||
@property (nonatomic, strong, readonly) UIViewController *contentViewController;
|
||||
@property (nonatomic, assign) CGSize popoverContentSize;
|
||||
@property (nonatomic, assign) float animationDuration;
|
||||
|
||||
@property (nonatomic, strong) WYPopoverTheme *theme;
|
||||
|
||||
+ (void)setDefaultTheme:(WYPopoverTheme *)theme;
|
||||
+ (WYPopoverTheme *)defaultTheme;
|
||||
|
||||
// initialization
|
||||
|
||||
- (id)initWithContentViewController:(UIViewController *)viewController;
|
||||
|
||||
// theme
|
||||
|
||||
- (void)beginThemeUpdates;
|
||||
- (void)endThemeUpdates;
|
||||
|
||||
// Present popover from classic views methods
|
||||
|
||||
- (void)presentPopoverFromRect:(CGRect)rect
|
||||
inView:(UIView *)view
|
||||
permittedArrowDirections:(WYPopoverArrowDirection)arrowDirections
|
||||
animated:(BOOL)animated;
|
||||
|
||||
- (void)presentPopoverFromRect:(CGRect)rect
|
||||
inView:(UIView *)view
|
||||
permittedArrowDirections:(WYPopoverArrowDirection)arrowDirections
|
||||
animated:(BOOL)animated
|
||||
completion:(void (^)(void))completion;
|
||||
|
||||
- (void)presentPopoverFromRect:(CGRect)rect
|
||||
inView:(UIView *)view
|
||||
permittedArrowDirections:(WYPopoverArrowDirection)arrowDirections
|
||||
animated:(BOOL)animated
|
||||
options:(WYPopoverAnimationOptions)options;
|
||||
|
||||
- (void)presentPopoverFromRect:(CGRect)rect
|
||||
inView:(UIView *)view
|
||||
permittedArrowDirections:(WYPopoverArrowDirection)arrowDirections
|
||||
animated:(BOOL)animated
|
||||
options:(WYPopoverAnimationOptions)options
|
||||
completion:(void (^)(void))completion;
|
||||
|
||||
// Present popover from bar button items methods
|
||||
|
||||
- (void)presentPopoverFromBarButtonItem:(UIBarButtonItem *)item
|
||||
permittedArrowDirections:(WYPopoverArrowDirection)arrowDirections
|
||||
animated:(BOOL)animated;
|
||||
|
||||
- (void)presentPopoverFromBarButtonItem:(UIBarButtonItem *)item
|
||||
permittedArrowDirections:(WYPopoverArrowDirection)arrowDirections
|
||||
animated:(BOOL)animated
|
||||
completion:(void (^)(void))completion;
|
||||
|
||||
- (void)presentPopoverFromBarButtonItem:(UIBarButtonItem *)item
|
||||
permittedArrowDirections:(WYPopoverArrowDirection)arrowDirections
|
||||
animated:(BOOL)animated
|
||||
options:(WYPopoverAnimationOptions)options;
|
||||
|
||||
- (void)presentPopoverFromBarButtonItem:(UIBarButtonItem *)item
|
||||
permittedArrowDirections:(WYPopoverArrowDirection)arrowDirections
|
||||
animated:(BOOL)animated
|
||||
options:(WYPopoverAnimationOptions)options
|
||||
completion:(void (^)(void))completion;
|
||||
|
||||
// Present popover as dialog methods
|
||||
|
||||
- (void)presentPopoverAsDialogAnimated:(BOOL)animated;
|
||||
|
||||
- (void)presentPopoverAsDialogAnimated:(BOOL)animated
|
||||
completion:(void (^)(void))completion;
|
||||
|
||||
- (void)presentPopoverAsDialogAnimated:(BOOL)animated
|
||||
options:(WYPopoverAnimationOptions)options;
|
||||
|
||||
- (void)presentPopoverAsDialogAnimated:(BOOL)animated
|
||||
options:(WYPopoverAnimationOptions)options
|
||||
completion:(void (^)(void))completion;
|
||||
|
||||
// Dismiss popover methods
|
||||
|
||||
- (void)dismissPopoverAnimated:(BOOL)animated;
|
||||
|
||||
- (void)dismissPopoverAnimated:(BOOL)animated
|
||||
completion:(void (^)(void))completion;
|
||||
|
||||
- (void)dismissPopoverAnimated:(BOOL)animated
|
||||
options:(WYPopoverAnimationOptions)aOptions;
|
||||
|
||||
- (void)dismissPopoverAnimated:(BOOL)animated
|
||||
options:(WYPopoverAnimationOptions)aOptions
|
||||
completion:(void (^)(void))completion;
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@protocol WYPopoverControllerDelegate <NSObject>
|
||||
@optional
|
||||
|
||||
- (BOOL)popoverControllerShouldDismissPopover:(WYPopoverController *)popoverController;
|
||||
|
||||
- (void)popoverControllerDidPresentPopover:(WYPopoverController *)popoverController;
|
||||
|
||||
- (void)popoverControllerDidDismissPopover:(WYPopoverController *)popoverController;
|
||||
|
||||
- (void)popoverController:(WYPopoverController *)popoverController willRepositionPopoverToRect:(inout CGRect *)rect inView:(inout UIView **)view;
|
||||
|
||||
- (BOOL)popoverControllerShouldIgnoreKeyboardBounds:(WYPopoverController *)popoverController;
|
||||
|
||||
- (void)popoverController:(WYPopoverController *)popoverController willTranslatePopoverWithYOffset:(float *)value;
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@interface WYPopoverTheme : NSObject
|
||||
|
||||
@property (nonatomic, strong) NSNumber *usesRoundedArrow;
|
||||
@property (nonatomic, strong) NSNumber *adjustsTintColor;
|
||||
@property (nonatomic, strong) UIColor *tintColor;
|
||||
@property (nonatomic, strong) UIColor *fillTopColor;
|
||||
@property (nonatomic, strong) UIColor *fillBottomColor;
|
||||
|
||||
@property (nonatomic, strong) UIColor *glossShadowColor;
|
||||
@property (nonatomic, assign) CGSize glossShadowOffset;
|
||||
@property (nonatomic, assign) NSUInteger glossShadowBlurRadius;
|
||||
|
||||
@property (nonatomic, assign) NSUInteger borderWidth;
|
||||
@property (nonatomic, assign) NSUInteger arrowBase;
|
||||
@property (nonatomic, assign) NSUInteger arrowHeight;
|
||||
|
||||
@property (nonatomic, strong) UIColor *outerShadowColor;
|
||||
@property (nonatomic, strong) UIColor *outerStrokeColor;
|
||||
@property (nonatomic, assign) NSUInteger outerShadowBlurRadius;
|
||||
@property (nonatomic, assign) CGSize outerShadowOffset;
|
||||
@property (nonatomic, assign) NSUInteger outerCornerRadius;
|
||||
@property (nonatomic, assign) NSUInteger minOuterCornerRadius;
|
||||
|
||||
@property (nonatomic, strong) UIColor *innerShadowColor;
|
||||
@property (nonatomic, strong) UIColor *innerStrokeColor;
|
||||
@property (nonatomic, assign) NSUInteger innerShadowBlurRadius;
|
||||
@property (nonatomic, assign) CGSize innerShadowOffset;
|
||||
@property (nonatomic, assign) NSUInteger innerCornerRadius;
|
||||
|
||||
@property (nonatomic, assign) UIEdgeInsets viewContentInsets;
|
||||
|
||||
@property (nonatomic, strong) UIColor *overlayColor;
|
||||
|
||||
+ (instancetype)theme;
|
||||
+ (instancetype)themeForIOS6;
|
||||
+ (instancetype)themeForIOS7;
|
||||
|
||||
@end
|
3295
clients/ios/Other Sources/WYPopoverController/WYPopoverController.m
Executable file
3295
clients/ios/Other Sources/WYPopoverController/WYPopoverController.m
Executable file
File diff suppressed because it is too large
Load diff
40
clients/ios/Other Sources/WYPopoverController/WYStoryboardPopoverSegue.h
Executable file
40
clients/ios/Other Sources/WYPopoverController/WYStoryboardPopoverSegue.h
Executable file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
Version 0.2.2
|
||||
|
||||
WYPopoverController is available under the MIT license.
|
||||
|
||||
Copyright © 2013 Nicolas CHENG
|
||||
|
||||
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 <UIKit/UIKit.h>
|
||||
#import "WYPopoverController.h"
|
||||
|
||||
@interface WYStoryboardPopoverSegue : UIStoryboardSegue
|
||||
|
||||
- (WYPopoverController*)popoverControllerWithSender:(id)sender
|
||||
permittedArrowDirections:(WYPopoverArrowDirection)arrowDirections
|
||||
animated:(BOOL)animated;
|
||||
|
||||
- (WYPopoverController*)popoverControllerWithSender:(id)sender
|
||||
permittedArrowDirections:(WYPopoverArrowDirection)arrowDirections
|
||||
animated:(BOOL)animated
|
||||
options:(WYPopoverAnimationOptions)options;
|
||||
|
||||
@end
|
97
clients/ios/Other Sources/WYPopoverController/WYStoryboardPopoverSegue.m
Executable file
97
clients/ios/Other Sources/WYPopoverController/WYStoryboardPopoverSegue.m
Executable file
|
@ -0,0 +1,97 @@
|
|||
/*
|
||||
Version 0.2.2
|
||||
|
||||
WYPopoverController is available under the MIT license.
|
||||
|
||||
Copyright © 2013 Nicolas CHENG
|
||||
|
||||
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 "WYStoryboardPopoverSegue.h"
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@interface WYStoryboardPopoverSegue()
|
||||
{
|
||||
WYPopoverController *popoverController;
|
||||
id sender;
|
||||
WYPopoverArrowDirection arrowDirections;
|
||||
WYPopoverAnimationOptions options;
|
||||
BOOL animated;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@implementation WYStoryboardPopoverSegue
|
||||
|
||||
- (void)perform
|
||||
{
|
||||
if ([sender isKindOfClass:[UIBarButtonItem class]])
|
||||
{
|
||||
[popoverController presentPopoverFromBarButtonItem:(UIBarButtonItem*)sender
|
||||
permittedArrowDirections:arrowDirections
|
||||
animated:animated
|
||||
options:options];
|
||||
}
|
||||
else
|
||||
{
|
||||
UIView *view = (UIView *)sender;
|
||||
[popoverController presentPopoverFromRect:view.bounds
|
||||
inView:view
|
||||
permittedArrowDirections:arrowDirections
|
||||
animated:animated
|
||||
options:options];
|
||||
}
|
||||
}
|
||||
|
||||
- (WYPopoverController *)popoverControllerWithSender:(id)aSender
|
||||
permittedArrowDirections:(WYPopoverArrowDirection)aArrowDirections
|
||||
animated:(BOOL)aAnimated
|
||||
{
|
||||
return [self popoverControllerWithSender:aSender
|
||||
permittedArrowDirections:aArrowDirections
|
||||
animated:aAnimated
|
||||
options:WYPopoverAnimationOptionFade];
|
||||
}
|
||||
|
||||
- (WYPopoverController *)popoverControllerWithSender:(id)aSender
|
||||
permittedArrowDirections:(WYPopoverArrowDirection)aArrowDirections
|
||||
animated:(BOOL)aAnimated
|
||||
options:(WYPopoverAnimationOptions)aOptions
|
||||
{
|
||||
sender = aSender;
|
||||
arrowDirections = aArrowDirections;
|
||||
animated = aAnimated;
|
||||
options = aOptions;
|
||||
|
||||
popoverController = [[WYPopoverController alloc] initWithContentViewController:self.destinationViewController];
|
||||
|
||||
return popoverController;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
sender = nil;
|
||||
popoverController = nil;
|
||||
}
|
||||
|
||||
@end
|
Loading…
Add table
Reference in a new issue