Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
264b6a2e
Commit
264b6a2e
authored
Apr 21, 2019
by
Hussein El Feky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed incorrect login options showing up
parent
22a68f39
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
44 deletions
+33
-44
LoginOptionsFragment.kt
...id/authentication/loginoptions/ui/LoginOptionsFragment.kt
+33
-44
No files found.
app/src/main/java/chat/rocket/android/authentication/loginoptions/ui/LoginOptionsFragment.kt
View file @
264b6a2e
...
...
@@ -537,16 +537,13 @@ class LoginOptionsFragment : Fragment(), LoginOptionsView {
}
private
fun
expandAccountsView
()
{
val
collapsedHeight
=
accounts_container
.
height
var
expandedHeight
=
collapsedHeight
val
buttons
=
(
0
..
accounts_container
.
childCount
)
.
mapNotNull
{
accounts_container
.
getChildAt
(
it
)
as
?
Button
}
.
filter
{
it
.
isClickable
&&
!
it
.
isVisible
}
val
optionHeight
=
accounts_container
.
getChildAt
(
1
).
height
+
accounts_container
.
getChildAt
(
1
).
marginTop
for
(
i
in
0
until
accounts_container
.
childCount
)
{
val
bt
=
accounts_container
.
getChildAt
(
i
)
as
Button
if
(
bt
.
isClickable
&&
!
bt
.
isVisible
)
{
expandedHeight
+=
optionHeight
}
}
val
collapsedHeight
=
accounts_container
.
height
val
expandedHeight
=
collapsedHeight
+
optionHeight
*
buttons
.
size
val
animation
=
ValueAnimator
.
ofInt
(
collapsedHeight
,
expandedHeight
)
animation
.
addUpdateListener
{
val
params
=
accounts_container
.
layoutParams
...
...
@@ -555,14 +552,11 @@ class LoginOptionsFragment : Fragment(), LoginOptionsView {
}
animation
.
addListener
(
object
:
AnimatorListenerAdapter
()
{
override
fun
onAnimationStart
(
animator
:
Animator
)
{
for
(
i
in
0
until
accounts_container
.
childCount
)
{
val
bt
=
accounts_container
.
getChildAt
(
i
)
as
Button
if
(!
bt
.
isVisible
)
{
bt
.
isVisible
=
true
val
anim
=
AlphaAnimation
(
0.0f
,
1.0f
)
anim
.
duration
=
400
bt
.
startAnimation
(
anim
)
}
buttons
.
forEach
{
it
.
isVisible
=
true
val
anim
=
AlphaAnimation
(
0.0f
,
1.0f
)
anim
.
duration
=
400
it
.
startAnimation
(
anim
)
}
}
})
...
...
@@ -570,16 +564,14 @@ class LoginOptionsFragment : Fragment(), LoginOptionsView {
}
private
fun
collapseAccountsView
()
{
val
expandedHeight
=
accounts_container
.
height
var
collapsedHeight
=
expandedHeight
val
buttons
=
(
0
..
accounts_container
.
childCount
)
.
mapNotNull
{
accounts_container
.
getChildAt
(
it
)
as
?
Button
}
.
filter
{
it
.
isClickable
&&
it
.
isVisible
}
.
drop
(
3
)
val
optionHeight
=
accounts_container
.
getChildAt
(
1
).
height
+
accounts_container
.
getChildAt
(
1
).
marginTop
for
(
i
in
3
until
accounts_container
.
childCount
)
{
val
bt
=
accounts_container
.
getChildAt
(
i
)
as
Button
if
(
bt
.
isClickable
&&
bt
.
isVisible
)
{
collapsedHeight
-=
optionHeight
}
}
val
expandedHeight
=
accounts_container
.
height
val
collapsedHeight
=
expandedHeight
-
optionHeight
*
buttons
.
size
val
animation
=
ValueAnimator
.
ofInt
(
expandedHeight
,
collapsedHeight
)
animation
.
addUpdateListener
{
val
params
=
accounts_container
.
layoutParams
...
...
@@ -588,26 +580,23 @@ class LoginOptionsFragment : Fragment(), LoginOptionsView {
}
animation
.
addListener
(
object
:
AnimatorListenerAdapter
()
{
override
fun
onAnimationStart
(
animator
:
Animator
)
{
for
(
i
in
3
until
accounts_container
.
childCount
)
{
val
bt
=
accounts_container
.
getChildAt
(
i
)
as
Button
if
(
bt
.
isVisible
)
{
val
anim
=
AlphaAnimation
(
1.0f
,
0.0f
)
anim
.
duration
=
400
anim
.
setAnimationListener
(
object
:
Animation
.
AnimationListener
{
override
fun
onAnimationStart
(
animation
:
Animation
)
{
}
override
fun
onAnimationEnd
(
animation
:
Animation
)
{
bt
.
isVisible
=
false
}
override
fun
onAnimationRepeat
(
animation
:
Animation
)
{
}
})
bt
.
startAnimation
(
anim
)
}
buttons
.
forEach
{
val
anim
=
AlphaAnimation
(
1.0f
,
0.0f
)
anim
.
duration
=
400
anim
.
setAnimationListener
(
object
:
Animation
.
AnimationListener
{
override
fun
onAnimationStart
(
animation
:
Animation
)
{
}
override
fun
onAnimationEnd
(
animation
:
Animation
)
{
it
.
isVisible
=
false
}
override
fun
onAnimationRepeat
(
animation
:
Animation
)
{
}
})
it
.
startAnimation
(
anim
)
}
}
})
...
...
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