Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Material
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Material
Commits
55a765cf
Commit
55a765cf
authored
Jun 08, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
progression commit for NavigationBar and statusBar animations
parent
012d5b80
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
35 deletions
+36
-35
Examples/Programmatic/NavigationController/NavigationController.xcodeproj/project.pbxproj
+0
-6
Examples/Programmatic/SideNavigationController/SideNavigationController.xcodeproj/project.pbxproj
+6
-6
Examples/Programmatic/SideNavigationController/SideNavigationController/AppLeftViewController.swift
+1
-1
Material.xcodeproj/project.pbxproj
+1
-1
Sources/iOS/NavigationBar.swift
+10
-9
Sources/iOS/SideNavigationController.swift
+18
-12
No files found.
Examples/Programmatic/NavigationController/NavigationController.xcodeproj/project.pbxproj
View file @
55a765cf
...
...
@@ -11,8 +11,6 @@
965EAD1B1D07274200BFE12C
/* ViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
965EAD1A1D07274200BFE12C
/* ViewController.swift */
;
};
965EAD201D07274200BFE12C
/* Assets.xcassets in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
965EAD1F1D07274200BFE12C
/* Assets.xcassets */
;
};
965EAD231D07274200BFE12C
/* LaunchScreen.storyboard in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
965EAD211D07274200BFE12C
/* LaunchScreen.storyboard */
;
};
965EAD2B1D07285E00BFE12C
/* Material.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
965EAD2A1D07285E00BFE12C
/* Material.framework */
;
};
965EAD2C1D07285E00BFE12C
/* Material.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
965EAD2A1D07285E00BFE12C
/* Material.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
...
...
@@ -22,7 +20,6 @@
dstPath
=
""
;
dstSubfolderSpec
=
10
;
files
=
(
965EAD2C1D07285E00BFE12C
/* Material.framework in Embed Frameworks */
,
);
name
=
"Embed Frameworks"
;
runOnlyForDeploymentPostprocessing
=
0
;
...
...
@@ -36,7 +33,6 @@
965EAD1F1D07274200BFE12C
/* Assets.xcassets */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
folder.assetcatalog
;
path
=
Assets.xcassets
;
sourceTree
=
"<group>"
;
};
965EAD221D07274200BFE12C
/* Base */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file.storyboard
;
name
=
Base
;
path
=
Base.lproj/LaunchScreen.storyboard
;
sourceTree
=
"<group>"
;
};
965EAD241D07274200BFE12C
/* Info.plist */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.plist.xml
;
path
=
Info.plist
;
sourceTree
=
"<group>"
;
};
965EAD2A1D07285E00BFE12C
/* Material.framework */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
name
=
Material.framework
;
path
=
"/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-dciwtavdzrmtrifplxfnouazaqvx/Build/Products/Debug-iphoneos/Material.framework"
;
sourceTree
=
"<absolute>"
;
};
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
...
...
@@ -44,7 +40,6 @@
isa
=
PBXFrameworksBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
965EAD2B1D07285E00BFE12C
/* Material.framework in Frameworks */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
};
...
...
@@ -54,7 +49,6 @@
965EAD0C1D07274200BFE12C
=
{
isa
=
PBXGroup
;
children
=
(
965EAD2A1D07285E00BFE12C
/* Material.framework */
,
965EAD171D07274200BFE12C
/* NavigationController */
,
965EAD161D07274200BFE12C
/* Products */
,
);
...
...
Examples/Programmatic/SideNavigationController/SideNavigationController.xcodeproj/project.pbxproj
View file @
55a765cf
...
...
@@ -7,8 +7,8 @@
objects
=
{
/* Begin PBXBuildFile section */
96
5EAD2F1D072B6E00BFE12C
/* Material.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
965EAD2E1D072B6E00BFE12C
/* Material.framework */
;
};
96
5EAD301D072B6E00BFE12C
/* Material.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
965EAD2E1D072B6E00BFE12C
/* Material.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
96
0CDA3D1D086FE200387CE8
/* Material.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960CDA3C1D086FE200387CE8
/* Material.framework */
;
};
96
0CDA3E1D086FE200387CE8
/* Material.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960CDA3C1D086FE200387CE8
/* Material.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
96E5E4671CC1E5EC0054837B
/* PurpleViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E5E4661CC1E5EC0054837B
/* PurpleViewController.swift */
;
};
96E5E4691CC1E6130054837B
/* OrangeViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E5E4681CC1E6130054837B
/* OrangeViewController.swift */
;
};
96E5E46B1CC1E8FB0054837B
/* AppLeftViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E5E46A1CC1E8FB0054837B
/* AppLeftViewController.swift */
;
};
...
...
@@ -27,7 +27,7 @@
dstPath
=
""
;
dstSubfolderSpec
=
10
;
files
=
(
96
5EAD301D072B6E00BFE12C
/* Material.framework in Embed Frameworks */
,
96
0CDA3E1D086FE200387CE8
/* Material.framework in Embed Frameworks */
,
);
name
=
"Embed Frameworks"
;
runOnlyForDeploymentPostprocessing
=
0
;
...
...
@@ -35,7 +35,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
96
5EAD2E1D072B6E00BFE12C
/* Material.framework */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
name
=
Material.framework
;
path
=
"/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-dciwtavdzrmtrifplxfnouazaqvx/Build/Products/Debug-iphonesimulator
/Material.framework"
;
sourceTree
=
"<absolute>"
;
};
96
0CDA3C1D086FE200387CE8
/* Material.framework */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
name
=
Material.framework
;
path
=
"/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-dciwtavdzrmtrifplxfnouazaqvx/Build/Products/Debug-iphoneos
/Material.framework"
;
sourceTree
=
"<absolute>"
;
};
9663F9651C7ADCB600AF0965
/* SideNavigationController.app */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.application
;
includeInIndex
=
0
;
path
=
SideNavigationController.app
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
96E5E4661CC1E5EC0054837B
/* PurpleViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PurpleViewController.swift
;
sourceTree
=
"<group>"
;
};
96E5E4681CC1E6130054837B
/* OrangeViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
OrangeViewController.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -54,7 +54,7 @@
isa
=
PBXFrameworksBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
96
5EAD2F1D072B6E00BFE12C
/* Material.framework in Frameworks */
,
96
0CDA3D1D086FE200387CE8
/* Material.framework in Frameworks */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
};
...
...
@@ -64,7 +64,7 @@
9663F95C1C7ADCB600AF0965
=
{
isa
=
PBXGroup
;
children
=
(
96
5EAD2E1D072B6E00BFE12C
/* Material.framework */
,
96
0CDA3C1D086FE200387CE8
/* Material.framework */
,
96F2F1FC1C97A68800A5FE27
/* SideNavigationController */
,
9663F9661C7ADCB600AF0965
/* Products */
,
);
...
...
Examples/Programmatic/SideNavigationController/SideNavigationController/AppLeftViewController.swift
View file @
55a765cf
...
...
@@ -75,7 +75,7 @@ class AppLeftViewController: UIViewController {
tableView
.
separatorStyle
=
.
None
// Use Layout to easily align the tableView.
view
.
layout
.
align
(
tableView
)
view
.
layout
.
align
.
edges
(
tableView
)
}
}
...
...
Material.xcodeproj/project.pbxproj
View file @
55a765cf
...
...
@@ -441,7 +441,6 @@
96BCB7961CB40DC500C806FE
/* SearchBarController.swift */
,
96BCB79F1CB40DC500C806FE
/* Toolbar.swift */
,
96BCB7A01CB40DC500C806FE
/* ToolbarController.swift */
,
96BCB7971CB40DC500C806FE
/* SideNavigationController.swift */
,
96BCB78D1CB40DC500C806FE
/* Menu.swift */
,
96BCB78E1CB40DC500C806FE
/* MenuView.swift */
,
96BCB78F1CB40DC500C806FE
/* MenuController.swift */
,
...
...
@@ -451,6 +450,7 @@
96BCB7901CB40DC500C806FE
/* NavigationBar.swift */
,
96BCB7911CB40DC500C806FE
/* NavigationController.swift */
,
96BCB7921CB40DC500C806FE
/* NavigationItem.swift */
,
96BCB7971CB40DC500C806FE
/* SideNavigationController.swift */
,
);
name
=
Navigation
;
sourceTree
=
"<group>"
;
...
...
Sources/iOS/NavigationBar.swift
View file @
55a765cf
...
...
@@ -54,6 +54,8 @@ public class NavigationBar : UINavigationBar {
/// NavigationBarStyle value.
public
var
navigationBarStyle
:
NavigationBarStyle
=
.
Default
internal
var
animating
:
Bool
=
false
/// Will render the view.
public
var
willRenderView
:
Bool
{
return
0
<
width
&&
0
<
height
...
...
@@ -285,19 +287,16 @@ public class NavigationBar : UINavigationBar {
self
.
init
(
frame
:
CGRectZero
)
}
/// Calculates the offset for the statusbar.
private
func
statusbarOffset
()
->
CGFloat
{
var
result
:
CGFloat
=
0
switch
MaterialDevice
.
type
{
case
.
iPad
:
result
=
MaterialDevice
.
statusBarHidden
?
20
:
0
return
MaterialDevice
.
statusBarHidden
?
20
:
0
case
.
iPhone
:
result
=
MaterialDevice
.
isPortrait
&&
MaterialDevice
.
statusBarHidden
?
20
:
0
case
.
TV
:
break
case
.
Unspecified
:
break
return
MaterialDevice
.
isPortrait
&&
MaterialDevice
.
statusBarHidden
?
20
:
0
default
:
return
0
}
return
result
;
}
public
override
func
intrinsicContentSize
()
->
CGSize
{
...
...
@@ -314,6 +313,8 @@ public class NavigationBar : UINavigationBar {
public
override
func
sizeThatFits
(
size
:
CGSize
)
->
CGSize
{
var
result
:
CGSize
=
intrinsicContentSize
()
result
.
height
+=
statusbarOffset
()
print
(
MaterialDevice
.
isPortrait
,
result
.
height
)
return
result
}
...
...
@@ -338,7 +339,7 @@ public class NavigationBar : UINavigationBar {
- Parameter item: A UINavigationItem to layout.
*/
internal
func
layoutNavigationItem
(
item
:
UINavigationItem
)
{
if
willRenderView
{
if
willRenderView
&&
!
animating
{
prepareItem
(
item
)
if
let
titleView
:
UIView
=
prepareTitleView
(
item
)
{
...
...
Sources/iOS/SideNavigationController.swift
View file @
55a765cf
...
...
@@ -400,12 +400,6 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
public
override
func
viewWillTransitionToSize
(
size
:
CGSize
,
withTransitionCoordinator
coordinator
:
UIViewControllerTransitionCoordinator
)
{
super
.
viewWillTransitionToSize
(
size
,
withTransitionCoordinator
:
coordinator
)
// Portrait will be Lanscape when this method is done.
if
MaterialDevice
.
isPortrait
&&
.
iPhone
==
MaterialDevice
.
type
{
hideStatusBar
()
}
else
{
showStatusBar
()
}
closeLeftView
()
closeRightView
()
...
...
@@ -1098,10 +1092,16 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
willHideStatusBar
=
false
UIView
.
animateWithDuration
(
NSTimeInterval
(
UINavigationControllerHideShowBarDuration
),
animations
:
{
[
weak
self
]
in
if
let
v
:
NavigationBar
=
(
self
?
.
rootViewController
as?
NavigationController
)?
.
navigationBar
as?
NavigationBar
{
v
.
animating
=
true
}
self
?
.
statusBarHidden
=
false
})
self
.
setNeedsStatusBarAppearanceUpdate
()
self
?
.
setNeedsStatusBarAppearanceUpdate
()
})
{
[
weak
self
]
_
in
if
let
v
:
NavigationBar
=
(
self
?
.
rootViewController
as?
NavigationController
)?
.
navigationBar
as?
NavigationBar
{
v
.
animating
=
false
}
}
delegate
?
.
sideNavigationStatusBarHiddenState
?(
self
,
hidden
:
false
)
}
}
...
...
@@ -1113,10 +1113,16 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
if
!
statusBarHidden
{
UIView
.
animateWithDuration
(
NSTimeInterval
(
UINavigationControllerHideShowBarDuration
),
animations
:
{
[
weak
self
]
in
if
let
v
:
NavigationBar
=
(
self
?
.
rootViewController
as?
NavigationController
)?
.
navigationBar
as?
NavigationBar
{
v
.
animating
=
true
}
self
?
.
statusBarHidden
=
true
})
self
.
setNeedsStatusBarAppearanceUpdate
()
self
?
.
setNeedsStatusBarAppearanceUpdate
()
})
{
[
weak
self
]
_
in
if
let
v
:
NavigationBar
=
(
self
?
.
rootViewController
as?
NavigationController
)?
.
navigationBar
as?
NavigationBar
{
v
.
animating
=
false
}
}
delegate
?
.
sideNavigationStatusBarHiddenState
?(
self
,
hidden
:
true
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment