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
85b1f715
Unverified
Commit
85b1f715
authored
Sep 03, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: fixed grid calculations for ControlView and Navigation types
parent
838fadf0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
26 deletions
+33
-26
Sources/iOS/ControlView.swift
+2
-2
Sources/iOS/NavigationBar.swift
+4
-4
Sources/iOS/RootController.swift
+0
-1
Sources/iOS/Snackbar.swift
+8
-3
Sources/iOS/TabBar.swift
+19
-16
No files found.
Sources/iOS/ControlView.swift
View file @
85b1f715
...
...
@@ -195,8 +195,6 @@ open class ControlView: View {
grid
.
views
.
append
(
v
)
}
grid
.
commit
()
contentView
.
grid
.
begin
()
if
.
center
==
contentViewAlignment
{
if
lc
<
rc
{
...
...
@@ -209,6 +207,8 @@ open class ControlView: View {
}
else
{
contentView
.
grid
.
columns
=
columns
-
lc
-
rc
}
grid
.
commit
()
contentView
.
grid
.
commit
()
}
}
...
...
Sources/iOS/NavigationBar.swift
View file @
85b1f715
...
...
@@ -230,10 +230,6 @@ open class NavigationBar: UINavigationBar {
item
.
titleView
!.
grid
.
views
.
append
(
v
)
}
item
.
titleView
!.
grid
.
interimSpace
=
interimSpace
item
.
titleView
!.
grid
.
contentEdgeInsets
=
contentEdgeInsets
item
.
titleView
!.
grid
.
commit
()
item
.
contentView
.
grid
.
begin
()
if
.
center
==
item
.
contentViewAlignment
{
if
lc
<
rc
{
...
...
@@ -246,6 +242,10 @@ open class NavigationBar: UINavigationBar {
}
else
{
item
.
contentView
.
grid
.
columns
=
columns
-
lc
-
rc
}
item
.
titleView
!.
grid
.
interimSpace
=
interimSpace
item
.
titleView
!.
grid
.
contentEdgeInsets
=
contentEdgeInsets
item
.
titleView
!.
grid
.
commit
()
item
.
contentView
.
grid
.
commit
()
// contentView alignment.
...
...
Sources/iOS/RootController.swift
View file @
85b1f715
...
...
@@ -176,7 +176,6 @@ open class RootController: UIViewController {
addChildViewController
(
v
)
container
.
addSubview
(
v
.
view
)
v
.
didMove
(
toParentViewController
:
self
)
v
.
view
.
frame
=
container
.
bounds
v
.
view
.
clipsToBounds
=
true
v
.
view
.
autoresizingMask
=
[
.
flexibleWidth
,
.
flexibleHeight
]
v
.
view
.
contentScaleFactor
=
Device
.
scale
...
...
Sources/iOS/Snackbar.swift
View file @
85b1f715
...
...
@@ -77,6 +77,13 @@ open class Snackbar: BarView {
return
super
.
hitTest
(
point
,
with
:
event
)
}
open
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
if
willRenderView
{
textLabel
.
frame
=
contentView
.
bounds
}
}
/**
Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method
...
...
@@ -102,8 +109,6 @@ open class Snackbar: BarView {
textLabel
.
textAlignment
=
.
left
textLabel
.
textColor
=
Color
.
white
textLabel
.
numberOfLines
=
0
contentView
.
backgroundColor
=
Color
.
green
.
base
contentView
.
grid
.
views
.
append
(
textLabel
)
contentView
.
addSubview
(
textLabel
)
}
}
Sources/iOS/TabBar.swift
View file @
85b1f715
...
...
@@ -78,7 +78,7 @@ open class TabBar: BarView {
b
.
removeFromSuperview
()
}
grid
.
views
=
buttons
as
[
UIView
]
contentView
.
grid
.
views
=
buttons
as
[
UIView
]
layoutSubviews
()
}
...
...
@@ -130,25 +130,28 @@ open class TabBar: BarView {
open
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
if
willRenderView
{
if
0
<
buttons
.
count
{
let
columns
:
Int
=
grid
.
axis
.
columns
/
buttons
.
count
for
b
in
buttons
{
b
.
grid
.
columns
=
columns
b
.
contentEdgeInsets
=
.
zero
b
.
layer
.
cornerRadius
=
0
if
isLineAnimated
{
prepareLineAnimationHandler
(
button
:
b
)
}
}
grid
.
reload
()
guard
0
<
buttons
.
count
else
{
return
}
let
columns
:
Int
=
contentView
.
grid
.
axis
.
columns
/
buttons
.
count
for
b
in
buttons
{
b
.
grid
.
columns
=
columns
b
.
contentEdgeInsets
=
.
zero
b
.
cornerRadius
=
0
if
nil
==
selec
ted
{
selected
=
buttons
.
first
if
isLineAnima
ted
{
prepareLineAnimationHandler
(
button
:
b
)
}
}
contentView
.
grid
.
reload
()
line
.
frame
=
CGRect
(
x
:
selected
!.
x
,
y
:
.
bottom
==
lineAlignment
?
height
-
lineHeight
:
0
,
width
:
selected
!.
width
,
height
:
lineHeight
)
if
nil
==
selected
{
selected
=
buttons
.
first
}
}
line
.
frame
=
CGRect
(
x
:
selected
!.
x
,
y
:
.
bottom
==
lineAlignment
?
height
-
lineHeight
:
0
,
width
:
selected
!.
width
,
height
:
lineHeight
)
}
}
/// Handles the button touch event.
...
...
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