Commit bb852d76 by danieldahan

renamed MenuView to MenuLayout

parent fdf87ffa
......@@ -58,9 +58,9 @@
</Group>
<Group
location = "container:"
name = "MenuView">
name = "MenuLayout">
<FileRef
location = "group:Programmatic/MenuView/MenuView.xcodeproj">
location = "group:Programmatic/MenuLayout/MenuLayout.xcodeproj">
</FileRef>
</Group>
<Group
......
......@@ -7,22 +7,22 @@
objects = {
/* Begin PBXBuildFile section */
65FDC3271C6688FD00103AC2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65FDC3261C6688FD00103AC2 /* AppDelegate.swift */; };
65FDC3291C6688FD00103AC2 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65FDC3281C6688FD00103AC2 /* ViewController.swift */; };
65FDC32E1C6688FD00103AC2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 65FDC32D1C6688FD00103AC2 /* Assets.xcassets */; };
65FDC3311C6688FD00103AC2 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 65FDC32F1C6688FD00103AC2 /* LaunchScreen.storyboard */; };
65FDC3391C6689C700103AC2 /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65FDC3381C6689C700103AC2 /* Material.framework */; };
65FDC33A1C6689C700103AC2 /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 65FDC3381C6689C700103AC2 /* Material.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
65FDC34C1C68283700103AC2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65FDC34B1C68283700103AC2 /* AppDelegate.swift */; };
65FDC34E1C68283700103AC2 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65FDC34D1C68283700103AC2 /* ViewController.swift */; };
65FDC3531C68283700103AC2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 65FDC3521C68283700103AC2 /* Assets.xcassets */; };
65FDC3561C68283700103AC2 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 65FDC3541C68283700103AC2 /* LaunchScreen.storyboard */; };
65FDC35E1C6828CB00103AC2 /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65FDC35D1C6828CB00103AC2 /* Material.framework */; };
65FDC35F1C6828CB00103AC2 /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 65FDC35D1C6828CB00103AC2 /* Material.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
65FDC33B1C6689C700103AC2 /* Embed Frameworks */ = {
65FDC3601C6828CB00103AC2 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
65FDC33A1C6689C700103AC2 /* Material.framework in Embed Frameworks */,
65FDC35F1C6828CB00103AC2 /* Material.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
......@@ -30,93 +30,93 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
65FDC3231C6688FD00103AC2 /* MenuView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MenuView.app; sourceTree = BUILT_PRODUCTS_DIR; };
65FDC3261C6688FD00103AC2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
65FDC3281C6688FD00103AC2 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
65FDC32D1C6688FD00103AC2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
65FDC3301C6688FD00103AC2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
65FDC3321C6688FD00103AC2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
65FDC3381C6689C700103AC2 /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Material.framework; path = "/Users/daniel/Library/Developer/Xcode/DerivedData/Material-etnffhlwlhnmksdcgwmofzanjczp/Build/Products/Debug-iphoneos/Material.framework"; sourceTree = "<absolute>"; };
65FDC3481C68283700103AC2 /* MenuLayout.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MenuLayout.app; sourceTree = BUILT_PRODUCTS_DIR; };
65FDC34B1C68283700103AC2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
65FDC34D1C68283700103AC2 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
65FDC3521C68283700103AC2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
65FDC3551C68283700103AC2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
65FDC3571C68283700103AC2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
65FDC35D1C6828CB00103AC2 /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Material.framework; path = "/Users/daniel/Library/Developer/Xcode/DerivedData/Material-etnffhlwlhnmksdcgwmofzanjczp/Build/Products/Debug-iphoneos/Material.framework"; sourceTree = "<absolute>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
65FDC3201C6688FD00103AC2 /* Frameworks */ = {
65FDC3451C68283700103AC2 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
65FDC3391C6689C700103AC2 /* Material.framework in Frameworks */,
65FDC35E1C6828CB00103AC2 /* Material.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
65FDC31A1C6688FD00103AC2 = {
65FDC33F1C68283700103AC2 = {
isa = PBXGroup;
children = (
65FDC3381C6689C700103AC2 /* Material.framework */,
65FDC3251C6688FD00103AC2 /* MenuView */,
65FDC3241C6688FD00103AC2 /* Products */,
65FDC35D1C6828CB00103AC2 /* Material.framework */,
65FDC34A1C68283700103AC2 /* MenuLayout */,
65FDC3491C68283700103AC2 /* Products */,
);
sourceTree = "<group>";
};
65FDC3241C6688FD00103AC2 /* Products */ = {
65FDC3491C68283700103AC2 /* Products */ = {
isa = PBXGroup;
children = (
65FDC3231C6688FD00103AC2 /* MenuView.app */,
65FDC3481C68283700103AC2 /* MenuLayout.app */,
);
name = Products;
sourceTree = "<group>";
};
65FDC3251C6688FD00103AC2 /* MenuView */ = {
65FDC34A1C68283700103AC2 /* MenuLayout */ = {
isa = PBXGroup;
children = (
65FDC3261C6688FD00103AC2 /* AppDelegate.swift */,
65FDC3281C6688FD00103AC2 /* ViewController.swift */,
65FDC32D1C6688FD00103AC2 /* Assets.xcassets */,
65FDC32F1C6688FD00103AC2 /* LaunchScreen.storyboard */,
65FDC3321C6688FD00103AC2 /* Info.plist */,
65FDC34B1C68283700103AC2 /* AppDelegate.swift */,
65FDC34D1C68283700103AC2 /* ViewController.swift */,
65FDC3521C68283700103AC2 /* Assets.xcassets */,
65FDC3541C68283700103AC2 /* LaunchScreen.storyboard */,
65FDC3571C68283700103AC2 /* Info.plist */,
);
path = MenuView;
path = MenuLayout;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
65FDC3221C6688FD00103AC2 /* MenuView */ = {
65FDC3471C68283700103AC2 /* MenuLayout */ = {
isa = PBXNativeTarget;
buildConfigurationList = 65FDC3351C6688FD00103AC2 /* Build configuration list for PBXNativeTarget "MenuView" */;
buildConfigurationList = 65FDC35A1C68283700103AC2 /* Build configuration list for PBXNativeTarget "MenuLayout" */;
buildPhases = (
65FDC31F1C6688FD00103AC2 /* Sources */,
65FDC3201C6688FD00103AC2 /* Frameworks */,
65FDC3211C6688FD00103AC2 /* Resources */,
65FDC33B1C6689C700103AC2 /* Embed Frameworks */,
65FDC3441C68283700103AC2 /* Sources */,
65FDC3451C68283700103AC2 /* Frameworks */,
65FDC3461C68283700103AC2 /* Resources */,
65FDC3601C6828CB00103AC2 /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = MenuView;
productName = MenuView;
productReference = 65FDC3231C6688FD00103AC2 /* MenuView.app */;
name = MenuLayout;
productName = MenuLayout;
productReference = 65FDC3481C68283700103AC2 /* MenuLayout.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
65FDC31B1C6688FD00103AC2 /* Project object */ = {
65FDC3401C68283700103AC2 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0720;
ORGANIZATIONNAME = "CosmicMind, Inc.";
TargetAttributes = {
65FDC3221C6688FD00103AC2 = {
65FDC3471C68283700103AC2 = {
CreatedOnToolsVersion = 7.2;
};
};
};
buildConfigurationList = 65FDC31E1C6688FD00103AC2 /* Build configuration list for PBXProject "MenuView" */;
buildConfigurationList = 65FDC3431C68283700103AC2 /* Build configuration list for PBXProject "MenuLayout" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
......@@ -124,45 +124,45 @@
en,
Base,
);
mainGroup = 65FDC31A1C6688FD00103AC2;
productRefGroup = 65FDC3241C6688FD00103AC2 /* Products */;
mainGroup = 65FDC33F1C68283700103AC2;
productRefGroup = 65FDC3491C68283700103AC2 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
65FDC3221C6688FD00103AC2 /* MenuView */,
65FDC3471C68283700103AC2 /* MenuLayout */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
65FDC3211C6688FD00103AC2 /* Resources */ = {
65FDC3461C68283700103AC2 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
65FDC3311C6688FD00103AC2 /* LaunchScreen.storyboard in Resources */,
65FDC32E1C6688FD00103AC2 /* Assets.xcassets in Resources */,
65FDC3561C68283700103AC2 /* LaunchScreen.storyboard in Resources */,
65FDC3531C68283700103AC2 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
65FDC31F1C6688FD00103AC2 /* Sources */ = {
65FDC3441C68283700103AC2 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
65FDC3291C6688FD00103AC2 /* ViewController.swift in Sources */,
65FDC3271C6688FD00103AC2 /* AppDelegate.swift in Sources */,
65FDC34E1C68283700103AC2 /* ViewController.swift in Sources */,
65FDC34C1C68283700103AC2 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
65FDC32F1C6688FD00103AC2 /* LaunchScreen.storyboard */ = {
65FDC3541C68283700103AC2 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
65FDC3301C6688FD00103AC2 /* Base */,
65FDC3551C68283700103AC2 /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
......@@ -170,7 +170,7 @@
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
65FDC3331C6688FD00103AC2 /* Debug */ = {
65FDC3581C68283700103AC2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
......@@ -215,7 +215,7 @@
};
name = Debug;
};
65FDC3341C6688FD00103AC2 /* Release */ = {
65FDC3591C68283700103AC2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
......@@ -253,24 +253,24 @@
};
name = Release;
};
65FDC3361C6688FD00103AC2 /* Debug */ = {
65FDC35B1C68283700103AC2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = MenuView/Info.plist;
INFOPLIST_FILE = MenuLayout/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.MenuView;
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.MenuLayout;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
65FDC3371C6688FD00103AC2 /* Release */ = {
65FDC35C1C68283700103AC2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = MenuView/Info.plist;
INFOPLIST_FILE = MenuLayout/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.MenuView;
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.MenuLayout;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
......@@ -278,25 +278,25 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
65FDC31E1C6688FD00103AC2 /* Build configuration list for PBXProject "MenuView" */ = {
65FDC3431C68283700103AC2 /* Build configuration list for PBXProject "MenuLayout" */ = {
isa = XCConfigurationList;
buildConfigurations = (
65FDC3331C6688FD00103AC2 /* Debug */,
65FDC3341C6688FD00103AC2 /* Release */,
65FDC3581C68283700103AC2 /* Debug */,
65FDC3591C68283700103AC2 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
65FDC3351C6688FD00103AC2 /* Build configuration list for PBXNativeTarget "MenuView" */ = {
65FDC35A1C68283700103AC2 /* Build configuration list for PBXNativeTarget "MenuLayout" */ = {
isa = XCConfigurationList;
buildConfigurations = (
65FDC3361C6688FD00103AC2 /* Debug */,
65FDC3371C6688FD00103AC2 /* Release */,
65FDC35B1C68283700103AC2 /* Debug */,
65FDC35C1C68283700103AC2 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 65FDC31B1C6688FD00103AC2 /* Project object */;
rootObject = 65FDC3401C68283700103AC2 /* Project object */;
}
......@@ -2,6 +2,6 @@
<Workspace
version = "1.0">
<FileRef
location = "self:MenuView.xcodeproj">
location = "self:MenuLayout.xcodeproj">
</FileRef>
</Workspace>
......@@ -59,6 +59,7 @@ class ViewController: UIViewController {
if menuLayout.opened {
menuLayout.close()
} else {
// (menuLayout.items?.first?.button as? MaterialButton)?.animate(MaterialAnimation.rotate(1))
menuLayout.open() { (item: MenuLayoutItem) in
(item.button as? MaterialButton)?.pulse()
}
......@@ -78,36 +79,36 @@ class ViewController: UIViewController {
let image: UIImage? = UIImage(named: "ic_add_white")
let btn1: FabButton = FabButton()
btn1.depth = .None
btn1.depth = .Depth1
btn1.setImage(image, forState: .Normal)
btn1.setImage(image, forState: .Highlighted)
btn1.addTarget(self, action: "handleOpenMenuLayout", forControlEvents: .TouchUpInside)
view.addSubview(btn1)
let btn2: FabButton = FabButton()
btn2.depth = .None
btn2.depth = .Depth1
btn2.backgroundColor = MaterialColor.blue.base
btn2.setImage(image, forState: .Normal)
btn2.setImage(image, forState: .Highlighted)
view.addSubview(btn2)
let btn3: FabButton = FabButton()
btn3.depth = .None
btn3.depth = .Depth1
btn3.backgroundColor = MaterialColor.green.base
btn3.setImage(image, forState: .Normal)
btn3.setImage(image, forState: .Highlighted)
view.addSubview(btn3)
let btn4: FabButton = FabButton()
btn4.depth = .None
btn4.depth = .Depth1
btn4.backgroundColor = MaterialColor.yellow.base
btn4.setImage(image, forState: .Normal)
btn4.setImage(image, forState: .Highlighted)
view.addSubview(btn4)
menuLayout = MenuLayout()
menuLayout.baseSize = CGSizeMake(48, 48)
menuLayout.itemSize = CGSizeMake(36, 36)
menuLayout.baseSize = CGSizeMake(56, 56)
menuLayout.itemSize = CGSizeMake(48, 48)
menuLayout.items = [
MenuLayoutItem(button: btn1),
......
......@@ -391,9 +391,9 @@
96D88C541C132A7700B91418 /* Navigation */ = {
isa = PBXGroup;
children = (
65FDC2EA1C66858A00103AC2 /* MenuLayout.swift */,
96D88C151C1328D800B91418 /* NavigationBarView.swift */,
96D88C1D1C1328D800B91418 /* SideNavigationViewController.swift */,
65FDC2EA1C66858A00103AC2 /* MenuLayout.swift */,
);
name = Navigation;
sourceTree = "<group>";
......
......@@ -407,7 +407,7 @@ public class CardView : MaterialPulseView {
public override func prepareView() {
super.prepareView()
pulseColor = MaterialColor.blueGrey.lighten4
depth = .Depth2
depth = .Depth1
dividerColor = MaterialColor.blueGrey.lighten5
}
......
......@@ -41,7 +41,7 @@ public class FabButton : MaterialButton {
public override func prepareView() {
super.prepareView()
backgroundColor = MaterialColor.red.darken1
depth = .Depth2
depth = .Depth1
shape = .Circle
}
}
\ No newline at end of file
......@@ -544,7 +544,7 @@ public class ImageCardView : MaterialPulseView {
public override func prepareView() {
super.prepareView()
pulseColor = MaterialColor.blueGrey.lighten4
depth = .Depth2
depth = .Depth1
dividerColor = MaterialColor.blueGrey.lighten5
}
......
......@@ -64,6 +64,9 @@ public class MenuLayout {
/// A Boolean that indicates if the menu is open or not.
public private(set) var opened: Bool = false
/// Animation duration.
public var duration: Double = 0.07
/// The position of the menu.
public var position: MenuLayoutPosition = .BottomRight {
didSet {
......@@ -90,6 +93,7 @@ public class MenuLayout {
}
public func reloadLayout() {
opened = false
switch position {
case .TopLeft:
layoutTopLeft()
......@@ -137,7 +141,7 @@ public class MenuLayout {
}
let item: MenuLayoutItem = v[i]
item.button.hidden = false
UIView.animateWithDuration(Double(i) * 0.15,
UIView.animateWithDuration(Double(i) * duration,
animations: { [unowned self] in
item.button.alpha = 1
item.button.frame.origin.y = base!.button.frame.origin.y - CGFloat(i) * self.itemSize.height - CGFloat(i) * 16
......@@ -154,7 +158,7 @@ public class MenuLayout {
if let v: Array<MenuLayoutItem> = items {
for var i: Int = 1, l: Int = v.count; i < l; ++i {
let item: MenuLayoutItem = v[i]
UIView.animateWithDuration(0.15,
UIView.animateWithDuration(Double(i) * duration,
animations: { [unowned self] in
item.button.alpha = 0
item.button.frame.origin.y = self.height - item.button.bounds.height - 16
......@@ -177,7 +181,7 @@ public class MenuLayout {
}
let item: MenuLayoutItem = v[i]
item.button.hidden = false
UIView.animateWithDuration(Double(i) * 0.15,
UIView.animateWithDuration(Double(i) * duration,
animations: { [unowned self] in
item.button.alpha = 1
item.button.frame.origin.y = base!.button.frame.origin.y + self.baseSize.height + CGFloat(i - 1) * self.itemSize.height + CGFloat(i) * 16
......@@ -194,7 +198,7 @@ public class MenuLayout {
if let v: Array<MenuLayoutItem> = items {
for var i: Int = 1, l: Int = v.count; i < l; ++i {
let item: MenuLayoutItem = v[i]
UIView.animateWithDuration(0.15,
UIView.animateWithDuration(Double(i) * duration,
animations: {
item.button.alpha = 0
item.button.frame.origin.y = 16
......@@ -217,7 +221,7 @@ public class MenuLayout {
}
let item: MenuLayoutItem = v[i]
item.button.hidden = false
UIView.animateWithDuration(Double(i) * 0.15,
UIView.animateWithDuration(Double(i) * duration,
animations: { [unowned self] in
item.button.alpha = 1
item.button.frame.origin.x = base!.button.frame.origin.x - CGFloat(i) * self.itemSize.width - CGFloat(i) * 16
......@@ -234,7 +238,7 @@ public class MenuLayout {
if let v: Array<MenuLayoutItem> = items {
for var i: Int = 1, l: Int = v.count; i < l; ++i {
let item: MenuLayoutItem = v[i]
UIView.animateWithDuration(0.15,
UIView.animateWithDuration(Double(i) * duration,
animations: { [unowned self] in
item.button.alpha = 0
item.button.frame.origin.x = self.width - item.button.bounds.width - 16
......@@ -257,7 +261,7 @@ public class MenuLayout {
}
let item: MenuLayoutItem = v[i]
item.button.hidden = false
UIView.animateWithDuration(Double(i) * 0.15,
UIView.animateWithDuration(Double(i) * duration,
animations: { [unowned self] in
item.button.alpha = 1
item.button.frame.origin.x = base!.button.frame.origin.x + self.baseSize.width + CGFloat(i - 1) * self.itemSize.width + CGFloat(i) * 16
......@@ -274,7 +278,7 @@ public class MenuLayout {
if let v: Array<MenuLayoutItem> = items {
for var i: Int = 1, l: Int = v.count; i < l; ++i {
let item: MenuLayoutItem = v[i]
UIView.animateWithDuration(0.15,
UIView.animateWithDuration(Double(i) * duration,
animations: {
item.button.alpha = 0
item.button.frame.origin.x = 16
......
......@@ -332,7 +332,7 @@ public class NavigationBarView : MaterialView {
*/
public override func prepareView() {
super.prepareView()
depth = .Depth2
depth = .Depth1
}
/**
......
......@@ -42,7 +42,7 @@ public class RaisedButton : MaterialButton {
super.prepareView()
setTitleColor(MaterialColor.white, forState: .Normal)
backgroundColor = MaterialColor.blue.accent3
depth = .Depth2
depth = .Depth1
cornerRadius = .Radius1
contentInsetPreset = .WideRectangle3
}
......
......@@ -234,7 +234,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
A MaterialDepth property that is used to set the depth of the
leftView when opened.
*/
public var depth: MaterialDepth = .Depth2
public var depth: MaterialDepth = .Depth1
/**
A MaterialView property that is used to hide and reveal the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment