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
ff32d538
Unverified
Commit
ff32d538
authored
Apr 07, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed reload calls where layoutSubviews is sufficient
parent
47afc002
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
42 deletions
+35
-42
Sources/iOS/Bar.swift
+1
-10
Sources/iOS/CollectionViewCard.swift
+17
-14
Sources/iOS/ImageCard.swift
+1
-0
Sources/iOS/Snackbar.swift
+5
-3
Sources/iOS/TabMenuController.swift
+0
-1
Sources/iOS/TextField.swift
+6
-11
Sources/iOS/Toolbar.swift
+5
-3
No files found.
Sources/iOS/Bar.swift
View file @
ff32d538
...
...
@@ -39,7 +39,7 @@ public enum ContentViewAlignment: Int {
open
class
Bar
:
View
{
/// Will layout the view.
open
var
willLayout
:
Bool
{
return
0
<
width
&&
0
<
height
&&
nil
!=
superview
return
0
<
width
&&
0
<
height
&&
nil
!=
superview
&&
!
grid
.
deferred
}
open
override
var
intrinsicContentSize
:
CGSize
{
...
...
@@ -183,15 +183,6 @@ open class Bar: View {
return
}
guard
!
grid
.
deferred
else
{
return
}
reload
()
}
/// Reloads the view.
open
func
reload
()
{
var
lc
=
0
var
rc
=
0
...
...
Sources/iOS/CollectionViewCard.swift
View file @
ff32d538
...
...
@@ -53,19 +53,7 @@ open class CollectionViewCard: Card {
@IBInspectable
open
let
collectionView
=
CollectionView
()
open
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
reload
()
}
open
override
func
prepare
()
{
super
.
prepare
()
pulseAnimation
=
.
none
prepareCollectionView
()
prepareContentView
()
}
/// Reloads the view.
open
override
func
reload
()
{
if
0
==
collectionView
.
height
{
var
h
:
CGFloat
=
0
...
...
@@ -79,7 +67,22 @@ open class CollectionViewCard: Card {
collectionView
.
reloadData
()
super
.
reload
()
super
.
layoutSubviews
()
}
/**
Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepare method
to initialize property values and other setup operations.
The super.prepare method should always be called immediately
when subclassing.
*/
open
override
func
prepare
()
{
super
.
prepare
()
pulseAnimation
=
.
none
prepareCollectionView
()
prepareContentView
()
}
}
...
...
Sources/iOS/ImageCard.swift
View file @
ff32d538
...
...
@@ -82,6 +82,7 @@ open class ImageCard: Card {
}
}
/// Reloads the view.
open
override
func
reload
()
{
var
h
:
CGFloat
=
0
...
...
Sources/iOS/Snackbar.swift
View file @
ff32d538
...
...
@@ -70,9 +70,11 @@ open class Snackbar: Bar {
return
super
.
hitTest
(
point
,
with
:
event
)
}
/// Reloads the view.
open
override
func
reload
()
{
super
.
reload
()
open
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
guard
willLayout
else
{
return
}
centerViews
=
[
textLabel
]
}
...
...
Sources/iOS/TabMenuController.swift
View file @
ff32d538
...
...
@@ -30,7 +30,6 @@
import
UIKit
/// A memory reference to the TabMenuBarItem instance for UIViewController extensions.
fileprivate
var
TabMenuBarItemKey
:
UInt8
=
0
...
...
Sources/iOS/TextField.swift
View file @
ff32d538
...
...
@@ -378,7 +378,12 @@ open class TextField: UITextField {
open
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
layoutShape
()
reload
()
layoutPlaceholderLabel
()
layoutDetailLabel
()
layoutButton
(
button
:
clearIconButton
)
layoutButton
(
button
:
visibilityIconButton
)
layoutDivider
()
layoutLeftView
()
}
open
override
func
becomeFirstResponder
()
->
Bool
{
...
...
@@ -421,16 +426,6 @@ open class TextField: UITextField {
prepareTargetHandlers
()
prepareTextAlignment
()
}
/// Ensures that the components are sized correctly.
open
func
reload
()
{
layoutPlaceholderLabel
()
layoutDetailLabel
()
layoutButton
(
button
:
clearIconButton
)
layoutButton
(
button
:
visibilityIconButton
)
layoutDivider
()
layoutLeftView
()
}
}
extension
TextField
{
...
...
Sources/iOS/Toolbar.swift
View file @
ff32d538
...
...
@@ -95,9 +95,11 @@ open class Toolbar: Bar {
contentViewAlignment
=
.
center
==
titleLabel
.
textAlignment
?
.
center
:
.
full
}
/// Reloads the view.
open
override
func
reload
()
{
super
.
reload
()
open
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
guard
willLayout
else
{
return
}
if
nil
!=
title
&&
""
!=
title
{
if
nil
==
titleLabel
.
superview
{
...
...
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