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
9d6054cb
Unverified
Commit
9d6054cb
authored
Jul 21, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: added TabsController for PageTabBarController rework
parent
957dd4b4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
23 deletions
+27
-23
Material.xcodeproj/project.pbxproj
+4
-0
Sources/iOS/TabBar.swift
+23
-23
Sources/iOS/TabsController.swift
+0
-0
No files found.
Material.xcodeproj/project.pbxproj
View file @
9d6054cb
...
@@ -233,6 +233,7 @@
...
@@ -233,6 +233,7 @@
96E09DBB1F2108000000B121
/* MotionPreprocessor.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E09D701F2107DD0000B121
/* MotionPreprocessor.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96E09DBB1F2108000000B121
/* MotionPreprocessor.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E09D701F2107DD0000B121
/* MotionPreprocessor.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96E09DBC1F2108000000B121
/* SourcePreprocessor.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E09D711F2107DD0000B121
/* SourcePreprocessor.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96E09DBC1F2108000000B121
/* SourcePreprocessor.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E09D711F2107DD0000B121
/* SourcePreprocessor.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96E09DBD1F2108000000B121
/* TransitionPreprocessor.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E09D721F2107DD0000B121
/* TransitionPreprocessor.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96E09DBD1F2108000000B121
/* TransitionPreprocessor.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E09D721F2107DD0000B121
/* TransitionPreprocessor.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96E09DC81F2287E50000B121
/* TabsController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E09DC71F2287E50000B121
/* TabsController.swift */
;
};
96E3C3951D3A1CC20086A024
/* IconButton.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9658F2161CD6FA4700B902C1
/* IconButton.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96E3C3951D3A1CC20086A024
/* IconButton.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9658F2161CD6FA4700B902C1
/* IconButton.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96E3C3961D3A1CC20086A024
/* CollectionReusableView.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
966ECF291CF4C20100BB0BDF
/* CollectionReusableView.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96E3C3961D3A1CC20086A024
/* CollectionReusableView.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
966ECF291CF4C20100BB0BDF
/* CollectionReusableView.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96E3C3971D3A1CC20086A024
/* Material+UIView.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E3C3931D397AE90086A024
/* Material+UIView.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96E3C3971D3A1CC20086A024
/* Material+UIView.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E3C3931D397AE90086A024
/* Material+UIView.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
...
@@ -367,6 +368,7 @@
...
@@ -367,6 +368,7 @@
96E09D701F2107DD0000B121
/* MotionPreprocessor.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MotionPreprocessor.swift
;
sourceTree
=
"<group>"
;
};
96E09D701F2107DD0000B121
/* MotionPreprocessor.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MotionPreprocessor.swift
;
sourceTree
=
"<group>"
;
};
96E09D711F2107DD0000B121
/* SourcePreprocessor.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
SourcePreprocessor.swift
;
sourceTree
=
"<group>"
;
};
96E09D711F2107DD0000B121
/* SourcePreprocessor.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
SourcePreprocessor.swift
;
sourceTree
=
"<group>"
;
};
96E09D721F2107DD0000B121
/* TransitionPreprocessor.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
TransitionPreprocessor.swift
;
sourceTree
=
"<group>"
;
};
96E09D721F2107DD0000B121
/* TransitionPreprocessor.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
TransitionPreprocessor.swift
;
sourceTree
=
"<group>"
;
};
96E09DC71F2287E50000B121
/* TabsController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
TabsController.swift
;
sourceTree
=
"<group>"
;
};
96E3C3931D397AE90086A024
/* Material+UIView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+UIView.swift"
;
sourceTree
=
"<group>"
;
};
96E3C3931D397AE90086A024
/* Material+UIView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+UIView.swift"
;
sourceTree
=
"<group>"
;
};
96F1DC871D654FDF0025F925
/* Material+CALayer.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+CALayer.swift"
;
sourceTree
=
"<group>"
;
};
96F1DC871D654FDF0025F925
/* Material+CALayer.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+CALayer.swift"
;
sourceTree
=
"<group>"
;
};
/* End PBXFileReference section */
/* End PBXFileReference section */
...
@@ -505,6 +507,7 @@
...
@@ -505,6 +507,7 @@
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
96BCB79A1CB40DC500C806FE
/* TabBar.swift */
,
96BCB79A1CB40DC500C806FE
/* TabBar.swift */
,
96E09DC71F2287E50000B121
/* TabsController.swift */
,
);
);
name
=
Tab
;
name
=
Tab
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
@@ -1144,6 +1147,7 @@
...
@@ -1144,6 +1147,7 @@
96328B991E05C0CE009A4C90
/* TableViewController.swift in Sources */
,
96328B991E05C0CE009A4C90
/* TableViewController.swift in Sources */
,
965E80F91DD4D59500D61E4B
/* PresenterCard.swift in Sources */
,
965E80F91DD4D59500D61E4B
/* PresenterCard.swift in Sources */
,
96E09D8B1F2107DD0000B121
/* MotionContext.swift in Sources */
,
96E09D8B1F2107DD0000B121
/* MotionContext.swift in Sources */
,
96E09DC81F2287E50000B121
/* TabsController.swift in Sources */
,
965689611F002F4C001C656D
/* CardCollectionViewController.swift in Sources */
,
965689611F002F4C001C656D
/* CardCollectionViewController.swift in Sources */
,
965E80CC1DD4C50600D61E4B
/* Bar.swift in Sources */
,
965E80CC1DD4C50600D61E4B
/* Bar.swift in Sources */
,
96E09D871F2107DD0000B121
/* Motion.swift in Sources */
,
96E09D871F2107DD0000B121
/* Motion.swift in Sources */
,
...
...
Sources/iOS/TabBar.swift
View file @
9d6054cb
...
@@ -60,7 +60,7 @@ public protocol TabBarDelegate {
...
@@ -60,7 +60,7 @@ public protocol TabBarDelegate {
@objc(TabBarStyle)
@objc(TabBarStyle)
public
enum
TabBarStyle
:
Int
{
public
enum
TabBarStyle
:
Int
{
case
normal
case
normal
//
case scrollable
case
scrollable
}
}
open
class
TabBar
:
Bar
{
open
class
TabBar
:
Bar
{
...
@@ -270,31 +270,31 @@ open class TabBar: Bar {
...
@@ -270,31 +270,31 @@ open class TabBar: Bar {
layoutDivider
()
layoutDivider
()
//
let buttonsWidth = buttons.reduce(0) {
let
buttonsWidth
=
buttons
.
reduce
(
0
)
{
//
$0 + $1.sizeThatFits(CGSize(width: .greatestFiniteMagnitude, height: contentView.height)).width + interimSpace
$0
+
$1
.
sizeThatFits
(
CGSize
(
width
:
.
greatestFiniteMagnitude
,
height
:
contentView
.
height
))
.
width
+
interimSpace
//
}
}
//
if .scrollable == tabBarStyle && buttonsWidth > p {
if
.
scrollable
==
tabBarStyle
&&
buttonsWidth
>
p
{
//
scrollView.frame = CGRect(x: l, y: 0, width: p, height: height)
scrollView
.
frame
=
CGRect
(
x
:
l
,
y
:
0
,
width
:
p
,
height
:
height
)
//
//
var w: CGFloat = 0
var
w
:
CGFloat
=
0
//
//
for b in buttons {
for
b
in
buttons
{
//
let width = b.sizeThatFits(CGSize(width: CGFloat.greatestFiniteMagnitude, height: contentView.height)).width + interimSpace
let
width
=
b
.
sizeThatFits
(
CGSize
(
width
:
CGFloat
.
greatestFiniteMagnitude
,
height
:
contentView
.
height
))
.
width
+
interimSpace
//
scrollView.addSubview(b)
scrollView
.
addSubview
(
b
)
//
b.height = scrollView.height
b
.
height
=
scrollView
.
height
//
b.width = width
b
.
width
=
width
//
b.x = w
b
.
x
=
w
//
w += width
w
+=
width
//
}
}
//
//
scrollView.contentSize = CGSize(width: buttonsWidth, height: height)
scrollView
.
contentSize
=
CGSize
(
width
:
buttonsWidth
,
height
:
height
)
//
scrollView.addSubview(line)
scrollView
.
addSubview
(
line
)
//
} else {
}
else
{
contentView
.
grid
.
axis
.
columns
=
buttons
.
count
contentView
.
grid
.
axis
.
columns
=
buttons
.
count
centerViews
=
buttons
centerViews
=
buttons
addSubview
(
line
)
addSubview
(
line
)
//
}
}
updateSelectionLine
()
updateSelectionLine
()
}
}
...
...
Sources/iOS/TabsController.swift
0 → 100644
View file @
9d6054cb
This diff is collapsed.
Click to expand it.
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