android:name=".providers.FileContentProvider"
android:authorities="@string/authority"
android:enabled="true"
- android:exported="false"
+ android:exported="true"
android:label="@string/sync_string_files"
android:syncable="true"></provider>
-Subproject commit f02dffb1d3c46305c70d246f696cde7b8c3b0971
+Subproject commit 652cd28bb15672eaedfe8c1d9a46cf293c909b89
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="app_name">ownCloud</string>
<string name="account_type">owncloud</string> <!-- better if was a domain name; but changing it now would require migrate accounts when the app is updated -->
<string name="authority">org.owncloud</string> <!-- better if was the app package with ".provider" appended ; it identifies the provider -->
+ <string name="authorityCache">org.owncloud.imageCache.provider</string>
<string name ="db_file">owncloud.db</string>
<string name ="db_name">ownCloud</string>
<string name ="data_folder">owncloud</string>
<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>
import org.apache.http.protocol.HTTP;
+import java.io.File;
import java.util.List;
/**
}
}
+ public void setPictureAs(OCFile file) {
+ if (file != null){
+ if (file.isDown()) {
+ File externalFile = new File(file.getStoragePath());
+ Uri sendUri = Uri.fromFile(externalFile);
+ Intent intent = new Intent(Intent.ACTION_ATTACH_DATA);
+ intent.setDataAndType(sendUri, file.getMimetype());
+ intent.putExtra("mimeType", file.getMimetype());
+ mFileActivity.startActivityForResult(Intent.createChooser(intent, "Set As"), 200);
+ } else {
+// TODO re-enable after resized images is available
+// Uri sendUri = Uri.parse("content://" + DiskLruImageCacheFileProvider.AUTHORITY + file.getRemotePath());
+// Intent intent = new Intent(Intent.ACTION_ATTACH_DATA);
+// intent.setDataAndType(sendUri, file.getMimetype());
+// intent.putExtra("mimeType", file.getMimetype());
+// mFileActivity.startActivityForResult(Intent.createChooser(intent, "Set As"), 200);
+ }
+ } 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.
*
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
inflater.inflate(R.menu.file_actions_menu, menu);
+
+ MenuItem item = menu.findItem(R.id.action_set_as_wallpaper);
+ item.setVisible(getFile().isDown());
}
/**
mContainerActivity.getFileOperationsHelper().toggleFavorite(getFile(), false);
return true;
}
+ case R.id.action_set_as_wallpaper:{
+ mContainerActivity.getFileOperationsHelper().setPictureAs(getFile());
+ return true;
+ }
default:
return false;
}