-Subproject commit f02dffb1d3c46305c70d246f696cde7b8c3b0971
+Subproject commit 59fb61601de4dd8bfcab1afb619e016e1a7b904d
android:icon="@android:drawable/ic_menu_set_as"
android:orderInCategory="1" />
<item
+ android:id="@+id/action_set_as_wallpaper"
+ android:title="@string/set_picture_as"
+ android:icon="@android:drawable/ic_menu_set_as"
+ android:orderInCategory="1" />
+ <item
android:id="@+id/action_see_details"
android:title="@string/actionbar_see_details"
android:icon="@android:drawable/ic_menu_info_details"
<string name="file_list__footer__files">%1$d files</string>
<string name="file_list__footer__files_and_folder">%1$d files, 1 folder</string>
<string name="file_list__footer__files_and_folders">%1$d files, %2$d folders</string>
+ <string name="set_picture_as">Set picture as</string>
</resources>
}
}
+ public void setPictureAs(OCFile file) {
+ if (file != null) {
+ String storagePath = file.getStoragePath();
+ String encodedStoragePath = WebdavUtils.encodePath(storagePath);
+ Intent sendIntent = new Intent(Intent.ACTION_ATTACH_DATA);
+ // set MimeType
+ sendIntent.setData(Uri.parse(encodedStoragePath));
+// sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + encodedStoragePath));
+// sendIntent.putExtra("jpg", "image/*");
+
+ mFileActivity.startActivity(Intent.createChooser(sendIntent,
+ mFileActivity.getString(R.string.set_picture_as)));
+
+ } else {
+ Log_OC.wtf(TAG, "Trying to send a NULL OCFile");
+ }
+ }
+
/**
* Request the synchronization of a file or folder with the OC server, including its contents.
*
mContainerActivity.getFileOperationsHelper().toggleFavorite(getFile(), false);
return true;
}
+ case R.id.action_set_as_wallpaper:{
+ mContainerActivity.getFileOperationsHelper().setPictureAs(getFile());
+ return true;
+ }
default:
return false;
}