[ios] Updated action bar buttons.

This commit is contained in:
Ilya Grechuhin 2015-07-29 10:20:48 +03:00 committed by Alex Zolotarev
parent 0dbeb5eb16
commit b6877acd1f
310 changed files with 411 additions and 29 deletions

View file

@ -6,17 +6,17 @@
// Copyright (c) 2015 MapsWithMe. All rights reserved.
//
#import "MWMPlacePageActionBar.h"
#import "MWMPlacePage.h"
#import "MWMBasePlacePageView.h"
#import "MWMPlacePageViewManager.h"
#import "MWMPlacePageEntity.h"
#import "UIKitCategories.h"
#import "MapsAppDelegate.h"
#import "MWMBasePlacePageView.h"
#import "MWMPlacePage.h"
#import "MWMPlacePageActionBar.h"
#import "MWMPlacePageEntity.h"
#import "MWMPlacePageViewManager.h"
#import "UIKitCategories.h"
#include "Framework.h"
#import "../../3party/Alohalytics/src/alohalytics_objc.h"
#import "3party/Alohalytics/src/alohalytics_objc.h"
extern NSString * const kAlohalyticsTapEventKey;
static NSString * const kPlacePageActionBarNibName = @"PlacePageActionBar";
@ -45,20 +45,41 @@ static NSString * const kPlacePageActionBarNibName = @"PlacePageActionBar";
BOOL const isPedestrian = GetFramework().GetRouter() == routing::RouterType::Pedestrian;
NSString * routeImageName = isPedestrian ? @"ic_route_walk" : @"ic_route";
[bar.routeButton setImage:[UIImage imageNamed:routeImageName] forState:UIControlStateNormal];
[self setupBookmarkButton:(MWMPlacePageActionBar *)bar];
return bar;
}
+ (void)setupBookmarkButton:(MWMPlacePageActionBar *)bar
{
UIButton * btn = bar.bookmarkButton;
[btn setImage:[UIImage imageNamed:@"ic_bookmarks_on"] forState:UIControlStateHighlighted|UIControlStateSelected];
[btn setImage:[UIImage imageNamed:@"ic_bookmarks_off_pressed"] forState:UIControlStateHighlighted];
NSUInteger const animationImagesCount = 11;
NSMutableArray * animationImages = [NSMutableArray arrayWithCapacity:animationImagesCount];
for (NSUInteger i = 0; i < animationImagesCount; ++i)
animationImages[i] = [UIImage imageNamed:[NSString stringWithFormat:@"ic_bookmarks_%@", @(i+1)]];
UIImageView * animationIV = btn.imageView;
animationIV.animationImages = animationImages;
animationIV.animationRepeatCount = 1;
}
- (IBAction)bookmarkTap:(UIButton *)sender
{
sender.selected = !sender.selected;
NSMutableString * eventName = @"ppBookmarkButtonTap".mutableCopy;
if (sender.selected)
{
[sender.imageView startAnimating];
self.bookmarkLabel.text = L(@"delete");
[self.placePage addBookmark];
[eventName appendString:@"Add"];
}
else
{
self.bookmarkLabel.text = L(@"save");
[self.placePage removeBookmark];
[eventName appendString:@"Delete"];
}

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7702" systemVersion="14D131" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14E46" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
@ -11,21 +11,23 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="58"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="Jtm-w6-q1e">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="Jtm-w6-q1e" userLabel="ShareButton">
<rect key="frame" x="18" y="0.0" width="83" height="46"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES"/>
<state key="normal" image="ic_share">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted" image="ic_share_pressed"/>
<connections>
<action selector="shareTap" destination="iN0-l3-epB" eventType="touchUpInside" id="PGT-Ie-Gmr"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="66j-hn-azO">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="66j-hn-azO" userLabel="SaveButton">
<rect key="frame" x="118" y="0.0" width="83" height="46"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES"/>
<state key="normal" title="" image="ic_bookmark_off"/>
<state key="selected" image="ic_bookmark_on"/>
<state key="normal" title="" image="ic_bookmarks_off"/>
<state key="selected" image="ic_bookmarks_on"/>
<state key="highlighted" image="ic_bookmarks_off_pressed"/>
<connections>
<action selector="bookmarkTap:" destination="iN0-l3-epB" eventType="touchUpInside" id="sTn-J9-JAv"/>
</connections>
@ -34,30 +36,36 @@
<rect key="frame" x="22" y="38" width="75" height="13"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="10"/>
<color key="textColor" red="0.094117647058823528" green="0.61960784313725492" blue="0.30588235294117649" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.54000000000000004" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="localizedText" value="share"/>
<userDefinedRuntimeAttribute type="string" keyPath="colorName" value="blackSecondaryText"/>
<userDefinedRuntimeAttribute type="string" keyPath="fontName" value="regular10"/>
</userDefinedRuntimeAttributes>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Bookmark" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="niS-Il-TNU">
<label opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Save" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="niS-Il-TNU">
<rect key="frame" x="122" y="37" width="75" height="13"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="10"/>
<color key="textColor" red="0.094117647060000004" green="0.61960784310000006" blue="0.30588235289999999" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.54000000000000004" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="localizedText" value="dropped_pin"/>
<userDefinedRuntimeAttribute type="string" keyPath="localizedText" value="save"/>
<userDefinedRuntimeAttribute type="string" keyPath="colorName" value="blackSecondaryText"/>
<userDefinedRuntimeAttribute type="string" keyPath="fontName" value="regular10"/>
</userDefinedRuntimeAttributes>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Route" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="OOE-NW-gUw">
<rect key="frame" x="225" y="37" width="75" height="13"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="10"/>
<color key="textColor" red="0.094117647060000004" green="0.61960784310000006" blue="0.30588235289999999" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.54000000000000004" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="localizedText" value="route"/>
<userDefinedRuntimeAttribute type="string" keyPath="colorName" value="blackSecondaryText"/>
<userDefinedRuntimeAttribute type="string" keyPath="fontName" value="regular10"/>
</userDefinedRuntimeAttributes>
</label>
<view contentMode="scaleToFill" id="8aC-eJ-egB">
@ -65,19 +73,24 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.12" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="6cp-1o-ehc">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="6cp-1o-ehc" userLabel="RouteButton">
<rect key="frame" x="221" y="0.0" width="83" height="46"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES"/>
<state key="normal" image="ic_route">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted" image="ic_route_pressed"/>
<connections>
<action selector="routeTap" destination="iN0-l3-epB" eventType="touchUpInside" id="mAp-BH-2qW"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="0.96078431372549022" green="0.96078431372549022" blue="0.96078431372549022" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="backgroundColorName" value="pressBackground"/>
</userDefinedRuntimeAttributes>
<connections>
<outlet property="bookmarkButton" destination="66j-hn-azO" id="uBJ-zf-YgW"/>
<outlet property="bookmarkLabel" destination="niS-Il-TNU" id="q0I-39-OWe"/>
@ -90,10 +103,13 @@
</view>
</objects>
<resources>
<image name="ic_bookmark_off" width="24" height="23"/>
<image name="ic_bookmark_on" width="24" height="23"/>
<image name="ic_route" width="24" height="23"/>
<image name="ic_share" width="24" height="23"/>
<image name="ic_bookmarks_off" width="24" height="24"/>
<image name="ic_bookmarks_off_pressed" width="22" height="20"/>
<image name="ic_bookmarks_on" width="24" height="24"/>
<image name="ic_route" width="24" height="24"/>
<image name="ic_route_pressed" width="22" height="22"/>
<image name="ic_share" width="24" height="24"/>
<image name="ic_share_pressed" width="18" height="20"/>
</resources>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 816 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View file

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View file

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View file

@ -3,17 +3,17 @@
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "ic_bookmark_on.png"
"filename" : "ic_bookmarks_1.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "ic_bookmark_on@2x.png"
"filename" : "ic_bookmarks_1@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x",
"filename" : "ic_bookmark_on@3x.png"
"filename" : "ic_bookmarks_1@3x.png"
}
],
"info" : {

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 B

View file

@ -3,17 +3,17 @@
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "ic_bookmark_off.png"
"filename" : "ic_bookmarks_10.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "ic_bookmark_off@2x.png"
"filename" : "ic_bookmarks_10@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x",
"filename" : "ic_bookmark_off@3x.png"
"filename" : "ic_bookmarks_10@3x.png"
}
],
"info" : {

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 750 B

View file

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "ic_bookmarks_12.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "ic_bookmarks_12@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x",
"filename" : "ic_bookmarks_12@3x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 784 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "ic_bookmarks_2.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "ic_bookmarks_2@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x",
"filename" : "ic_bookmarks_2@3x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

View file

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "ic_bookmarks_3.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "ic_bookmarks_3@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x",
"filename" : "ic_bookmarks_3@3x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

View file

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "ic_bookmarks_4.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "ic_bookmarks_4@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x",
"filename" : "ic_bookmarks_4@3x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

View file

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "ic_bookmarks_5.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "ic_bookmarks_5@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x",
"filename" : "ic_bookmarks_5@3x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

View file

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "ic_bookmarks_6.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "ic_bookmarks_6@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x",
"filename" : "ic_bookmarks_6@3x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

View file

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "ic_bookmarks_7.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "ic_bookmarks_7@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x",
"filename" : "ic_bookmarks_7@3x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 B

View file

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "ic_bookmarks_8.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "ic_bookmarks_8@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x",
"filename" : "ic_bookmarks_8@3x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 804 B

View file

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "ic_bookmarks_9.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "ic_bookmarks_9@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x",
"filename" : "ic_bookmarks_9@3x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 964 B

Some files were not shown because too many files have changed in this diff Show more