Repo created
This commit is contained in:
parent
4af19165ec
commit
68073add76
12458 changed files with 12350765 additions and 2 deletions
|
|
@ -0,0 +1,45 @@
|
|||
#import "MWMAlert.h"
|
||||
|
||||
@interface MWMDefaultAlert : MWMAlert
|
||||
|
||||
+ (instancetype)routeNotFoundAlert;
|
||||
+ (instancetype)routeNotFoundNoPublicTransportAlert;
|
||||
+ (instancetype)routeNotFoundTooLongPedestrianAlert;
|
||||
+ (instancetype)routeFileNotExistAlert;
|
||||
+ (instancetype)endPointNotFoundAlert;
|
||||
+ (instancetype)startPointNotFoundAlert;
|
||||
+ (instancetype)intermediatePointNotFoundAlert;
|
||||
+ (instancetype)internalRoutingErrorAlert;
|
||||
+ (instancetype)incorrectFeaturePositionAlert;
|
||||
+ (instancetype)notEnoughSpaceAlert;
|
||||
+ (instancetype)invalidUserNameOrPasswordAlert;
|
||||
+ (instancetype)noCurrentPositionAlert;
|
||||
+ (instancetype)pointsInDifferentMWMAlert;
|
||||
+ (instancetype)disabledLocationAlert;
|
||||
+ (instancetype)noWiFiAlertWithOkBlock:(MWMVoidBlock)okBlock andCancelBlock:(MWMVoidBlock)cancelBlock;
|
||||
+ (instancetype)noConnectionAlert;
|
||||
+ (instancetype)deleteMapProhibitedAlert;
|
||||
+ (instancetype)unsavedEditsAlertWithOkBlock:(MWMVoidBlock)okBlock;
|
||||
+ (instancetype)locationServiceNotSupportedAlert;
|
||||
+ (instancetype)point2PointAlertWithOkBlock:(MWMVoidBlock)okBlock needToRebuild:(BOOL)needToRebuild;
|
||||
+ (instancetype)downloaderNoConnectionAlertWithOkBlock:(MWMVoidBlock)okBlock cancelBlock:(MWMVoidBlock)cancelBlock;
|
||||
+ (instancetype)downloaderNotEnoughSpaceAlert;
|
||||
+ (instancetype)downloaderInternalErrorAlertWithOkBlock:(MWMVoidBlock)okBlock cancelBlock:(MWMVoidBlock)cancelBlock;
|
||||
+ (instancetype)resetChangesAlertWithBlock:(MWMVoidBlock)block;
|
||||
+ (instancetype)deleteFeatureAlertWithBlock:(MWMVoidBlock)block;
|
||||
+ (instancetype)personalInfoWarningAlertWithBlock:(MWMVoidBlock)block;
|
||||
+ (instancetype)trackWarningAlertWithCancelBlock:(MWMVoidBlock)block;
|
||||
+ (instancetype)infoAlert:(NSString *)title text:(NSString *)text;
|
||||
+ (instancetype)convertBookmarksWithCount:(NSUInteger)count okBlock:(MWMVoidBlock)okBlock;
|
||||
+ (instancetype)bookmarkConversionErrorAlert;
|
||||
+ (instancetype)tagsLoadingErrorAlertWithOkBlock:(MWMVoidBlock)okBlock cancelBlock:(MWMVoidBlock)cancelBlock;
|
||||
+ (instancetype)bugReportAlertWithTitle:(NSString *)title;
|
||||
|
||||
+ (instancetype)defaultAlertWithTitle:(NSString *)title
|
||||
message:(NSString *)message
|
||||
rightButtonTitle:(NSString *)rightButtonTitle
|
||||
leftButtonTitle:(NSString *)leftButtonTitle
|
||||
rightButtonAction:(MWMVoidBlock)action
|
||||
log:(NSString *)log;
|
||||
|
||||
@end
|
||||
404
iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.mm
Normal file
404
iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.mm
Normal file
|
|
@ -0,0 +1,404 @@
|
|||
#import "MWMDefaultAlert.h"
|
||||
#import "SwiftBridge.h"
|
||||
|
||||
#include <CoreApi/Framework.h>
|
||||
|
||||
static CGFloat const kDividerTopConstant = -8.;
|
||||
|
||||
@interface MWMDefaultAlert ()
|
||||
|
||||
@property(weak, nonatomic) IBOutlet UILabel *messageLabel;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *rightButton;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *leftButton;
|
||||
@property(weak, nonatomic) IBOutlet UILabel *titleLabel;
|
||||
@property(weak, nonatomic) IBOutlet NSLayoutConstraint *rightButtonWidth;
|
||||
@property(copy, nonatomic) MWMVoidBlock leftButtonAction;
|
||||
@property(copy, nonatomic, readwrite) MWMVoidBlock rightButtonAction;
|
||||
@property(weak, nonatomic) IBOutlet NSLayoutConstraint *dividerTop;
|
||||
@property(weak, nonatomic) IBOutlet UIView *vDivider;
|
||||
|
||||
@end
|
||||
|
||||
static NSString *const kDefaultAlertNibName = @"MWMDefaultAlert";
|
||||
|
||||
@implementation MWMDefaultAlert
|
||||
|
||||
+ (instancetype)routeFileNotExistAlert {
|
||||
return [self defaultAlertWithTitle:L(@"dialog_routing_download_files")
|
||||
message:L(@"dialog_routing_download_and_update_all")
|
||||
rightButtonTitle:L(@"ok")
|
||||
leftButtonTitle:nil
|
||||
rightButtonAction:nil
|
||||
log:@"Route File Not Exist Alert"];
|
||||
}
|
||||
|
||||
+ (instancetype)routeNotFoundAlert {
|
||||
return [self defaultAlertWithTitle:L(@"dialog_routing_unable_locate_route")
|
||||
message:L(@"dialog_routing_change_start_or_end")
|
||||
rightButtonTitle:L(@"ok")
|
||||
leftButtonTitle:nil
|
||||
rightButtonAction:nil
|
||||
log:@"Route File Not Exist Alert"];
|
||||
}
|
||||
|
||||
+ (instancetype)routeNotFoundNoPublicTransportAlert {
|
||||
return [self defaultAlertWithTitle:L(@"transit_not_found")
|
||||
message:nil
|
||||
rightButtonTitle:L(@"ok")
|
||||
leftButtonTitle:nil
|
||||
rightButtonAction:nil
|
||||
log:@"transit_not_found"];
|
||||
}
|
||||
|
||||
+ (instancetype)routeNotFoundTooLongPedestrianAlert {
|
||||
return [self defaultAlertWithTitle:L(@"dialog_pedestrian_route_is_long_header")
|
||||
message:L(@"dialog_pedestrian_route_is_long_message")
|
||||
rightButtonTitle:L(@"ok")
|
||||
leftButtonTitle:nil
|
||||
rightButtonAction:nil
|
||||
log:@"Long Pedestrian Route Alert"];
|
||||
}
|
||||
|
||||
+ (instancetype)locationServiceNotSupportedAlert {
|
||||
return [self defaultAlertWithTitle:L(@"current_location_unknown_error_title")
|
||||
message:L(@"current_location_unknown_error_message")
|
||||
rightButtonTitle:L(@"ok")
|
||||
leftButtonTitle:nil
|
||||
rightButtonAction:nil
|
||||
log:@"Location Service Not Supported Alert"];
|
||||
}
|
||||
|
||||
+ (instancetype)noConnectionAlert {
|
||||
MWMDefaultAlert *alert = [self defaultAlertWithTitle:L(@"common_check_internet_connection_dialog")
|
||||
message:nil
|
||||
rightButtonTitle:L(@"ok")
|
||||
leftButtonTitle:nil
|
||||
rightButtonAction:nil
|
||||
log:@"No Connection Alert"];
|
||||
[alert setNeedsCloseAlertAfterEnterBackground];
|
||||
return alert;
|
||||
}
|
||||
|
||||
+ (instancetype)deleteMapProhibitedAlert {
|
||||
MWMDefaultAlert *alert = [self defaultAlertWithTitle:L(@"downloader_delete_map")
|
||||
message:L(@"downloader_delete_map_while_routing_dialog")
|
||||
rightButtonTitle:L(@"ok")
|
||||
leftButtonTitle:nil
|
||||
rightButtonAction:nil
|
||||
log:@"Delete Map Prohibited Alert"];
|
||||
[alert setNeedsCloseAlertAfterEnterBackground];
|
||||
return alert;
|
||||
}
|
||||
|
||||
+ (instancetype)unsavedEditsAlertWithOkBlock:(MWMVoidBlock)okBlock {
|
||||
return [self defaultAlertWithTitle:L(@"please_note")
|
||||
message:L(@"downloader_delete_map_dialog")
|
||||
rightButtonTitle:L(@"delete")
|
||||
leftButtonTitle:L(@"cancel")
|
||||
rightButtonAction:okBlock
|
||||
log:@"Editor unsaved changes on delete"];
|
||||
}
|
||||
|
||||
+ (instancetype)noWiFiAlertWithOkBlock:(MWMVoidBlock)okBlock andCancelBlock:(MWMVoidBlock)cancelBlock {
|
||||
MWMDefaultAlert *alert = [self defaultAlertWithTitle:L(@"download_over_mobile_header")
|
||||
message:L(@"download_over_mobile_message")
|
||||
rightButtonTitle:L(@"use_cellular_data")
|
||||
leftButtonTitle:L(@"cancel")
|
||||
rightButtonAction:okBlock
|
||||
log:@"No WiFi Alert"];
|
||||
alert.leftButtonAction = cancelBlock;
|
||||
[alert setNeedsCloseAlertAfterEnterBackground];
|
||||
return alert;
|
||||
}
|
||||
|
||||
+ (instancetype)endPointNotFoundAlert {
|
||||
NSString *message = [NSString
|
||||
stringWithFormat:@"%@\n\n%@", L(@"dialog_routing_end_not_determined"), L(@"dialog_routing_select_closer_end")];
|
||||
return [self defaultAlertWithTitle:L(@"dialog_routing_change_end")
|
||||
message:message
|
||||
rightButtonTitle:L(@"ok")
|
||||
leftButtonTitle:nil
|
||||
rightButtonAction:nil
|
||||
log:@"End Point Not Found Alert"];
|
||||
}
|
||||
|
||||
+ (instancetype)startPointNotFoundAlert {
|
||||
NSString *message = [NSString
|
||||
stringWithFormat:@"%@\n\n%@", L(@"dialog_routing_start_not_determined"), L(@"dialog_routing_select_closer_start")];
|
||||
return [self defaultAlertWithTitle:L(@"dialog_routing_change_start")
|
||||
message:message
|
||||
rightButtonTitle:L(@"ok")
|
||||
leftButtonTitle:nil
|
||||
rightButtonAction:nil
|
||||
log:@"Start Point Not Found Alert"];
|
||||
}
|
||||
|
||||
+ (instancetype)intermediatePointNotFoundAlert {
|
||||
return [self defaultAlertWithTitle:L(@"dialog_routing_change_intermediate")
|
||||
message:L(@"dialog_routing_intermediate_not_determined")
|
||||
rightButtonTitle:L(@"ok")
|
||||
leftButtonTitle:nil
|
||||
rightButtonAction:nil
|
||||
log:@"Intermediate Point Not Found Alert"];
|
||||
}
|
||||
|
||||
+ (instancetype)internalRoutingErrorAlert {
|
||||
NSString *message =
|
||||
[NSString stringWithFormat:@"%@\n\n%@", L(@"dialog_routing_application_error"), L(@"dialog_routing_try_again")];
|
||||
return [self defaultAlertWithTitle:L(@"dialog_routing_system_error")
|
||||
message:message
|
||||
rightButtonTitle:L(@"ok")
|
||||
leftButtonTitle:nil
|
||||
rightButtonAction:nil
|
||||
log:@"Internal Routing Error Alert"];
|
||||
}
|
||||
|
||||
+ (instancetype)incorrectFeaturePositionAlert {
|
||||
return [self defaultAlertWithTitle:L(@"dialog_incorrect_feature_position")
|
||||
message:L(@"message_invalid_feature_position")
|
||||
rightButtonTitle:L(@"ok")
|
||||
leftButtonTitle:nil
|
||||
rightButtonAction:nil
|
||||
log:@"Incorrect Feature Possition Alert"];
|
||||
}
|
||||
|
||||
+ (instancetype)notEnoughSpaceAlert {
|
||||
MWMDefaultAlert *alert = [self defaultAlertWithTitle:L(@"downloader_no_space_title")
|
||||
message:L(@"migration_no_space_message")
|
||||
rightButtonTitle:L(@"ok")
|
||||
leftButtonTitle:nil
|
||||
rightButtonAction:nil
|
||||
log:@"Not Enough Space Alert"];
|
||||
[alert setNeedsCloseAlertAfterEnterBackground];
|
||||
return alert;
|
||||
}
|
||||
|
||||
+ (instancetype)invalidUserNameOrPasswordAlert {
|
||||
return [self defaultAlertWithTitle:L(@"invalid_username_or_password")
|
||||
message:nil
|
||||
rightButtonTitle:L(@"ok")
|
||||
leftButtonTitle:nil
|
||||
rightButtonAction:nil
|
||||
log:@"Invalid User Name or Password Alert"];
|
||||
}
|
||||
|
||||
+ (instancetype)noCurrentPositionAlert {
|
||||
NSString *message = [NSString stringWithFormat:@"%@\n\n%@", L(@"dialog_routing_error_location_not_found"),
|
||||
L(@"dialog_routing_location_turn_wifi")];
|
||||
return [self defaultAlertWithTitle:L(@"dialog_routing_check_gps")
|
||||
message:message
|
||||
rightButtonTitle:L(@"ok")
|
||||
leftButtonTitle:nil
|
||||
rightButtonAction:nil
|
||||
log:@"No Current Position Alert"];
|
||||
}
|
||||
|
||||
+ (instancetype)disabledLocationAlert {
|
||||
MWMVoidBlock action = ^{
|
||||
GetFramework().SwitchMyPositionNextMode();
|
||||
};
|
||||
return [self defaultAlertWithTitle:L(@"dialog_routing_location_turn_on")
|
||||
message:L(@"dialog_routing_location_unknown_turn_on")
|
||||
rightButtonTitle:L(@"turn_on")
|
||||
leftButtonTitle:L(@"later")
|
||||
rightButtonAction:action
|
||||
log:@"Disabled Location Alert"];
|
||||
}
|
||||
|
||||
+ (instancetype)pointsInDifferentMWMAlert {
|
||||
return [self defaultAlertWithTitle:L(@"routing_failed_cross_mwm_building")
|
||||
message:nil
|
||||
rightButtonTitle:L(@"ok")
|
||||
leftButtonTitle:nil
|
||||
rightButtonAction:nil
|
||||
log:@"Points In Different MWM Alert"];
|
||||
}
|
||||
|
||||
+ (instancetype)point2PointAlertWithOkBlock:(MWMVoidBlock)okBlock needToRebuild:(BOOL)needToRebuild {
|
||||
if (needToRebuild) {
|
||||
return [self defaultAlertWithTitle:L(@"p2p_only_from_current")
|
||||
message:L(@"p2p_reroute_from_current")
|
||||
rightButtonTitle:L(@"ok")
|
||||
leftButtonTitle:L(@"cancel")
|
||||
rightButtonAction:okBlock
|
||||
log:@"Default Alert"];
|
||||
} else {
|
||||
return [self defaultAlertWithTitle:L(@"p2p_only_from_current")
|
||||
message:nil
|
||||
rightButtonTitle:L(@"ok")
|
||||
leftButtonTitle:nil
|
||||
rightButtonAction:nil
|
||||
log:@"Default Alert"];
|
||||
}
|
||||
}
|
||||
|
||||
+ (instancetype)downloaderNoConnectionAlertWithOkBlock:(MWMVoidBlock)okBlock cancelBlock:(MWMVoidBlock)cancelBlock {
|
||||
MWMDefaultAlert *alert = [self defaultAlertWithTitle:L(@"downloader_status_failed")
|
||||
message:L(@"common_check_internet_connection_dialog")
|
||||
rightButtonTitle:L(@"downloader_retry")
|
||||
leftButtonTitle:L(@"cancel")
|
||||
rightButtonAction:okBlock
|
||||
log:@"Downloader No Connection Alert"];
|
||||
alert.leftButtonAction = cancelBlock;
|
||||
[alert setNeedsCloseAlertAfterEnterBackground];
|
||||
return alert;
|
||||
}
|
||||
|
||||
+ (instancetype)downloaderNotEnoughSpaceAlert {
|
||||
MWMDefaultAlert *alert = [self defaultAlertWithTitle:L(@"downloader_no_space_title")
|
||||
message:L(@"downloader_no_space_message")
|
||||
rightButtonTitle:L(@"close")
|
||||
leftButtonTitle:nil
|
||||
rightButtonAction:nil
|
||||
log:@"Downloader Not Enough Space Alert"];
|
||||
[alert setNeedsCloseAlertAfterEnterBackground];
|
||||
return alert;
|
||||
}
|
||||
|
||||
+ (instancetype)downloaderInternalErrorAlertWithOkBlock:(MWMVoidBlock)okBlock cancelBlock:(MWMVoidBlock)cancelBlock {
|
||||
MWMDefaultAlert *alert = [self defaultAlertWithTitle:L(@"migration_download_error_dialog")
|
||||
message:nil
|
||||
rightButtonTitle:L(@"downloader_retry")
|
||||
leftButtonTitle:L(@"cancel")
|
||||
rightButtonAction:okBlock
|
||||
log:@"Downloader Internal Error Alert"];
|
||||
alert.leftButtonAction = cancelBlock;
|
||||
[alert setNeedsCloseAlertAfterEnterBackground];
|
||||
return alert;
|
||||
}
|
||||
|
||||
+ (instancetype)resetChangesAlertWithBlock:(MWMVoidBlock)block {
|
||||
MWMDefaultAlert *alert = [self defaultAlertWithTitle:L(@"editor_reset_edits_message")
|
||||
message:nil
|
||||
rightButtonTitle:L(@"editor_reset_edits_button")
|
||||
leftButtonTitle:L(@"cancel")
|
||||
rightButtonAction:block
|
||||
log:@"Reset changes alert"];
|
||||
return alert;
|
||||
}
|
||||
|
||||
+ (instancetype)deleteFeatureAlertWithBlock:(MWMVoidBlock)block {
|
||||
MWMDefaultAlert *alert = [self defaultAlertWithTitle:L(@"editor_remove_place_message")
|
||||
message:nil
|
||||
rightButtonTitle:L(@"editor_remove_place_button")
|
||||
leftButtonTitle:L(@"cancel")
|
||||
rightButtonAction:block
|
||||
log:@"Delete feature alert"];
|
||||
return alert;
|
||||
}
|
||||
|
||||
+ (instancetype)personalInfoWarningAlertWithBlock:(MWMVoidBlock)block {
|
||||
NSString *message = [NSString
|
||||
stringWithFormat:@"%@\n%@", L(@"editor_share_to_all_dialog_message_1"), L(@"editor_share_to_all_dialog_message_2")];
|
||||
MWMDefaultAlert *alert = [self defaultAlertWithTitle:L(@"editor_share_to_all_dialog_title")
|
||||
message:message
|
||||
rightButtonTitle:L(@"editor_report_problem_send_button")
|
||||
leftButtonTitle:L(@"cancel")
|
||||
rightButtonAction:block
|
||||
log:@"Personal info warning alert"];
|
||||
return alert;
|
||||
}
|
||||
|
||||
+ (instancetype)trackWarningAlertWithCancelBlock:(MWMVoidBlock)block {
|
||||
MWMDefaultAlert *alert = [self defaultAlertWithTitle:L(@"recent_track_background_dialog_title")
|
||||
message:L(@"recent_track_background_dialog_message")
|
||||
rightButtonTitle:L(@"off_recent_track_background_button")
|
||||
leftButtonTitle:L(@"continue_button")
|
||||
rightButtonAction:block
|
||||
log:@"Track warning alert"];
|
||||
return alert;
|
||||
}
|
||||
|
||||
+ (instancetype)infoAlert:(NSString *)title text:(NSString *)text {
|
||||
return [self defaultAlertWithTitle:title
|
||||
message:text
|
||||
rightButtonTitle:L(@"ok")
|
||||
leftButtonTitle:nil
|
||||
rightButtonAction:nil
|
||||
log:@"Info Alert"];
|
||||
}
|
||||
|
||||
+ (instancetype)convertBookmarksWithCount:(NSUInteger)count okBlock:(MWMVoidBlock)okBlock {
|
||||
return [self defaultAlertWithTitle:L(@"bookmarks_detect_title")
|
||||
message:[NSString stringWithFormat:L(@"bookmarks_detect_message"), count]
|
||||
rightButtonTitle:L(@"button_convert")
|
||||
leftButtonTitle:L(@"cancel")
|
||||
rightButtonAction:okBlock
|
||||
log:nil];
|
||||
}
|
||||
|
||||
+ (instancetype)bookmarkConversionErrorAlert {
|
||||
return [self defaultAlertWithTitle:L(@"bookmarks_convert_error_title")
|
||||
message:L(@"bookmarks_convert_error_message")
|
||||
rightButtonTitle:L(@"ok")
|
||||
leftButtonTitle:nil
|
||||
rightButtonAction:nil
|
||||
log:nil];
|
||||
}
|
||||
|
||||
+ (instancetype)tagsLoadingErrorAlertWithOkBlock:(MWMVoidBlock)okBlock cancelBlock:(MWMVoidBlock)cancelBlock {
|
||||
MWMDefaultAlert *alert = [self defaultAlertWithTitle:L(@"title_error_downloading_bookmarks")
|
||||
message:L(@"tags_loading_error_subtitle")
|
||||
rightButtonTitle:L(@"downloader_retry")
|
||||
leftButtonTitle:L(@"cancel")
|
||||
rightButtonAction:okBlock
|
||||
log:nil];
|
||||
alert.leftButtonAction = cancelBlock;
|
||||
[alert setNeedsCloseAlertAfterEnterBackground];
|
||||
return alert;
|
||||
}
|
||||
|
||||
+ (instancetype)bugReportAlertWithTitle:(NSString *)title {
|
||||
MWMDefaultAlert *alert = [self defaultAlertWithTitle:title
|
||||
message:L(@"bugreport_alert_message")
|
||||
rightButtonTitle:L(@"report_a_bug")
|
||||
leftButtonTitle:L(@"cancel")
|
||||
rightButtonAction:^{ [MailComposer sendBugReportWithTitle:title]; }
|
||||
log:nil];
|
||||
[alert setNeedsCloseAlertAfterEnterBackground];
|
||||
return alert;
|
||||
}
|
||||
|
||||
+ (instancetype)defaultAlertWithTitle:(NSString *)title
|
||||
message:(NSString *)message
|
||||
rightButtonTitle:(NSString *)rightButtonTitle
|
||||
leftButtonTitle:(NSString *)leftButtonTitle
|
||||
rightButtonAction:(MWMVoidBlock)action
|
||||
log:(NSString *)log {
|
||||
if (log) {
|
||||
LOG(LINFO, ([log UTF8String]));
|
||||
}
|
||||
MWMDefaultAlert *alert = [NSBundle.mainBundle loadNibNamed:kDefaultAlertNibName owner:self options:nil].firstObject;
|
||||
alert.titleLabel.text = title;
|
||||
alert.messageLabel.text = message;
|
||||
if (!message) {
|
||||
alert.dividerTop.constant = kDividerTopConstant;
|
||||
[alert layoutIfNeeded];
|
||||
}
|
||||
|
||||
[alert.rightButton setTitle:rightButtonTitle forState:UIControlStateNormal];
|
||||
[alert.rightButton setTitle:rightButtonTitle forState:UIControlStateDisabled];
|
||||
|
||||
alert.rightButtonAction = action;
|
||||
if (leftButtonTitle) {
|
||||
[alert.leftButton setTitle:leftButtonTitle forState:UIControlStateNormal];
|
||||
[alert.leftButton setTitle:leftButtonTitle forState:UIControlStateDisabled];
|
||||
} else {
|
||||
alert.vDivider.hidden = YES;
|
||||
alert.leftButton.hidden = YES;
|
||||
alert.rightButtonWidth.constant = [alert.subviews.firstObject width];
|
||||
}
|
||||
return alert;
|
||||
}
|
||||
|
||||
#pragma mark - Actions
|
||||
|
||||
- (IBAction)rightButtonTap {
|
||||
[self close:self.rightButtonAction];
|
||||
}
|
||||
|
||||
- (IBAction)leftButtonTap {
|
||||
[self close:self.leftButtonAction];
|
||||
}
|
||||
|
||||
@end
|
||||
155
iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.xib
Normal file
155
iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.xib
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
|
||||
<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"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="MWMDefaultAlert" propertyAccessControl="none">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zso-DD-6SG" userLabel="ContainerView">
|
||||
<rect key="frame" x="47.5" y="264.5" width="280" height="138.5"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Title" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Grl-z5-2cE" userLabel="Title">
|
||||
<rect key="frame" x="20" y="20" width="240" height="21.5"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="20" id="0SG-Lk-wkv"/>
|
||||
<constraint firstAttribute="width" constant="240" id="9rm-Av-9eY"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="18"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="medium18:blackPrimaryText"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Message" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0D6-oV-Lio" userLabel="Message">
|
||||
<rect key="frame" x="20" y="53.5" width="240" height="20"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="20" id="dG8-qs-ZWQ"/>
|
||||
<constraint firstAttribute="width" constant="240" id="wbf-hD-V6a"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.54000000000000004" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="regular14:blackSecondaryText"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="f8D-qe-39W" userLabel="hDivider">
|
||||
<rect key="frame" x="0.0" y="93.5" width="280" height="1"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.12" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="1" id="HTM-C2-dMq"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="Divider"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jAg-cp-4Ms" userLabel="left">
|
||||
<rect key="frame" x="0.0" y="94.5" width="140" height="44"/>
|
||||
<accessibility key="accessibilityConfiguration" identifier="cancelButton"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="140" id="4bW-b0-naB"/>
|
||||
<constraint firstAttribute="height" constant="44" id="RRQ-jI-El3"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<state key="normal" title="left">
|
||||
<color key="titleColor" red="0.090196078430000007" green="0.61960784310000006" blue="0.30196078430000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<state key="highlighted" backgroundImage="dialog_btn_press"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="localizedText" value="ok"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="medium17:linkBlueText"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<action selector="leftButtonTap" destination="iN0-l3-epB" eventType="touchUpInside" id="xE7-aE-OzM"/>
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5H4-oD-Dex" userLabel="vDivider">
|
||||
<rect key="frame" x="139" y="94" width="1" height="44"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.12" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="44" id="8r3-72-asP"/>
|
||||
<constraint firstAttribute="width" constant="1" id="ORs-aP-K10"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="Divider"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="RSB-i6-pEP" userLabel="right">
|
||||
<rect key="frame" x="140" y="94.5" width="140" height="44"/>
|
||||
<accessibility key="accessibilityConfiguration" identifier="OKButton"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="140" id="C3i-gd-pxv"/>
|
||||
<constraint firstAttribute="height" constant="44" id="dta-cI-rDi"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/>
|
||||
<state key="normal" title="right">
|
||||
<color key="titleColor" red="0.090196078430000007" green="0.61960784310000006" blue="0.30196078430000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<state key="highlighted" backgroundImage="dialog_btn_press"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="localizedText" value="ok"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="medium17:linkBlueText"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<action selector="rightButtonTap" destination="iN0-l3-epB" eventType="touchUpInside" id="UO8-7c-q1i"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="0.88" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="Grl-z5-2cE" firstAttribute="top" secondItem="zso-DD-6SG" secondAttribute="top" constant="20" id="5iy-IL-Non"/>
|
||||
<constraint firstAttribute="bottom" secondItem="RSB-i6-pEP" secondAttribute="bottom" id="7PX-qC-iuH"/>
|
||||
<constraint firstItem="jAg-cp-4Ms" firstAttribute="top" secondItem="f8D-qe-39W" secondAttribute="bottom" id="BZX-XF-Cwq"/>
|
||||
<constraint firstItem="RSB-i6-pEP" firstAttribute="top" secondItem="f8D-qe-39W" secondAttribute="bottom" id="FV6-rs-AaS"/>
|
||||
<constraint firstAttribute="width" constant="280" id="H9k-u4-6Xx"/>
|
||||
<constraint firstAttribute="centerX" secondItem="0D6-oV-Lio" secondAttribute="centerX" id="HOk-vG-jd5"/>
|
||||
<constraint firstItem="0D6-oV-Lio" firstAttribute="top" secondItem="Grl-z5-2cE" secondAttribute="bottom" constant="12" id="QBn-bf-ANB"/>
|
||||
<constraint firstAttribute="bottom" secondItem="jAg-cp-4Ms" secondAttribute="bottom" id="QhB-d8-4KJ"/>
|
||||
<constraint firstItem="RSB-i6-pEP" firstAttribute="leading" secondItem="5H4-oD-Dex" secondAttribute="trailing" id="SbQ-E0-P7N"/>
|
||||
<constraint firstAttribute="centerX" secondItem="f8D-qe-39W" secondAttribute="centerX" id="TuK-ia-Gl9"/>
|
||||
<constraint firstItem="f8D-qe-39W" firstAttribute="top" secondItem="0D6-oV-Lio" secondAttribute="bottom" constant="20" id="XWN-lh-LsI"/>
|
||||
<constraint firstAttribute="bottom" secondItem="5H4-oD-Dex" secondAttribute="bottom" constant="0.5" id="el1-Te-FrO"/>
|
||||
<constraint firstAttribute="width" secondItem="f8D-qe-39W" secondAttribute="width" id="rtN-ma-JgY"/>
|
||||
<constraint firstItem="jAg-cp-4Ms" firstAttribute="leading" secondItem="zso-DD-6SG" secondAttribute="leading" id="x4L-bc-J3N"/>
|
||||
<constraint firstAttribute="trailing" secondItem="RSB-i6-pEP" secondAttribute="trailing" id="zAm-vx-0g5"/>
|
||||
<constraint firstAttribute="centerX" secondItem="Grl-z5-2cE" secondAttribute="centerX" id="zap-Oc-W3i"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="AlertView"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="centerY" secondItem="zso-DD-6SG" secondAttribute="centerY" id="2Yk-mx-NtS"/>
|
||||
<constraint firstAttribute="centerX" secondItem="zso-DD-6SG" secondAttribute="centerX" id="rvU-lH-fCc"/>
|
||||
</constraints>
|
||||
<viewLayoutGuide key="safeArea" id="4wG-7A-b6h"/>
|
||||
<connections>
|
||||
<outlet property="dividerTop" destination="XWN-lh-LsI" id="Ken-WZ-bMm"/>
|
||||
<outlet property="leftButton" destination="jAg-cp-4Ms" id="UpD-3H-PmN"/>
|
||||
<outlet property="messageLabel" destination="0D6-oV-Lio" id="1pY-jt-AFL"/>
|
||||
<outlet property="rightButton" destination="RSB-i6-pEP" id="DC9-9z-U2K"/>
|
||||
<outlet property="rightButtonWidth" destination="C3i-gd-pxv" id="YMb-U5-4iJ"/>
|
||||
<outlet property="titleLabel" destination="Grl-z5-2cE" id="p6A-DJ-xjR"/>
|
||||
<outlet property="vDivider" destination="5H4-oD-Dex" id="7xY-ln-bYK"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="305" y="172"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="dialog_btn_press" width="280" height="44"/>
|
||||
</resources>
|
||||
</document>
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
#import "MWMDefaultAlert.h"
|
||||
|
||||
@interface MWMDefaultAlert (Protected)
|
||||
|
||||
+ (nonnull instancetype)defaultAlertWithTitle:(nonnull NSString *)title
|
||||
message:(nullable NSString *)message
|
||||
rightButtonTitle:(nonnull NSString *)rightButtonTitle
|
||||
leftButtonTitle:(nullable NSString *)leftButtonTitle
|
||||
rightButtonAction:(nullable MWMVoidBlock)action
|
||||
log:(nullable NSString *)log;
|
||||
|
||||
@property(copy, nonatomic, readonly, nullable) MWMVoidBlock rightButtonAction;
|
||||
|
||||
@end
|
||||
Loading…
Add table
Add a link
Reference in a new issue