projects
/
pub
/
Android
/
ownCloud.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
OC-3079: (fix bug) Two send options appear after send and mail with a ownCloud file
[pub/Android/ownCloud.git]
/
src
/
com
/
owncloud
/
android
/
ui
/
preview
/
PreviewMediaFragment.java
diff --git
a/src/com/owncloud/android/ui/preview/PreviewMediaFragment.java
b/src/com/owncloud/android/ui/preview/PreviewMediaFragment.java
index
83f937a
..
7fa399a
100644
(file)
--- a/
src/com/owncloud/android/ui/preview/PreviewMediaFragment.java
+++ b/
src/com/owncloud/android/ui/preview/PreviewMediaFragment.java
@@
-295,6
+295,12
@@
public class PreviewMediaFragment extends FileFragment implements
toHide.add(R.id.action_unshare_file);
}
toHide.add(R.id.action_unshare_file);
}
+ // Send file
+ boolean sendEnabled = getString(R.string.send_files_to_other_apps).equalsIgnoreCase("on");
+ if (!sendEnabled) {
+ toHide.add(R.id.action_send_file);
+ }
+
for (int i : toHide) {
item = menu.findItem(i);
if (item != null) {
for (int i : toHide) {
item = menu.findItem(i);
if (item != null) {
@@
-351,6
+357,9
@@
public class PreviewMediaFragment extends FileFragment implements
seeDetails();
return true;
}
seeDetails();
return true;
}
+ case R.id.action_send_file: {
+ sendFile();
+ }
default:
return false;
default:
return false;
@@
-380,6
+389,12
@@
public class PreviewMediaFragment extends FileFragment implements
}
}
+ private void sendFile() {
+ stopPreview(false);
+ FileActivity activity = (FileActivity)((FileFragment.ContainerActivity)getActivity());
+ activity.getFileOperationsHelper().sendDownloadedFile(getFile(), activity);
+
+ }
private void seeDetails() {
stopPreview(false);
private void seeDetails() {
stopPreview(false);