Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fedor Ihnatkevich
VLC-Android
Commits
b60eba50
Commit
b60eba50
authored
7 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
Add content fragment only on activity creation
on re-creation, fragment will be restored
parent
2268e06c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vlc-android/src/org/videolan/vlc/gui/tv/browser/VerticalGridActivity.java
+32
-30
32 additions, 30 deletions
...org/videolan/vlc/gui/tv/browser/VerticalGridActivity.java
with
32 additions
and
30 deletions
vlc-android/src/org/videolan/vlc/gui/tv/browser/VerticalGridActivity.java
+
32
−
30
View file @
b60eba50
...
...
@@ -49,38 +49,40 @@ public class VerticalGridActivity extends BaseTvActivity implements BrowserActiv
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
tv_vertical_grid
);
mContentLoadingProgressBar
=
(
ProgressBar
)
findViewById
(
R
.
id
.
tv_fragment_progress
);
mEmptyView
=
(
TextView
)
findViewById
(
R
.
id
.
tv_fragment_empty
);
long
type
=
getIntent
().
getLongExtra
(
MainTvActivity
.
BROWSER_TYPE
,
-
1
);
if
(
type
==
MainTvActivity
.
HEADER_VIDEO
)
mFragment
=
new
VideoBrowserFragment
();
else
if
(
type
==
MainTvActivity
.
HEADER_CATEGORIES
)
if
(
getIntent
().
getLongExtra
(
MusicFragment
.
AUDIO_CATEGORY
,
MusicFragment
.
CATEGORY_SONGS
)
==
MusicFragment
.
CATEGORY_SONGS
&&
VLCApplication
.
getMLInstance
().
getAudioCount
()
>
GRID_LIMIT
)
{
mFragment
=
new
SongsBrowserFragment
();
}
else
{
mFragment
=
new
MusicFragment
();
Bundle
args
=
new
Bundle
();
args
.
putParcelable
(
MusicFragment
.
AUDIO_ITEM
,
getIntent
().
getParcelableExtra
(
MusicFragment
.
AUDIO_ITEM
));
((
Fragment
)
mFragment
).
setArguments
(
args
);
mContentLoadingProgressBar
=
findViewById
(
R
.
id
.
tv_fragment_progress
);
mEmptyView
=
findViewById
(
R
.
id
.
tv_fragment_empty
);
if
(
savedInstanceState
==
null
)
{
long
type
=
getIntent
().
getLongExtra
(
MainTvActivity
.
BROWSER_TYPE
,
-
1
);
if
(
type
==
MainTvActivity
.
HEADER_VIDEO
)
mFragment
=
new
VideoBrowserFragment
();
else
if
(
type
==
MainTvActivity
.
HEADER_CATEGORIES
)
if
(
getIntent
().
getLongExtra
(
MusicFragment
.
AUDIO_CATEGORY
,
MusicFragment
.
CATEGORY_SONGS
)
==
MusicFragment
.
CATEGORY_SONGS
&&
VLCApplication
.
getMLInstance
().
getAudioCount
()
>
GRID_LIMIT
)
{
mFragment
=
new
SongsBrowserFragment
();
}
else
{
mFragment
=
new
MusicFragment
();
Bundle
args
=
new
Bundle
();
args
.
putParcelable
(
MusicFragment
.
AUDIO_ITEM
,
getIntent
().
getParcelableExtra
(
MusicFragment
.
AUDIO_ITEM
));
((
Fragment
)
mFragment
).
setArguments
(
args
);
}
else
if
(
type
==
MainTvActivity
.
HEADER_NETWORK
)
{
Uri
uri
=
getIntent
().
getData
();
if
(
uri
==
null
)
uri
=
getIntent
().
getParcelableExtra
(
SortedBrowserFragment
.
KEY_URI
);
if
(
uri
==
null
)
mFragment
=
new
BrowserGridFragment
();
else
mFragment
=
new
NetworkBrowserFragment
();
}
else
if
(
type
==
MainTvActivity
.
HEADER_DIRECTORIES
)
mFragment
=
new
DirectoryBrowserFragment
();
else
{
finish
();
return
;
}
else
if
(
type
==
MainTvActivity
.
HEADER_NETWORK
)
{
Uri
uri
=
getIntent
().
getData
();
if
(
uri
==
null
)
uri
=
getIntent
().
getParcelableExtra
(
SortedBrowserFragment
.
KEY_URI
);
if
(
uri
==
null
)
mFragment
=
new
BrowserGridFragment
();
else
mFragment
=
new
NetworkBrowserFragment
();
}
else
if
(
type
==
MainTvActivity
.
HEADER_DIRECTORIES
)
mFragment
=
new
DirectoryBrowserFragment
();
else
{
finish
();
return
;
getSupportFragmentManager
().
beginTransaction
()
.
add
(
R
.
id
.
tv_fragment_placeholder
,
((
Fragment
)
mFragment
))
.
commit
();
}
getSupportFragmentManager
().
beginTransaction
()
.
add
(
R
.
id
.
tv_fragment_placeholder
,
((
Fragment
)
mFragment
))
.
commit
();
}
@Override
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment