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
182281d4
Commit
182281d4
authored
Jun 21, 2012
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Audio context menu: factorization
parent
81f509f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
26 deletions
+29
-26
vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserActivity.java
.../src/org/videolan/vlc/gui/audio/AudioBrowserActivity.java
+29
-26
No files found.
vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserActivity.java
View file @
182281d4
...
...
@@ -201,7 +201,32 @@ public class AudioBrowserActivity extends SherlockFragment implements ISortable
}
}
};
public
void
deleteMedia
(
final
List
<
String
>
addressMedia
,
final
Media
aMedia
)
{
AlertDialog
alertDialog
=
new
AlertDialog
.
Builder
(
getActivity
())
.
setTitle
(
R
.
string
.
confirm_delete
)
.
setMessage
(
R
.
string
.
validation
)
.
setIcon
(
android
.
R
.
drawable
.
ic_dialog_alert
)
.
setPositiveButton
(
android
.
R
.
string
.
yes
,
new
DialogInterface
.
OnClickListener
()
{
public
void
onClick
(
DialogInterface
dialog
,
int
whichButton
)
{
URI
adressMediaUri
=
null
;
try
{
adressMediaUri
=
new
URI
(
addressMedia
.
get
(
0
));
}
catch
(
URISyntaxException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
File
fileMedia
=
new
File
(
adressMediaUri
);
fileMedia
.
delete
();
mMediaLibrary
.
getMediaItems
().
remove
(
aMedia
);
updateLists
();
}
})
.
setNegativeButton
(
android
.
R
.
string
.
cancel
,
null
).
create
();
alertDialog
.
show
();
}
@Override
public
boolean
onContextItemSelected
(
MenuItem
item
)
{
int
startPosition
;
...
...
@@ -226,33 +251,11 @@ public class AudioBrowserActivity extends SherlockFragment implements ISortable
childPosition
=
0
;
}
if
(
id
==
MENU_DELETE
){
final
int
groupPositionDelete
=
groupPosition
;
AlertDialog
alertDialog
=
new
AlertDialog
.
Builder
(
getActivity
())
.
setTitle
(
R
.
string
.
confirm_delete
)
.
setMessage
(
R
.
string
.
validation
)
.
setIcon
(
android
.
R
.
drawable
.
ic_dialog_alert
)
.
setPositiveButton
(
android
.
R
.
string
.
yes
,
new
DialogInterface
.
OnClickListener
()
{
public
void
onClick
(
DialogInterface
dialog
,
int
whichButton
)
{
List
<
String
>
adressMedia
=
mSongsAdapter
.
getLocation
(
groupPositionDelete
);
URI
adressMediaUri
=
null
;
try
{
adressMediaUri
=
new
URI
(
adressMedia
.
get
(
0
));
}
catch
(
URISyntaxException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
File
fileMedia
=
new
File
(
adressMediaUri
);
fileMedia
.
delete
();
mMediaLibrary
.
getMediaItems
().
remove
(
mSongsAdapter
.
getItem
(
groupPositionDelete
));
updateLists
();
}
})
.
setNegativeButton
(
android
.
R
.
string
.
cancel
,
null
).
create
();
alertDialog
.
show
();
if
(
id
==
MENU_DELETE
)
{
deleteMedia
(
mSongsAdapter
.
getLocation
(
groupPosition
),
mSongsAdapter
.
getItem
(
groupPosition
));
return
true
;
}
if
(
play_all
)
{
startPosition
=
groupPosition
;
medias
=
mSongsAdapter
.
getLocations
();
...
...
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