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
Ewout ter Hoeven
VLC-Android
Commits
a8ed63c9
Commit
a8ed63c9
authored
Sep 01, 2014
by
Edward Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CommonDialogs: add confirmDialog
parent
dec3d729
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
12 deletions
+21
-12
vlc-android/src/org/videolan/vlc/gui/CommonDialogs.java
vlc-android/src/org/videolan/vlc/gui/CommonDialogs.java
+21
-12
No files found.
vlc-android/src/org/videolan/vlc/gui/CommonDialogs.java
View file @
a8ed63c9
...
@@ -67,19 +67,28 @@ public class CommonDialogs {
...
@@ -67,19 +67,28 @@ public class CommonDialogs {
}
}
final
File
fileMedia
=
new
File
(
adressMediaUri
);
final
File
fileMedia
=
new
File
(
adressMediaUri
);
return
confirmDialog
(
context
,
context
.
getResources
().
getString
(
R
.
string
.
confirm_delete
,
fileMedia
.
getName
()),
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
whichButton
)
{
fileMedia
.
delete
();
if
(
runnable
!=
null
)
runnable
.
run
();
}
});
}
public
static
AlertDialog
confirmDialog
(
final
Context
context
,
final
String
confirmationString
,
final
DialogInterface
.
OnClickListener
callback
)
{
AlertDialog
alertDialog
=
new
AlertDialog
.
Builder
(
context
)
AlertDialog
alertDialog
=
new
AlertDialog
.
Builder
(
context
)
.
setTitle
(
R
.
string
.
validation
)
.
setTitle
(
R
.
string
.
validation
).
setMessage
(
confirmationString
)
.
setMessage
(
context
.
getResources
().
getString
(
R
.
string
.
confirm_delete
,
fileMedia
.
getName
()))
.
setIcon
(
android
.
R
.
drawable
.
ic_dialog_alert
)
.
setIcon
(
android
.
R
.
drawable
.
ic_dialog_alert
)
.
setPositiveButton
(
android
.
R
.
string
.
yes
,
callback
)
.
setPositiveButton
(
android
.
R
.
string
.
yes
,
new
DialogInterface
.
OnClickListener
()
{
.
setNegativeButton
(
android
.
R
.
string
.
cancel
,
null
).
create
();
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
whichButton
)
{
fileMedia
.
delete
();
if
(
runnable
!=
null
)
runnable
.
run
();
}
})
.
setNegativeButton
(
android
.
R
.
string
.
cancel
,
null
).
create
();
return
alertDialog
;
return
alertDialog
;
}
}
...
...
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