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
418dc317
Commit
418dc317
authored
May 19, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated ControlViews to use a default expanding frame size
parent
2cd3133e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
100 additions
and
14 deletions
+100
-14
Sources/iOS/BarView.swift
+23
-6
Sources/iOS/ControlView.swift
+12
-2
Sources/iOS/MaterialCollectionViewLayout.swift
+1
-1
Sources/iOS/SearchBar.swift
+32
-5
Sources/iOS/Toolbar.swift
+32
-0
No files found.
Sources/iOS/BarView.swift
View file @
418dc317
...
...
@@ -41,9 +41,27 @@ public class BarView : ControlView {
}
}
/// A convenience initializer.
public
convenience
init
()
{
self
.
init
(
frame
:
CGRectZero
)
/**
An initializer that initializes the object with a NSCoder object.
- Parameter aDecoder: A NSCoder instance.
*/
public
required
init
?(
coder
aDecoder
:
NSCoder
)
{
super
.
init
(
coder
:
aDecoder
)
}
/**
An initializer that initializes the object with a CGRect object.
If AutoLayout is used, it is better to initilize the instance
using the init() initializer.
- Parameter frame: A CGRect instance.
*/
public
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
}
/// Basic initializer.
public
override
init
()
{
super
.
init
()
}
/**
...
...
@@ -51,9 +69,8 @@ public class BarView : ControlView {
- Parameter leftControls: An Array of UIControls that go on the left side.
- Parameter rightControls: An Array of UIControls that go on the right side.
*/
public
convenience
init
?(
leftControls
:
Array
<
UIControl
>
?
=
nil
,
rightControls
:
Array
<
UIControl
>
?
=
nil
)
{
self
.
init
(
frame
:
CGRectZero
)
prepareProperties
(
leftControls
,
rightControls
:
rightControls
)
public
override
init
(
leftControls
:
Array
<
UIControl
>
,
rightControls
:
Array
<
UIControl
>
)
{
super
.
init
(
leftControls
:
leftControls
,
rightControls
:
rightControls
)
}
/**
...
...
Sources/iOS/ControlView.swift
View file @
418dc317
...
...
@@ -118,6 +118,7 @@ public class ControlView : MaterialView {
*/
public
required
init
?(
coder
aDecoder
:
NSCoder
)
{
super
.
init
(
coder
:
aDecoder
)
prepareView
()
}
/**
...
...
@@ -128,6 +129,14 @@ public class ControlView : MaterialView {
*/
public
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
prepareView
()
}
/// Basic initializer.
public
init
()
{
super
.
init
(
frame
:
CGRectZero
)
frame
.
size
=
intrinsicContentSize
()
prepareView
()
}
/**
...
...
@@ -135,8 +144,9 @@ public class ControlView : MaterialView {
- Parameter leftControls: An Array of UIControls that go on the left side.
- Parameter rightControls: An Array of UIControls that go on the right side.
*/
public
convenience
init
?(
leftControls
:
Array
<
UIControl
>
?
=
nil
,
rightControls
:
Array
<
UIControl
>
?
=
nil
)
{
self
.
init
(
frame
:
CGRectZero
)
public
init
(
leftControls
:
Array
<
UIControl
>
,
rightControls
:
Array
<
UIControl
>
)
{
super
.
init
(
frame
:
CGRectZero
)
prepareView
()
prepareProperties
(
leftControls
,
rightControls
:
rightControls
)
}
...
...
Sources/iOS/MaterialCollectionViewLayout.swift
View file @
418dc317
...
...
@@ -110,7 +110,7 @@ public class MaterialCollectionViewLayout : UICollectionViewLayout {
}
public
override
func
shouldInvalidateLayoutForBoundsChange
(
newBounds
:
CGRect
)
->
Bool
{
return
.
Vertical
==
scrollDirection
?
newBounds
.
width
!=
collectionView
!.
bounds
.
width
:
newBounds
.
height
!=
collectionView
!
.
bounds
.
height
return
.
Vertical
==
scrollDirection
?
newBounds
.
width
!=
collectionView
?
.
bounds
.
width
:
newBounds
.
height
!=
collectionView
?
.
bounds
.
height
}
public
override
func
collectionViewContentSize
()
->
CGSize
{
...
...
Sources/iOS/SearchBar.swift
View file @
418dc317
...
...
@@ -85,11 +85,6 @@ public class SearchBar : BarView {
}
}
/// A convenience initializer.
public
convenience
init
()
{
self
.
init
(
frame
:
CGRectZero
)
}
public
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
if
willRenderView
{
...
...
@@ -99,6 +94,38 @@ public class SearchBar : BarView {
}
/**
An initializer that initializes the object with a NSCoder object.
- Parameter aDecoder: A NSCoder instance.
*/
public
required
init
?(
coder
aDecoder
:
NSCoder
)
{
super
.
init
(
coder
:
aDecoder
)
}
/**
An initializer that initializes the object with a CGRect object.
If AutoLayout is used, it is better to initilize the instance
using the init() initializer.
- Parameter frame: A CGRect instance.
*/
public
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
}
/// Basic initializer.
public
override
init
()
{
super
.
init
()
}
/**
A convenience initializer with parameter settings.
- Parameter leftControls: An Array of UIControls that go on the left side.
- Parameter rightControls: An Array of UIControls that go on the right side.
*/
public
override
init
(
leftControls
:
Array
<
UIControl
>
,
rightControls
:
Array
<
UIControl
>
)
{
super
.
init
(
leftControls
:
leftControls
,
rightControls
:
rightControls
)
}
/**
Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method
to initialize property values and other setup operations.
...
...
Sources/iOS/Toolbar.swift
View file @
418dc317
...
...
@@ -57,6 +57,38 @@ public class Toolbar : BarView {
}
/**
An initializer that initializes the object with a NSCoder object.
- Parameter aDecoder: A NSCoder instance.
*/
public
required
init
?(
coder
aDecoder
:
NSCoder
)
{
super
.
init
(
coder
:
aDecoder
)
}
/**
An initializer that initializes the object with a CGRect object.
If AutoLayout is used, it is better to initilize the instance
using the init() initializer.
- Parameter frame: A CGRect instance.
*/
public
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
}
/// Basic initializer.
public
override
init
()
{
super
.
init
()
}
/**
A convenience initializer with parameter settings.
- Parameter leftControls: An Array of UIControls that go on the left side.
- Parameter rightControls: An Array of UIControls that go on the right side.
*/
public
override
init
(
leftControls
:
Array
<
UIControl
>
,
rightControls
:
Array
<
UIControl
>
)
{
super
.
init
(
leftControls
:
leftControls
,
rightControls
:
rightControls
)
}
/**
Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method
to initialize property values and other setup operations.
...
...
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