Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Casanowow Life for love
VLC-Android
Commits
023accc3
Commit
023accc3
authored
Aug 23, 2017
by
Geoffrey Métais
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor initial fragment loading
parent
9091dacd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
16 deletions
+4
-16
vlc-android/src/org/videolan/vlc/gui/MainActivity.java
vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+4
-16
No files found.
vlc-android/src/org/videolan/vlc/gui/MainActivity.java
View file @
023accc3
...
...
@@ -142,15 +142,9 @@ public class MainActivity extends ContentActivity implements FilterQueryProvider
fm
.
beginTransaction
().
hide
(
fragment
).
commit
();
}
}
mCurrentFragmentId
=
savedInstanceState
.
getInt
(
"current"
,
R
.
id
.
nav_video
);
if
(!
currentIdIsExtension
())
{
String
tag
=
getTag
(
mCurrentFragmentId
);
if
(
mFragmentsStack
.
containsKey
(
tag
))
mCurrentFragment
=
mFragmentsStack
.
get
(
tag
).
get
();
}
}
else
{
mCurrentFragmentId
=
savedInstanceState
.
getInt
(
"current"
,
mSettings
.
getInt
(
"fragment_id"
,
R
.
id
.
nav_video
));
}
else
reloadPreferences
();
}
/* Set up the action bar */
prepareActionBar
();
...
...
@@ -251,7 +245,8 @@ public class MainActivity extends ContentActivity implements FilterQueryProvider
@Override
protected
void
onStart
()
{
super
.
onStart
();
mCurrentFragmentId
=
mSettings
.
getInt
(
"fragment_id"
,
R
.
id
.
nav_video
);
if
(
mCurrentFragment
==
null
&&
!
currentIdIsExtension
())
showFragment
(
mCurrentFragmentId
);
if
(
mMediaLibrary
.
isInitiated
())
{
/* Load media items from database and storage */
if
(
mScanNeeded
&&
Permissions
.
canReadStorage
())
...
...
@@ -334,13 +329,6 @@ public class MainActivity extends ContentActivity implements FilterQueryProvider
mExtensionServiceConnection
=
null
;
}
@Override
protected
void
onResumeFragments
()
{
super
.
onResumeFragments
();
if
(
mCurrentFragment
==
null
&&
!
currentIdIsExtension
())
showFragment
(
mCurrentFragmentId
);
}
protected
void
onSaveInstanceState
(
Bundle
outState
)
{
if
(
mCurrentFragment
instanceof
ExtensionBrowser
)
mCurrentFragment
=
null
;
...
...
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