Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Casanowow Life for love
VLC-Android
Commits
3b7bfd9a
Commit
3b7bfd9a
authored
Jun 27, 2012
by
Ludovic Fauvet
Browse files
Fix some of the transitions between fragments
parent
06b11389
Changes
1
Hide whitespace changes
Inline
Side-by-side
vlc-android/src/org/videolan/vlc/gui/MainActivity.java
View file @
3b7bfd9a
...
...
@@ -522,13 +522,27 @@ public class MainActivity extends SherlockFragmentActivity {
@Override
public
void
onTabSelected
(
Tab
tab
,
FragmentTransaction
ft
)
{
if
(
mTag
.
equalsIgnoreCase
(
"video"
))
{
ft
.
setCustomAnimations
((
mFragment
==
null
)
?
0
:
R
.
anim
.
anim_enter_left
,
R
.
anim
.
anim_leave_left
);
((
MainActivity
)
mActivity
).
mCurrentViewTab
=
VIDEO_TAB
;
}
else
if
(
mTag
.
equalsIgnoreCase
(
"audio"
))
{
ft
.
setCustomAnimations
(
R
.
anim
.
anim_enter_right
,
R
.
anim
.
anim_leave_right
);
((
MainActivity
)
mActivity
).
mCurrentViewTab
=
AUDIO_TAB
;
}
Fragment
current
=
mActivity
.
getSupportFragmentManager
().
findFragmentById
(
R
.
id
.
fragment_placeholder
);
if
(
mTag
.
equalsIgnoreCase
(
"video"
))
((
MainActivity
)
mActivity
).
mCurrentViewTab
=
VIDEO_TAB
;
else
if
(
mTag
.
equalsIgnoreCase
(
"audio"
))
((
MainActivity
)
mActivity
).
mCurrentViewTab
=
AUDIO_TAB
;
if
(
current
!=
null
)
{
if
(
current
.
getTag
()
==
mTag
)
return
;
if
(
mTag
.
equalsIgnoreCase
(
"video"
))
ft
.
setCustomAnimations
(
0
,
R
.
anim
.
anim_leave_right
);
else
if
(
mTag
.
equalsIgnoreCase
(
"audio"
))
ft
.
setCustomAnimations
(
0
,
R
.
anim
.
anim_leave_left
);
ft
.
detach
(
current
);
}
if
(
mTag
.
equalsIgnoreCase
(
"video"
))
ft
.
setCustomAnimations
(
R
.
anim
.
anim_enter_left
,
0
);
else
if
(
mTag
.
equalsIgnoreCase
(
"audio"
))
ft
.
setCustomAnimations
(
R
.
anim
.
anim_enter_right
,
0
);
if
(
mFragment
==
null
)
{
mFragment
=
Fragment
.
instantiate
(
mActivity
,
mClass
.
getName
(),
mArgs
);
...
...
@@ -541,16 +555,6 @@ public class MainActivity extends SherlockFragmentActivity {
@Override
public
void
onTabUnselected
(
Tab
tab
,
FragmentTransaction
ft
)
{
if
(
mTag
.
equalsIgnoreCase
(
"video"
))
ft
.
setCustomAnimations
(
R
.
anim
.
anim_enter_left
,
R
.
anim
.
anim_leave_left
);
else
if
(
mTag
.
equalsIgnoreCase
(
"audio"
))
{
ft
.
setCustomAnimations
(
R
.
anim
.
anim_enter_right
,
R
.
anim
.
anim_leave_right
);
mActivity
.
getSupportFragmentManager
().
popBackStack
();
}
if
(
mFragment
!=
null
)
{
ft
.
detach
(
mFragment
);
}
}
@Override
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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