forked from organicmaps/organicmaps
Merge pull request #4853 from igrechuhin/toast
[toast] [ios] Added toast.
This commit is contained in:
commit
25d4d8ec7b
15 changed files with 325 additions and 16 deletions
|
@ -96,3 +96,14 @@ static inline void runAsyncOnMainQueue(dispatch_block_t block)
|
|||
{
|
||||
dispatch_async(dispatch_get_main_queue(), block);
|
||||
}
|
||||
|
||||
static inline UIViewController * topViewController()
|
||||
{
|
||||
UIWindow * window = UIApplication.sharedApplication.delegate.window;
|
||||
UIViewController * rootViewController = window.rootViewController;
|
||||
NSCAssert([rootViewController isKindOfClass:[UINavigationController class]],
|
||||
@"Invalid rootViewController class");
|
||||
UINavigationController * navigationController =
|
||||
static_cast<UINavigationController *>(rootViewController);
|
||||
return navigationController.topViewController;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#import "MWMMailViewController.h"
|
||||
#import "MWMToast.h"
|
||||
#import "UIColor+MapsMeColor.h"
|
||||
|
||||
@implementation MWMMailViewController
|
||||
|
@ -11,6 +12,9 @@
|
|||
|
||||
- (UIStatusBarStyle)preferredStatusBarStyle
|
||||
{
|
||||
if ([MWMToast affectsStatusBar])
|
||||
return [MWMToast preferredStatusBarStyle];
|
||||
|
||||
return [UIColor isNightMode] ? UIStatusBarStyleLightContent : UIStatusBarStyleDefault;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#import "MapsAppDelegate.h"
|
||||
#import "MWMController.h"
|
||||
#import "MWMNavigationController.h"
|
||||
#import "MWMController.h"
|
||||
#import "MWMToast.h"
|
||||
#import "MapsAppDelegate.h"
|
||||
#import "UIColor+MapsMeColor.h"
|
||||
#import "UIViewController+Navigation.h"
|
||||
|
||||
|
@ -14,6 +15,9 @@
|
|||
|
||||
- (UIStatusBarStyle)preferredStatusBarStyle
|
||||
{
|
||||
if ([MWMToast affectsStatusBar])
|
||||
return [MWMToast preferredStatusBarStyle];
|
||||
|
||||
return UIStatusBarStyleLightContent;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,15 +21,10 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController
|
|||
|
||||
+ (nonnull MWMAlertViewController *)activeAlertController
|
||||
{
|
||||
UIWindow * window = UIApplication.sharedApplication.delegate.window;
|
||||
UIViewController * rootViewController = window.rootViewController;
|
||||
ASSERT([rootViewController isKindOfClass:[UINavigationController class]], ());
|
||||
UINavigationController * navigationController =
|
||||
static_cast<UINavigationController *>(rootViewController);
|
||||
UIViewController * topViewController = navigationController.topViewController;
|
||||
ASSERT([topViewController conformsToProtocol:@protocol(MWMController)], ());
|
||||
UIViewController * tvc = topViewController();
|
||||
ASSERT([tvc conformsToProtocol:@protocol(MWMController)], ());
|
||||
UIViewController<MWMController> * mwmController =
|
||||
static_cast<UIViewController<MWMController> *>(topViewController);
|
||||
static_cast<UIViewController<MWMController> *>(tvc);
|
||||
return mwmController.alertController;
|
||||
}
|
||||
|
||||
|
|
8
iphone/Maps/Classes/CustomAlert/Toast/MWMToast.h
Normal file
8
iphone/Maps/Classes/CustomAlert/Toast/MWMToast.h
Normal file
|
@ -0,0 +1,8 @@
|
|||
@interface MWMToast : NSObject
|
||||
|
||||
+ (void)showWithText:(NSString *)text;
|
||||
|
||||
+ (BOOL)affectsStatusBar;
|
||||
+ (UIStatusBarStyle)preferredStatusBarStyle;
|
||||
|
||||
@end
|
178
iphone/Maps/Classes/CustomAlert/Toast/MWMToast.mm
Normal file
178
iphone/Maps/Classes/CustomAlert/Toast/MWMToast.mm
Normal file
|
@ -0,0 +1,178 @@
|
|||
#import "MWMToast.h"
|
||||
#import "Common.h"
|
||||
#import "UIColor+MapsMeColor.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
void * kContext = &kContext;
|
||||
NSString * const kKeyPath = @"sublayers";
|
||||
NSUInteger const kWordsPerSecond = 3;
|
||||
} // namespace
|
||||
|
||||
@interface MWMToast ()
|
||||
|
||||
@property(nonatomic) IBOutlet UIVisualEffectView * rootView;
|
||||
@property(nonatomic) IBOutlet UILabel * label;
|
||||
|
||||
@property(nonatomic) NSLayoutConstraint * bottomOffset;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MWMToast
|
||||
|
||||
+ (void)showWithText:(NSString *)text
|
||||
{
|
||||
MWMToast * toast = [MWMToast toast];
|
||||
toast.label.text = text;
|
||||
toast.label.textColor = [UIColor blackPrimaryText];
|
||||
[toast show];
|
||||
}
|
||||
|
||||
+ (BOOL)affectsStatusBar { return [MWMToast toast].rootView.superview != nil; }
|
||||
+ (UIStatusBarStyle)preferredStatusBarStyle
|
||||
{
|
||||
return [UIColor isNightMode] ? UIStatusBarStyleLightContent : UIStatusBarStyleDefault;
|
||||
}
|
||||
|
||||
+ (MWMToast *)toast
|
||||
{
|
||||
static MWMToast * toast;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
toast = [[super alloc] initToast];
|
||||
});
|
||||
return toast;
|
||||
}
|
||||
|
||||
- (instancetype)initToast
|
||||
{
|
||||
self = [super init];
|
||||
if (self)
|
||||
{
|
||||
[[NSBundle mainBundle] loadNibNamed:[MWMToast className] owner:self options:nil];
|
||||
self.rootView.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)configLayout
|
||||
{
|
||||
UIView * sv = self.rootView;
|
||||
[sv removeFromSuperview];
|
||||
|
||||
UIView * ov = topViewController().view;
|
||||
[ov addSubview:sv];
|
||||
|
||||
NSLayoutConstraint * topOffset = [NSLayoutConstraint constraintWithItem:sv
|
||||
attribute:NSLayoutAttributeTop
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
toItem:ov
|
||||
attribute:NSLayoutAttributeTop
|
||||
multiplier:1
|
||||
constant:0];
|
||||
topOffset.priority = UILayoutPriorityDefaultLow;
|
||||
self.bottomOffset = [NSLayoutConstraint constraintWithItem:sv
|
||||
attribute:NSLayoutAttributeBottom
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
toItem:ov
|
||||
attribute:NSLayoutAttributeTop
|
||||
multiplier:1
|
||||
constant:0];
|
||||
self.bottomOffset.priority = UILayoutPriorityDefaultHigh;
|
||||
NSLayoutConstraint * leadingOffset =
|
||||
[NSLayoutConstraint constraintWithItem:sv
|
||||
attribute:NSLayoutAttributeLeading
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
toItem:ov
|
||||
attribute:NSLayoutAttributeLeading
|
||||
multiplier:1
|
||||
constant:0];
|
||||
NSLayoutConstraint * trailingOffset =
|
||||
[NSLayoutConstraint constraintWithItem:sv
|
||||
attribute:NSLayoutAttributeTrailing
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
toItem:ov
|
||||
attribute:NSLayoutAttributeTrailing
|
||||
multiplier:1
|
||||
constant:0];
|
||||
[ov addConstraints:@[ topOffset, self.bottomOffset, leadingOffset, trailingOffset ]];
|
||||
[ov setNeedsLayout];
|
||||
}
|
||||
|
||||
- (void)scheduleHide
|
||||
{
|
||||
[NSObject cancelPreviousPerformRequestsWithTarget:self];
|
||||
NSString * text = self.label.text;
|
||||
NSArray<NSString *> * words = [text componentsSeparatedByString:@" "];
|
||||
NSTimeInterval const delay = MAX(2, 1 + words.count / kWordsPerSecond);
|
||||
[self performSelector:@selector(hide) withObject:nil afterDelay:delay];
|
||||
}
|
||||
|
||||
- (void)show
|
||||
{
|
||||
[self configLayout];
|
||||
|
||||
UIView * ov = topViewController().view;
|
||||
runAsyncOnMainQueue(^{
|
||||
[ov layoutIfNeeded];
|
||||
self.bottomOffset.priority = UILayoutPriorityFittingSizeLevel;
|
||||
[UIView animateWithDuration:kDefaultAnimationDuration
|
||||
animations:^{
|
||||
[ov layoutIfNeeded];
|
||||
}
|
||||
completion:^(BOOL finished) {
|
||||
[self subscribe];
|
||||
[topViewController() setNeedsStatusBarAppearanceUpdate];
|
||||
[self scheduleHide];
|
||||
}];
|
||||
});
|
||||
}
|
||||
|
||||
- (void)hide
|
||||
{
|
||||
[self unsubscribe];
|
||||
|
||||
UIView * ov = topViewController().view;
|
||||
[ov layoutIfNeeded];
|
||||
self.bottomOffset.priority = UILayoutPriorityDefaultHigh;
|
||||
[UIView animateWithDuration:kDefaultAnimationDuration
|
||||
animations:^{
|
||||
[ov layoutIfNeeded];
|
||||
}
|
||||
completion:^(BOOL finished) {
|
||||
[self.rootView removeFromSuperview];
|
||||
[topViewController() setNeedsStatusBarAppearanceUpdate];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)subscribe
|
||||
{
|
||||
UIView * sv = self.rootView;
|
||||
UIView * ov = sv.superview;
|
||||
CALayer * ol = ov.layer;
|
||||
[ol addObserver:self forKeyPath:kKeyPath options:NSKeyValueObservingOptionNew context:kContext];
|
||||
}
|
||||
|
||||
- (void)unsubscribe
|
||||
{
|
||||
UIView * sv = self.rootView;
|
||||
UIView * ov = sv.superview;
|
||||
CALayer * ol = ov.layer;
|
||||
[ol removeObserver:self forKeyPath:kKeyPath context:kContext];
|
||||
}
|
||||
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath
|
||||
ofObject:(id)object
|
||||
change:(NSDictionary *)change
|
||||
context:(void *)context
|
||||
{
|
||||
if (context == kContext)
|
||||
{
|
||||
UIView * sv = self.rootView;
|
||||
UIView * ov = sv.superview;
|
||||
[ov bringSubviewToFront:sv];
|
||||
return;
|
||||
}
|
||||
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
||||
}
|
||||
@end
|
51
iphone/Maps/Classes/CustomAlert/Toast/MWMToast.xib
Normal file
51
iphone/Maps/Classes/CustomAlert/Toast/MWMToast.xib
Normal file
|
@ -0,0 +1,51 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11542" systemVersion="16B2555" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MWMToast">
|
||||
<connections>
|
||||
<outlet property="label" destination="mPe-i4-dRq" id="s0h-O3-1Y2"/>
|
||||
<outlet property="rootView" destination="SVu-ra-Hl5" id="GEL-nd-Te2"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<visualEffectView opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" id="SVu-ra-Hl5">
|
||||
<rect key="frame" x="0.0" y="0.0" width="240" height="64"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="0Xo-JU-ane">
|
||||
<rect key="frame" x="0.0" y="0.0" width="240" height="64"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mPe-i4-dRq">
|
||||
<rect key="frame" x="16" y="32" width="208" height="20"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="colorName" value="blackPrimaryText"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="fontName" value="regular15"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="mPe-i4-dRq" secondAttribute="bottom" priority="750" constant="12" id="1De-GK-okF"/>
|
||||
<constraint firstAttribute="trailing" secondItem="mPe-i4-dRq" secondAttribute="trailing" constant="16" id="IPF-07-Cfv"/>
|
||||
<constraint firstItem="mPe-i4-dRq" firstAttribute="leading" secondItem="0Xo-JU-ane" secondAttribute="leading" constant="16" id="IVN-AW-nq9"/>
|
||||
<constraint firstItem="mPe-i4-dRq" firstAttribute="top" secondItem="0Xo-JU-ane" secondAttribute="top" constant="32" id="fID-cb-97V"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="backgroundColorName" value="toastBackground"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<blurEffect style="light"/>
|
||||
<point key="canvasLocation" x="-8" y="-327"/>
|
||||
</visualEffectView>
|
||||
</objects>
|
||||
</document>
|
|
@ -535,6 +535,9 @@ typedef NS_ENUM(NSUInteger, MWMBottomMenuViewCell) {
|
|||
|
||||
- (void)setState:(MWMBottomMenuState)state
|
||||
{
|
||||
runAsyncOnMainQueue(^{
|
||||
[self.controller setNeedsStatusBarAppearanceUpdate];
|
||||
});
|
||||
[self refreshRoutingDiminishTimer];
|
||||
MWMBottomMenuView * view = (MWMBottomMenuView *)self.view;
|
||||
BOOL const menuActive =
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#import "MWMSearchManager.h"
|
||||
#import "MWMSideButtons.h"
|
||||
#import "MWMTaxiPreviewDataSource.h"
|
||||
#import "MWMToast.h"
|
||||
#import "MWMTrafficButtonViewController.h"
|
||||
#import "MapViewController.h"
|
||||
#import "MapsAppDelegate.h"
|
||||
|
@ -78,6 +79,9 @@ extern NSString * const kAlohalyticsTapEventKey;
|
|||
|
||||
- (UIStatusBarStyle)preferredStatusBarStyle
|
||||
{
|
||||
if ([MWMToast affectsStatusBar])
|
||||
return [MWMToast preferredStatusBarStyle];
|
||||
|
||||
MWMSearchManagerState const searchManagerState =
|
||||
_searchManager ? _searchManager.state : MWMSearchManagerStateHidden;
|
||||
BOOL const isNightMode = [UIColor isNightMode];
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#import "MWMCuisineEditorViewController.h"
|
||||
#import "MWMKeyboard.h"
|
||||
#import "MWMTableViewCell.h"
|
||||
#import "MWMToast.h"
|
||||
#import "UIColor+MapsMeColor.h"
|
||||
|
||||
#include "indexer/cuisines.hpp"
|
||||
|
@ -47,7 +48,13 @@ vector<string> SliceKeys(vector<pair<string, string>> const & v)
|
|||
[MWMKeyboard addObserver:self];
|
||||
}
|
||||
|
||||
- (UIStatusBarStyle)preferredStatusBarStyle { return UIStatusBarStyleLightContent; }
|
||||
- (UIStatusBarStyle)preferredStatusBarStyle
|
||||
{
|
||||
if ([MWMToast affectsStatusBar])
|
||||
return [MWMToast preferredStatusBarStyle];
|
||||
return UIStatusBarStyleLightContent;
|
||||
}
|
||||
|
||||
#pragma mark - MWMKeyboard
|
||||
|
||||
- (void)onKeyboardAnimation
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#import "MWMEditorViewController.h"
|
||||
#import "MWMKeyboard.h"
|
||||
#import "MWMTableViewCell.h"
|
||||
#import "MWMToast.h"
|
||||
#import "Statistics.h"
|
||||
#import "UIColor+MapsMeColor.h"
|
||||
#import "UIViewController+Navigation.h"
|
||||
|
@ -94,7 +95,14 @@ string locale()
|
|||
[super backTap];
|
||||
}
|
||||
|
||||
- (UIStatusBarStyle)preferredStatusBarStyle { return UIStatusBarStyleLightContent; }
|
||||
- (UIStatusBarStyle)preferredStatusBarStyle
|
||||
{
|
||||
if ([MWMToast affectsStatusBar])
|
||||
return [MWMToast preferredStatusBarStyle];
|
||||
|
||||
return UIStatusBarStyleLightContent;
|
||||
}
|
||||
|
||||
- (void)configNavBar { self.title = L(@"editor_add_select_category"); }
|
||||
- (void)configSearchBar
|
||||
{
|
||||
|
|
|
@ -11,10 +11,11 @@
|
|||
#import "MWMMapDownloaderSubplaceTableViewCell.h"
|
||||
#import "MWMMapDownloaderTableViewCell.h"
|
||||
#import "MWMMapDownloaderViewController.h"
|
||||
#import "MWMMyTarget.h"
|
||||
#import "MWMMigrationViewController.h"
|
||||
#import "MWMMyTarget.h"
|
||||
#import "MWMSegue.h"
|
||||
#import "MWMStorage.h"
|
||||
#import "MWMToast.h"
|
||||
#import "MapsAppDelegate.h"
|
||||
#import "Statistics.h"
|
||||
#import "UIColor+MapsMeColor.h"
|
||||
|
@ -737,6 +738,8 @@ using namespace mwm;
|
|||
|
||||
- (UIStatusBarStyle)preferredStatusBarStyle
|
||||
{
|
||||
if ([MWMToast affectsStatusBar])
|
||||
return [MWMToast preferredStatusBarStyle];
|
||||
return UIStatusBarStyleLightContent;
|
||||
}
|
||||
|
||||
|
|
|
@ -241,6 +241,12 @@
|
|||
349A357C1B53D4C9009677EE /* MWMCircularProgressView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 349A35791B53D4C9009677EE /* MWMCircularProgressView.mm */; };
|
||||
349B49BE1D3F58C3005A3C4E /* MyTrackerSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 349B49BD1D3F58C3005A3C4E /* MyTrackerSDK.framework */; };
|
||||
349B49BF1D3F58C3005A3C4E /* MyTrackerSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 349B49BD1D3F58C3005A3C4E /* MyTrackerSDK.framework */; };
|
||||
349B926C1DF0518E007779DD /* MWMToast.mm in Sources */ = {isa = PBXBuildFile; fileRef = 349B926B1DF0518E007779DD /* MWMToast.mm */; };
|
||||
349B926D1DF0518E007779DD /* MWMToast.mm in Sources */ = {isa = PBXBuildFile; fileRef = 349B926B1DF0518E007779DD /* MWMToast.mm */; };
|
||||
349B926E1DF0518E007779DD /* MWMToast.mm in Sources */ = {isa = PBXBuildFile; fileRef = 349B926B1DF0518E007779DD /* MWMToast.mm */; };
|
||||
349B92701DF0526D007779DD /* MWMToast.xib in Resources */ = {isa = PBXBuildFile; fileRef = 349B926F1DF0526D007779DD /* MWMToast.xib */; };
|
||||
349B92711DF0526D007779DD /* MWMToast.xib in Resources */ = {isa = PBXBuildFile; fileRef = 349B926F1DF0526D007779DD /* MWMToast.xib */; };
|
||||
349B92721DF0526D007779DD /* MWMToast.xib in Resources */ = {isa = PBXBuildFile; fileRef = 349B926F1DF0526D007779DD /* MWMToast.xib */; };
|
||||
349C26B51BB02C6F0005DF2F /* MWMBottomMenuViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 349C26B31BB02C6F0005DF2F /* MWMBottomMenuViewController.mm */; };
|
||||
349C26B61BB02C6F0005DF2F /* MWMBottomMenuViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 349C26B41BB02C6F0005DF2F /* MWMBottomMenuViewController.xib */; };
|
||||
349C26B91BB04ED30005DF2F /* MWMBottomMenuView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 349C26B81BB04ED30005DF2F /* MWMBottomMenuView.mm */; };
|
||||
|
@ -1650,6 +1656,9 @@
|
|||
349A35781B53D4C9009677EE /* MWMCircularProgressView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMCircularProgressView.h; sourceTree = "<group>"; };
|
||||
349A35791B53D4C9009677EE /* MWMCircularProgressView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMCircularProgressView.mm; sourceTree = "<group>"; };
|
||||
349B49BD1D3F58C3005A3C4E /* MyTrackerSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MyTrackerSDK.framework; path = Frameworks/MyTrackerSDK.framework; sourceTree = "<group>"; };
|
||||
349B926A1DF0518E007779DD /* MWMToast.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMToast.h; sourceTree = "<group>"; };
|
||||
349B926B1DF0518E007779DD /* MWMToast.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMToast.mm; sourceTree = "<group>"; };
|
||||
349B926F1DF0526D007779DD /* MWMToast.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMToast.xib; sourceTree = "<group>"; };
|
||||
349C26B21BB02C6F0005DF2F /* MWMBottomMenuViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMBottomMenuViewController.h; sourceTree = "<group>"; };
|
||||
349C26B31BB02C6F0005DF2F /* MWMBottomMenuViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMBottomMenuViewController.mm; sourceTree = "<group>"; };
|
||||
349C26B41BB02C6F0005DF2F /* MWMBottomMenuViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMBottomMenuViewController.xib; sourceTree = "<group>"; };
|
||||
|
@ -2923,6 +2932,16 @@
|
|||
path = CustomViews/CircularProgress;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
349B92691DF0516C007779DD /* Toast */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
349B926A1DF0518E007779DD /* MWMToast.h */,
|
||||
349B926B1DF0518E007779DD /* MWMToast.mm */,
|
||||
349B926F1DF0526D007779DD /* MWMToast.xib */,
|
||||
);
|
||||
path = Toast;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
349C26AE1BB0116D0005DF2F /* BottomMenu */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -3480,6 +3499,7 @@
|
|||
F64F195F1AB8125C006EAF7E /* CustomAlert */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
349B92691DF0516C007779DD /* Toast */,
|
||||
349A137E1DEC138C00C7DB60 /* MobileInternetAlert */,
|
||||
3462258B1DDC5D76001E8752 /* SearchAlert */,
|
||||
F6FE3C351CC50FDF00A73196 /* PlaceDoesntExist */,
|
||||
|
@ -4123,6 +4143,7 @@
|
|||
EEA61604134C496A003A9827 /* 04_padauk.ttf in Resources */,
|
||||
F6D4A73C1CC1267E00BD4E5B /* MWMNoteCell.xib in Resources */,
|
||||
3406FA181C6E0D8F00E9FAD2 /* MWMMapDownloadDialog.xib in Resources */,
|
||||
349B92701DF0526D007779DD /* MWMToast.xib in Resources */,
|
||||
341F99E31C6B1165001C67B8 /* MWMMapDownloaderTableViewCell.xib in Resources */,
|
||||
341F99D71C6B1165001C67B8 /* MWMMapDownloaderLargeCountryTableViewCell.xib in Resources */,
|
||||
EEA61605134C496A003A9827 /* 05_khmeros.ttf in Resources */,
|
||||
|
@ -4288,6 +4309,7 @@
|
|||
347FD86E1C60B2CE002FB65E /* MWMOpeningHoursAddScheduleTableViewCell.xib in Resources */,
|
||||
9DA46A0D1C47E92100EF52BA /* resources-xhdpi_legacy in Resources */,
|
||||
9DA46A0F1C47E92100EF52BA /* resources-xxhdpi_legacy in Resources */,
|
||||
349B92711DF0526D007779DD /* MWMToast.xib in Resources */,
|
||||
6741A9571BF340DE002C974C /* 03_jomolhari-id-a3d.ttf in Resources */,
|
||||
6741A9581BF340DE002C974C /* 04_padauk.ttf in Resources */,
|
||||
F634C8F41D79996D00BE04E2 /* _MWMPPPExternalTitle.xib in Resources */,
|
||||
|
@ -4474,6 +4496,7 @@
|
|||
849CF6221DE842290024A8A5 /* MWMEditorAddAdditionalNameTableViewCell.xib in Resources */,
|
||||
849CF6231DE842290024A8A5 /* MWMStreetEditorEditTableViewCell.xib in Resources */,
|
||||
849CF6241DE842290024A8A5 /* _MWMPPPTitle.xib in Resources */,
|
||||
349B92721DF0526D007779DD /* MWMToast.xib in Resources */,
|
||||
849CF6251DE842290024A8A5 /* cuisine-strings in Resources */,
|
||||
849CF6261DE842290024A8A5 /* MWMAboutControllerHeader.xib in Resources */,
|
||||
849CF6271DE842290024A8A5 /* LaunchScreen.storyboard in Resources */,
|
||||
|
@ -4758,6 +4781,7 @@
|
|||
F6DBF9B61AA8779300F2EC2C /* CALayer+RuntimeAttributes.mm in Sources */,
|
||||
347FD8731C60B2CE002FB65E /* MWMOpeningHoursClosedSpanTableViewCell.mm in Sources */,
|
||||
FA36B80D15403A4F004560CC /* BookmarksVC.mm in Sources */,
|
||||
349B926C1DF0518E007779DD /* MWMToast.mm in Sources */,
|
||||
3490D2E01CE9DD2500D0B838 /* MWMSideButtonsView.mm in Sources */,
|
||||
F668F6561BCD4507002D6FFC /* MWMTTSSettingsViewController.mm in Sources */,
|
||||
34ABA61B1C2D4DCC00FE1BEC /* UITextField+RuntimeAttributes.mm in Sources */,
|
||||
|
@ -5009,6 +5033,7 @@
|
|||
6741A9F41BF340DE002C974C /* CALayer+RuntimeAttributes.mm in Sources */,
|
||||
56C74C391C74A3BC00B71B9F /* MWMInputEmailValidator.mm in Sources */,
|
||||
6741A9F51BF340DE002C974C /* BookmarksVC.mm in Sources */,
|
||||
349B926D1DF0518E007779DD /* MWMToast.mm in Sources */,
|
||||
347FD8741C60B2CE002FB65E /* MWMOpeningHoursClosedSpanTableViewCell.mm in Sources */,
|
||||
3490D2E11CE9DD2500D0B838 /* MWMSideButtonsView.mm in Sources */,
|
||||
6741A9F91BF340DE002C974C /* MWMSearchSuggestionCell.mm in Sources */,
|
||||
|
@ -5331,6 +5356,7 @@
|
|||
849CF7411DE842290024A8A5 /* MWMMapDownloaderSubplaceTableViewCell.mm in Sources */,
|
||||
849CF7421DE842290024A8A5 /* MWMNoMapsView.mm in Sources */,
|
||||
849CF7431DE842290024A8A5 /* MWMCustomFacebookEvents.mm in Sources */,
|
||||
349B926E1DF0518E007779DD /* MWMToast.mm in Sources */,
|
||||
849CF7441DE842290024A8A5 /* SwitchCell.mm in Sources */,
|
||||
849CF7451DE842290024A8A5 /* UIView+RuntimeAttributes.mm in Sources */,
|
||||
849CF7461DE842290024A8A5 /* MWMTableViewCell.mm in Sources */,
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
+ (UIColor *)bookingBackground;
|
||||
+ (UIColor *)opentableBackground;
|
||||
+ (UIColor *)bannerBackground;
|
||||
+ (UIColor *)toastBackground;
|
||||
|
||||
+ (UIColor *)colorWithName:(NSString *)colorName;
|
||||
|
||||
|
|
|
@ -64,7 +64,10 @@ NSDictionary<NSString *, UIColor *> * night = @{
|
|||
@"alertBackground" :
|
||||
[UIColor colorWithRed:scaled(60.) green:scaled(64.) blue:scaled(68.) alpha:alpha90],
|
||||
@"blackOpaque" : [UIColor colorWithWhite:1. alpha:alpha04],
|
||||
@"bannerBackground" : [UIColor colorWithRed:scaled(85.) green:scaled(90.) blue:scaled(90.) alpha:alpha100]
|
||||
@"bannerBackground" :
|
||||
[UIColor colorWithRed:scaled(85.) green:scaled(90.) blue:scaled(90.) alpha:alpha100],
|
||||
@"toastBackground" :
|
||||
[UIColor colorWithRed:scaled(60.) green:scaled(64.) blue:scaled(68.) alpha:alpha26]
|
||||
};
|
||||
|
||||
NSDictionary<NSString *, UIColor *> * day = @{
|
||||
|
@ -109,7 +112,10 @@ NSDictionary<NSString *, UIColor *> * day = @{
|
|||
[UIColor colorWithRed:scaled(3.) green:scaled(122.) blue:scaled(255.) alpha:alpha26],
|
||||
@"alertBackground" : [UIColor colorWithWhite:1. alpha:alpha90],
|
||||
@"blackOpaque" : [UIColor colorWithWhite:0. alpha:alpha04],
|
||||
@"bannerBackground" : [UIColor colorWithRed:scaled(255.) green:scaled(248.) blue:scaled(225.) alpha:alpha100]
|
||||
@"bannerBackground" :
|
||||
[UIColor colorWithRed:scaled(255.) green:scaled(248.) blue:scaled(225.) alpha:alpha100],
|
||||
@"toastBackground" :
|
||||
[UIColor colorWithRed:scaled(255.) green:scaled(255.) blue:scaled(255.) alpha:alpha40]
|
||||
};
|
||||
|
||||
UIColor * color(SEL cmd)
|
||||
|
@ -308,7 +314,7 @@ UIColor * color(SEL cmd)
|
|||
{
|
||||
return color(_cmd);
|
||||
}
|
||||
|
||||
+ (UIColor *)toastBackground { return color(_cmd); }
|
||||
+ (UIColor *)colorWithName:(NSString *)colorName
|
||||
{
|
||||
#pragma clang diagnostic push
|
||||
|
|
Loading…
Add table
Reference in a new issue