Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
528
Issue boards
Milestones
Wiki
Code
Merge requests
14
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
8e8696f1
Commit
8e8696f1
authored
7 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
Browsers: use StringBuilder for folder description
(cherry picked from commit
b4abf53a
)
parent
3569c2d4
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/browser/BaseBrowserFragment.java
+14
-14
14 additions, 14 deletions
...src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
with
14 additions
and
14 deletions
vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
+
14
−
14
View file @
8e8696f1
...
...
@@ -24,6 +24,7 @@ package org.videolan.vlc.gui.browser;
import
android.annotation.TargetApi
;
import
android.content.Intent
;
import
android.content.res.Resources
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Bundle
;
...
...
@@ -674,15 +675,15 @@ public abstract class BaseBrowserFragment extends SortableFragment<BaseBrowserAd
private
MediaBrowser
.
EventListener
mFoldersBrowserListener
=
new
MediaBrowser
.
EventListener
(){
final
List
<
MediaWrapper
>
directories
=
new
ArrayList
<>();
final
List
<
MediaWrapper
>
files
=
new
ArrayList
<>();
Resources
res
=
null
;
final
StringBuilder
sb
=
new
StringBuilder
();
@Override
public
void
onMediaAdded
(
int
index
,
final
Media
media
)
{
final
int
type
=
media
.
getType
();
final
MediaWrapper
mw
=
getMediaWrapper
(
new
MediaWrapper
(
media
));
if
(
type
==
Media
.
Type
.
Directory
)
directories
.
add
(
mw
);
else
if
(
type
==
Media
.
Type
.
File
)
files
.
add
(
mw
);
if
(
type
==
Media
.
Type
.
Directory
)
directories
.
add
(
mw
);
else
if
(
type
==
Media
.
Type
.
File
)
files
.
add
(
mw
);
}
@Override
...
...
@@ -743,21 +744,20 @@ public abstract class BaseBrowserFragment extends SortableFragment<BaseBrowserAd
}
private
String
getDescription
(
int
folderCount
,
int
mediaFileCount
)
{
String
holderText
=
""
;
if
(
res
==
null
)
res
=
getResources
();
sb
.
setLength
(
0
);
if
(
folderCount
>
0
)
{
holderText
+=
VLCApplication
.
getAppResources
()
.
getQuantityString
(
sb
.
append
(
res
.
getQuantityString
(
R
.
plurals
.
subfolders_quantity
,
folderCount
,
folderCount
);
if
(
mediaFileCount
>
0
)
holderText
+=
", "
;
));
if
(
mediaFileCount
>
0
)
sb
.
append
(
", "
);
}
if
(
mediaFileCount
>
0
)
holderText
+=
VLCApplication
.
getAppResources
().
getQuantityString
(
R
.
plurals
.
mediafiles_quantity
,
mediaFileCount
,
mediaFileCount
);
sb
.
append
(
res
.
getQuantityString
(
R
.
plurals
.
mediafiles_quantity
,
mediaFileCount
,
mediaFileCount
));
else
if
(
folderCount
==
0
&&
mediaFileCount
==
0
)
holderText
=
getString
(
R
.
string
.
directory_empty
);
return
holderText
;
sb
.
append
(
getString
(
R
.
string
.
directory_empty
)
)
;
return
sb
.
toString
()
;
}
};
...
...
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