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
a741f921
Commit
a741f921
authored
Jun 27, 2018
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed issue where TabBar line was incorrectly animating during transition
parent
2404c2ca
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
25 deletions
+18
-25
Sources/Frameworks/Motion
+1
-1
Sources/iOS/TabBar.swift
+11
-10
Sources/iOS/TabsController.swift
+6
-14
No files found.
Motion
@
d3b27d75
Subproject commit
2f4fb2859d7ed9ec05dca5221710d3e4cc46d410
Subproject commit
d3b27d7597ecd9e035e7f477513c7f43cea24c5c
Sources/iOS/TabBar.swift
View file @
a741f921
...
...
@@ -546,8 +546,9 @@ fileprivate extension TabBar {
return
}
guard
!
(
false
==
_delegate
?
.
_tabBar
(
tabBar
:
self
,
shouldSelect
:
tabItem
))
else
{
return
}
guard
!
(
false
==
_delegate
?
.
_tabBar
(
tabBar
:
self
,
shouldSelect
:
tabItem
))
else
{
return
}
animate
(
to
:
tabItem
,
isTriggeredByUserInteraction
:
true
)
}
...
...
@@ -604,15 +605,15 @@ fileprivate extension TabBar {
.
size
(
width
:
tabItem
.
bounds
.
width
,
height
:
lineHeight
),
.
position
(
x
:
tabItem
.
center
.
x
,
y
:
.
bottom
==
lineAlignment
?
scrollView
.
bounds
.
height
-
lineHeight
/
2
:
lineHeight
/
2
),
.
completion
({
[
weak
self
,
isTriggeredByUserInteraction
=
isTriggeredByUserInteraction
,
tabItem
=
tabItem
,
completion
=
completion
]
in
guard
let
s
=
self
else
{
return
}
guard
let
`
self
`
=
self
else
{
return
}
if
isTriggeredByUserInteraction
{
s
.
delegate
?
.
tabBar
?(
tabBar
:
s
,
didSelect
:
tabItem
)
}
completion
?(
tabItem
)
if
isTriggeredByUserInteraction
{
self
.
delegate
?
.
tabBar
?(
tabBar
:
self
,
didSelect
:
tabItem
)
}
completion
?(
tabItem
)
}))
updateScrollView
()
...
...
Sources/iOS/TabsController.swift
View file @
a741f921
...
...
@@ -230,7 +230,7 @@ fileprivate extension TabsController {
}
super
.
transition
(
to
:
viewController
)
{
[
weak
self
,
viewController
=
viewController
,
completion
=
completion
]
(
isFinishing
)
in
guard
let
s
=
self
else
{
guard
let
`
self
`
=
self
else
{
return
}
...
...
@@ -241,7 +241,7 @@ fileprivate extension TabsController {
completion
?(
isFinishing
)
if
isTriggeredByUserInteraction
{
s
.
delegate
?
.
tabsController
?(
tabsController
:
s
,
didSelect
:
viewController
)
s
elf
.
delegate
?
.
tabsController
?(
tabsController
:
self
,
didSelect
:
viewController
)
}
}
}
...
...
@@ -412,21 +412,14 @@ extension TabsController {
}
}
Motion
.
async
{
[
weak
self
]
in
guard
let
s
=
self
else
{
transition
(
to
:
viewControllers
[
index
],
isTriggeredByUserInteraction
:
isTriggeredByUserInteraction
)
{
[
weak
self
]
(
isFinishing
)
in
guard
isFinishing
else
{
return
}
s
.
tabBar
.
select
(
at
:
index
)
s
.
transition
(
to
:
s
.
viewControllers
[
index
],
isTriggeredByUserInteraction
:
isTriggeredByUserInteraction
)
{
[
weak
self
]
(
isFinishing
)
in
guard
isFinishing
else
{
return
}
self
?
.
selectedIndex
=
index
}
self
?
.
selectedIndex
=
index
}
return
true
}
}
...
...
@@ -434,7 +427,6 @@ extension TabsController {
extension
TabsController
:
_TabBarDelegate
{
@objc
func
_tabBar
(
tabBar
:
TabBar
,
shouldSelect
tabItem
:
TabItem
)
->
Bool
{
guard
let
i
=
tabBar
.
tabItems
.
index
(
of
:
tabItem
)
else
{
return
false
}
...
...
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