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
4d61e3f8
Commit
4d61e3f8
authored
Aug 08, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed TabsController to TabBarController
parent
0de308b9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
131 additions
and
94 deletions
+131
-94
Material.xcodeproj/project.pbxproj
+0
-0
Sources/iOS/ChipBar.swift
+16
-16
Sources/iOS/ChipBarController.swift
+105
-0
Sources/iOS/FABButton.swift
+0
-7
Sources/iOS/FlatButton.swift
+0
-7
Sources/iOS/IconButton.swift
+1
-8
Sources/iOS/RaisedButton.swift
+0
-7
Sources/iOS/SearchBar.swift
+0
-7
Sources/iOS/SearchBarController.swift
+0
-7
Sources/iOS/StatusBarController.swift
+0
-12
Sources/iOS/TabBar.swift
+1
-1
Sources/iOS/TabBarController.swift
+8
-8
Sources/iOS/Toolbar.swift
+0
-7
Sources/iOS/ToolbarController.swift
+0
-7
No files found.
Material.xcodeproj/project.pbxproj
View file @
4d61e3f8
This diff is collapsed.
Click to expand it.
Sources/iOS/Chip
s
.swift
→
Sources/iOS/Chip
Bar
.swift
View file @
4d61e3f8
...
@@ -84,36 +84,36 @@ fileprivate extension ChipItem {
...
@@ -84,36 +84,36 @@ fileprivate extension ChipItem {
}
}
}
}
@objc(Chip
s
Delegate)
@objc(Chip
Bar
Delegate)
public
protocol
Chip
s
Delegate
{
public
protocol
Chip
Bar
Delegate
{
/**
/**
A delegation method that is executed when the chipItem will trigger the
A delegation method that is executed when the chipItem will trigger the
animation to the next chip.
animation to the next chip.
- Parameter chipBar: A Chip
s
.
- Parameter chipBar: A Chip
Bar
.
- Parameter chipItem: A ChipItem.
- Parameter chipItem: A ChipItem.
*/
*/
@objc
@objc
optional
func
chipBar
(
chipBar
:
Chip
s
,
willSelect
chipItem
:
ChipItem
)
optional
func
chipBar
(
chipBar
:
Chip
Bar
,
willSelect
chipItem
:
ChipItem
)
/**
/**
A delegation method that is executed when the chipItem did complete the
A delegation method that is executed when the chipItem did complete the
animation to the next chip.
animation to the next chip.
- Parameter chipBar: A Chip
s
.
- Parameter chipBar: A Chip
Bar
.
- Parameter chipItem: A ChipItem.
- Parameter chipItem: A ChipItem.
*/
*/
@objc
@objc
optional
func
chipBar
(
chipBar
:
Chip
s
,
didSelect
chipItem
:
ChipItem
)
optional
func
chipBar
(
chipBar
:
Chip
Bar
,
didSelect
chipItem
:
ChipItem
)
}
}
@objc(Chip
s
Style)
@objc(Chip
Bar
Style)
public
enum
Chip
s
Style
:
Int
{
public
enum
Chip
Bar
Style
:
Int
{
case
auto
case
auto
case
nonScrollable
case
nonScrollable
case
scrollable
case
scrollable
}
}
open
class
Chip
s
:
Bar
{
open
class
Chip
Bar
:
Bar
{
/// A boolean indicating if the Chip
s line
is in an animation state.
/// A boolean indicating if the Chip
Bar
is in an animation state.
open
fileprivate
(
set
)
var
isAnimating
=
false
open
fileprivate
(
set
)
var
isAnimating
=
false
/// The total width of the chipItems.
/// The total width of the chipItems.
...
@@ -128,7 +128,7 @@ open class Chips: Bar {
...
@@ -128,7 +128,7 @@ open class Chips: Bar {
}
}
/// An enum that determines the chip bar style.
/// An enum that determines the chip bar style.
open
var
chipBarStyle
=
Chip
s
Style
.
auto
{
open
var
chipBarStyle
=
Chip
Bar
Style
.
auto
{
didSet
{
didSet
{
layoutSubviews
()
layoutSubviews
()
}
}
...
@@ -148,7 +148,7 @@ open class Chips: Bar {
...
@@ -148,7 +148,7 @@ open class Chips: Bar {
}
}
/// A delegation reference.
/// A delegation reference.
open
weak
var
delegate
:
Chip
s
Delegate
?
open
weak
var
delegate
:
Chip
Bar
Delegate
?
/// The currently selected chipItem.
/// The currently selected chipItem.
open
fileprivate
(
set
)
var
selected
:
ChipItem
?
open
fileprivate
(
set
)
var
selected
:
ChipItem
?
...
@@ -330,7 +330,7 @@ open class Chips: Bar {
...
@@ -330,7 +330,7 @@ open class Chips: Bar {
}
}
}
}
fileprivate
extension
Chip
s
{
fileprivate
extension
Chip
Bar
{
/// Prepares the divider.
/// Prepares the divider.
func
prepareDivider
()
{
func
prepareDivider
()
{
dividerColor
=
Color
.
grey
.
lighten3
dividerColor
=
Color
.
grey
.
lighten3
...
@@ -362,7 +362,7 @@ fileprivate extension Chips {
...
@@ -362,7 +362,7 @@ fileprivate extension Chips {
}
}
}
}
fileprivate
extension
Chip
s
{
fileprivate
extension
Chip
Bar
{
/// Handles the chipItem touch event.
/// Handles the chipItem touch event.
@objc
@objc
func
handle
(
chipItem
:
ChipItem
)
{
func
handle
(
chipItem
:
ChipItem
)
{
...
@@ -370,7 +370,7 @@ fileprivate extension Chips {
...
@@ -370,7 +370,7 @@ fileprivate extension Chips {
}
}
}
}
extension
Chip
s
{
extension
Chip
Bar
{
/**
/**
Selects a given index from the chipItems array.
Selects a given index from the chipItems array.
- Parameter at index: An Int.
- Parameter at index: An Int.
...
@@ -393,7 +393,7 @@ extension Chips {
...
@@ -393,7 +393,7 @@ extension Chips {
}
}
}
}
fileprivate
extension
Chip
s
{
fileprivate
extension
Chip
Bar
{
/**
/**
Animates to a given chipItem.
Animates to a given chipItem.
- Parameter to chipItem: A ChipItem.
- Parameter to chipItem: A ChipItem.
...
...
Sources/iOS/ChipBarController.swift
0 → 100644
View file @
4d61e3f8
/*
* Copyright (C) 2015 - 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of CosmicMind nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import
UIKit
fileprivate
var
ChipItemKey
:
UInt8
=
0
@objc(ChipBarAlignment)
public
enum
ChipBarAlignment
:
Int
{
case
top
case
bottom
case
hidden
}
extension
UIViewController
{
/**
A convenience property that provides access to the ChipBarController.
This is the recommended method of accessing the ChipBarController
through child UIViewControllers.
*/
public
var
chipsController
:
ChipBarController
?
{
return
traverseViewControllerHierarchyForClassType
()
}
}
open
class
ChipBarController
:
TransitionController
{
/**
A Display value to indicate whether or not to
display the rootViewController to the full view
bounds, or up to the toolbar height.
*/
open
var
displayStyle
=
DisplayStyle
.
partial
{
didSet
{
layoutSubviews
()
}
}
/// The ChipBar used to switch between view controllers.
@IBInspectable
open
let
chipBar
=
ChipBar
()
/// The chipBar alignment.
open
var
chipBarAlignment
=
ChipBarAlignment
.
bottom
{
didSet
{
layoutSubviews
()
}
}
open
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
chipBar
.
width
=
view
.
width
switch
displayStyle
{
case
.
partial
:
let
h
=
chipBar
.
height
container
.
y
=
h
container
.
height
=
view
.
height
-
h
case
.
full
:
container
.
frame
=
view
.
bounds
}
rootViewController
.
view
.
frame
=
container
.
bounds
}
open
override
func
prepare
()
{
super
.
prepare
()
prepareChipBar
()
}
}
fileprivate
extension
ChipBarController
{
/// Prepares the ChipBar.
func
prepareChipBar
()
{
chipBar
.
depthPreset
=
.
depth1
view
.
addSubview
(
chipBar
)
}
}
Sources/iOS/FABButton.swift
View file @
4d61e3f8
...
@@ -31,13 +31,6 @@
...
@@ -31,13 +31,6 @@
import
UIKit
import
UIKit
open
class
FABButton
:
Button
{
open
class
FABButton
:
Button
{
/**
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
()
{
open
override
func
prepare
()
{
super
.
prepare
()
super
.
prepare
()
depthPreset
=
.
depth1
depthPreset
=
.
depth1
...
...
Sources/iOS/FlatButton.swift
View file @
4d61e3f8
...
@@ -31,13 +31,6 @@
...
@@ -31,13 +31,6 @@
import
UIKit
import
UIKit
open
class
FlatButton
:
Button
{
open
class
FlatButton
:
Button
{
/**
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
()
{
open
override
func
prepare
()
{
super
.
prepare
()
super
.
prepare
()
cornerRadiusPreset
=
.
cornerRadius1
cornerRadiusPreset
=
.
cornerRadius1
...
...
Sources/iOS/IconButton.swift
View file @
4d61e3f8
...
@@ -31,14 +31,7 @@
...
@@ -31,14 +31,7 @@
import
UIKit
import
UIKit
open
class
IconButton
:
Button
{
open
class
IconButton
:
Button
{
/**
open
override
func
prepare
()
{
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
()
super
.
prepare
()
pulseAnimation
=
.
center
pulseAnimation
=
.
center
}
}
...
...
Sources/iOS/RaisedButton.swift
View file @
4d61e3f8
...
@@ -31,13 +31,6 @@
...
@@ -31,13 +31,6 @@
import
UIKit
import
UIKit
open
class
RaisedButton
:
Button
{
open
class
RaisedButton
:
Button
{
/**
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
()
{
open
override
func
prepare
()
{
super
.
prepare
()
super
.
prepare
()
depthPreset
=
.
depth1
depthPreset
=
.
depth1
...
...
Sources/iOS/SearchBar.swift
View file @
4d61e3f8
...
@@ -153,13 +153,6 @@ open class SearchBar: Bar {
...
@@ -153,13 +153,6 @@ open class SearchBar: Bar {
layoutClearButton
()
layoutClearButton
()
}
}
/**
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
()
{
open
override
func
prepare
()
{
super
.
prepare
()
super
.
prepare
()
prepareTextField
()
prepareTextField
()
...
...
Sources/iOS/SearchBarController.swift
View file @
4d61e3f8
...
@@ -66,13 +66,6 @@ open class SearchBarController: StatusBarController {
...
@@ -66,13 +66,6 @@ open class SearchBarController: StatusBarController {
rootViewController
.
view
.
frame
=
container
.
bounds
rootViewController
.
view
.
frame
=
container
.
bounds
}
}
/**
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
()
{
open
override
func
prepare
()
{
super
.
prepare
()
super
.
prepare
()
displayStyle
=
.
partial
displayStyle
=
.
partial
...
...
Sources/iOS/StatusBarController.swift
View file @
4d61e3f8
...
@@ -80,11 +80,6 @@ open class StatusBarController: TransitionController {
...
@@ -80,11 +80,6 @@ open class StatusBarController: TransitionController {
/// A reference to the statusBar.
/// A reference to the statusBar.
open
let
statusBar
=
UIView
()
open
let
statusBar
=
UIView
()
/**
To execute in the order of the layout chain, override this
method. LayoutSubviews should be called immediately, unless you
have a certain need.
*/
open
override
func
layoutSubviews
()
{
open
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
super
.
layoutSubviews
()
...
@@ -106,13 +101,6 @@ open class StatusBarController: TransitionController {
...
@@ -106,13 +101,6 @@ open class StatusBarController: TransitionController {
rootViewController
.
view
.
frame
=
container
.
bounds
rootViewController
.
view
.
frame
=
container
.
bounds
}
}
/**
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
()
{
open
override
func
prepare
()
{
super
.
prepare
()
super
.
prepare
()
prepareStatusBar
()
prepareStatusBar
()
...
...
Sources/iOS/TabBar.swift
View file @
4d61e3f8
...
@@ -72,7 +72,7 @@ public enum TabBarStyle: Int {
...
@@ -72,7 +72,7 @@ public enum TabBarStyle: Int {
}
}
open
class
TabBar
:
Bar
{
open
class
TabBar
:
Bar
{
/// A boolean indicating if the TabBar
line
is in an animation state.
/// A boolean indicating if the TabBar is in an animation state.
open
fileprivate
(
set
)
var
isAnimating
=
false
open
fileprivate
(
set
)
var
isAnimating
=
false
/// The total width of the tabItems.
/// The total width of the tabItems.
...
...
Sources/iOS/Tab
s
Controller.swift
→
Sources/iOS/Tab
Bar
Controller.swift
View file @
4d61e3f8
...
@@ -55,16 +55,16 @@ extension UIViewController {
...
@@ -55,16 +55,16 @@ extension UIViewController {
extension
UIViewController
{
extension
UIViewController
{
/**
/**
A convenience property that provides access to the Tab
s
Controller.
A convenience property that provides access to the Tab
Bar
Controller.
This is the recommended method of accessing the Tab
s
Controller
This is the recommended method of accessing the Tab
Bar
Controller
through child UIViewControllers.
through child UIViewControllers.
*/
*/
public
var
tabsController
:
Tab
s
Controller
?
{
public
var
tabsController
:
Tab
Bar
Controller
?
{
return
traverseViewControllerHierarchyForClassType
()
return
traverseViewControllerHierarchyForClassType
()
}
}
}
}
open
class
Tab
s
Controller
:
UIViewController
{
open
class
Tab
Bar
Controller
:
UIViewController
{
/// The TabBar used to switch between view controllers.
/// The TabBar used to switch between view controllers.
@IBInspectable
@IBInspectable
open
let
tabBar
=
TabBar
()
open
let
tabBar
=
TabBar
()
...
@@ -157,7 +157,7 @@ open class TabsController: UIViewController {
...
@@ -157,7 +157,7 @@ open class TabsController: UIViewController {
}
}
}
}
fileprivate
extension
Tab
s
Controller
{
fileprivate
extension
Tab
Bar
Controller
{
/// Prepares the container view.
/// Prepares the container view.
func
prepareContainer
()
{
func
prepareContainer
()
{
view
.
addSubview
(
container
)
view
.
addSubview
(
container
)
...
@@ -218,7 +218,7 @@ fileprivate extension TabsController {
...
@@ -218,7 +218,7 @@ fileprivate extension TabsController {
}
}
}
}
fileprivate
extension
Tab
s
Controller
{
fileprivate
extension
Tab
Bar
Controller
{
/// Layout the container view.
/// Layout the container view.
func
layoutContainer
()
{
func
layoutContainer
()
{
let
p
=
tabBar
.
height
let
p
=
tabBar
.
height
...
@@ -263,7 +263,7 @@ fileprivate extension TabsController {
...
@@ -263,7 +263,7 @@ fileprivate extension TabsController {
}
}
}
}
fileprivate
extension
Tab
s
Controller
{
fileprivate
extension
Tab
Bar
Controller
{
/**
/**
Removes the view controller as a child view controller with
Removes the view controller as a child view controller with
the given index.
the given index.
...
@@ -290,7 +290,7 @@ fileprivate extension TabsController {
...
@@ -290,7 +290,7 @@ fileprivate extension TabsController {
}
}
}
}
fileprivate
extension
Tab
s
Controller
{
fileprivate
extension
Tab
Bar
Controller
{
/**
/**
Handles the tabItem.
Handles the tabItem.
- Parameter tabItem: A TabItem.
- Parameter tabItem: A TabItem.
...
...
Sources/iOS/Toolbar.swift
View file @
4d61e3f8
...
@@ -135,13 +135,6 @@ open class Toolbar: Bar {
...
@@ -135,13 +135,6 @@ open class Toolbar: Bar {
}
}
}
}
/**
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
()
{
open
override
func
prepare
()
{
super
.
prepare
()
super
.
prepare
()
contentViewAlignment
=
.
center
contentViewAlignment
=
.
center
...
...
Sources/iOS/ToolbarController.swift
View file @
4d61e3f8
...
@@ -67,13 +67,6 @@ open class ToolbarController: StatusBarController {
...
@@ -67,13 +67,6 @@ open class ToolbarController: StatusBarController {
rootViewController
.
view
.
frame
=
container
.
bounds
rootViewController
.
view
.
frame
=
container
.
bounds
}
}
/**
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
()
{
open
override
func
prepare
()
{
super
.
prepare
()
super
.
prepare
()
displayStyle
=
.
partial
displayStyle
=
.
partial
...
...
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