Commit bb852d76 by danieldahan

renamed MenuView to MenuLayout

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