Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
531
Issue boards
Milestones
Wiki
Code
Merge requests
16
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC-Android
Commits
9c3d3b7a
Commit
9c3d3b7a
authored
7 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
Code cleaning
(cherry picked from commit
c5a39bb9
)
parent
a87c06b1
No related branches found
No related tags found
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/audio/AudioBrowserFragment.java
+14
-33
14 additions, 33 deletions
.../src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
with
14 additions
and
33 deletions
vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+
14
−
33
View file @
9c3d3b7a
...
...
@@ -84,11 +84,11 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements SwipeRefre
private
final
ContextMenuRecyclerView
[]
mLists
=
new
ContextMenuRecyclerView
[
MODE_TOTAL
];
private
FastScroller
mFastScroller
;
p
ublic
static
final
int
REFRESH
=
101
;
p
ublic
static
final
int
UPDATE_LIST
=
102
;
p
ublic
static
final
int
SET_REFRESHING
=
103
;
p
ublic
static
final
int
UNSET_REFRESHING
=
104
;
p
ublic
static
final
int
UPDATE_EMPTY_VIEW
=
105
;
p
rivate
static
final
int
REFRESH
=
101
;
p
rivate
static
final
int
UPDATE_LIST
=
102
;
p
rivate
static
final
int
SET_REFRESHING
=
103
;
p
rivate
static
final
int
UNSET_REFRESHING
=
104
;
p
rivate
static
final
int
UPDATE_EMPTY_VIEW
=
105
;
private
final
static
int
MODE_ARTIST
=
0
;
private
final
static
int
MODE_ALBUM
=
1
;
private
final
static
int
MODE_SONG
=
2
;
...
...
@@ -126,7 +126,7 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements SwipeRefre
for
(
int
i
=
0
;
i
<
MODE_TOTAL
;
i
++)
mLists
[
i
]
=
(
ContextMenuRecyclerView
)
mViewPager
.
getChildAt
(
i
);
String
[]
titles
=
new
String
[]
{
final
String
[]
titles
=
new
String
[]
{
getString
(
R
.
string
.
artists
),
getString
(
R
.
string
.
albums
),
getString
(
R
.
string
.
songs
),
...
...
@@ -135,9 +135,9 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements SwipeRefre
};
mViewPager
.
setOffscreenPageLimit
(
MODE_TOTAL
-
1
);
mViewPager
.
setAdapter
(
new
AudioPagerAdapter
(
mLists
,
titles
));
RecyclerView
.
RecycledViewPool
rvp
=
new
RecyclerView
.
RecycledViewPool
();
final
RecyclerView
.
RecycledViewPool
rvp
=
new
RecyclerView
.
RecycledViewPool
();
for
(
int
i
=
0
;
i
<
MODE_TOTAL
;
++
i
)
{
LinearLayoutManager
llm
=
new
LinearLayoutManager
(
getActivity
());
final
LinearLayoutManager
llm
=
new
LinearLayoutManager
(
getActivity
());
llm
.
setRecycleChildrenOnDetach
(
true
);
mLists
[
i
].
setLayoutManager
(
llm
);
mLists
[
i
].
setRecycledViewPool
(
rvp
);
...
...
@@ -235,7 +235,7 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements SwipeRefre
return
false
;
final
int
id
=
item
.
getItemId
();
MediaLibraryItem
mediaItem
=
adapter
.
getItem
(
position
);
final
MediaLibraryItem
mediaItem
=
adapter
.
getItem
(
position
);
if
(
id
==
R
.
id
.
audio_list_browser_delete
)
{
final
MediaLibraryItem
mediaLibraryItem
=
adapter
.
getItem
(
position
);
...
...
@@ -306,7 +306,7 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements SwipeRefre
if
(
useAllItems
)
{
if
(
mSongsAdapter
.
getItemCount
()
<=
position
)
return
false
;
ArrayList
<
MediaLibraryItem
>
mediaList
=
new
ArrayList
<>();
final
ArrayList
<
MediaLibraryItem
>
mediaList
=
new
ArrayList
<>();
startPosition
=
mSongsAdapter
.
getListWithPosition
(
mediaList
,
position
);
medias
=
Arrays
.
copyOf
(
mediaList
.
toArray
(),
mediaList
.
size
(),
MediaWrapper
[].
class
);
}
else
{
...
...
@@ -330,7 +330,7 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements SwipeRefre
@Override
public
void
onFabPlayClick
(
View
view
)
{
List
<
MediaWrapper
>
list
=
((
List
<
MediaWrapper
>)(
List
<?>)
mSongsAdapter
.
getMediaItems
());
final
List
<
MediaWrapper
>
list
=
((
List
<
MediaWrapper
>)(
List
<?>)
mSongsAdapter
.
getMediaItems
());
int
count
=
list
.
size
();
if
(
count
>
0
)
{
Random
rand
=
new
Random
();
...
...
@@ -355,7 +355,7 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements SwipeRefre
/**
* Handle changes on the list
*/
private
Handler
mHandler
=
new
AudioBrowserHandler
(
this
);
private
final
Handler
mHandler
=
new
AudioBrowserHandler
(
this
);
@Override
public
void
onRefresh
()
{
...
...
@@ -369,26 +369,7 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements SwipeRefre
}
@Override
public
void
display
()
{
// mReadyToDisplay = true;
// if (mAdaptersToNotify.isEmpty())
// return;
// mDisplaying = true;
// if (getActivity() != null)
// getActivity().runOnUiThread(new Runnable() {
// @Override
// public void run() {
// for (AudioBrowserAdapter adapter : mAdaptersToNotify)
// adapter.notifyDataSetChanged();
// mAdaptersToNotify.clear();
// mHandler.removeMessages(MSG_LOADING);
// mSwipeRefreshLayout.setRefreshing(false);
// mDisplaying = false;
// updateEmptyView(mViewPager.getCurrentItem());
// mFastScroller.setRecyclerView(getCurrentRV());
// }
// });
}
public
void
display
()
{}
@Override
public
String
getTitle
()
{
...
...
@@ -414,7 +395,7 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements SwipeRefre
mEmptyView
.
setText
(
position
==
MODE_PLAYLIST
?
R
.
string
.
noplaylist
:
R
.
string
.
nomedia
);
}
TabLayout
.
TabLayoutOnPageChangeListener
tcl
=
new
TabLayout
.
TabLayoutOnPageChangeListener
(
mTabLayout
);
private
final
TabLayout
.
TabLayoutOnPageChangeListener
tcl
=
new
TabLayout
.
TabLayoutOnPageChangeListener
(
mTabLayout
);
@Override
public
void
onPageScrolled
(
int
position
,
float
positionOffset
,
int
positionOffsetPixels
)
{
...
...
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