From: tobiasKaminsky Date: Fri, 6 Nov 2015 16:35:52 +0000 (+0100) Subject: Merge branch 'setAsWallpaper' into beta X-Git-Tag: beta-20151122~31 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/9248c9263676274636d68473367aa01f2c5fd523?ds=inline;hp=-c Merge branch 'setAsWallpaper' into beta --- 9248c9263676274636d68473367aa01f2c5fd523 diff --combined src/com/owncloud/android/files/FileMenuFilter.java index 917f9365,ca3b10bf..e6638ba0 --- a/src/com/owncloud/android/files/FileMenuFilter.java +++ b/src/com/owncloud/android/files/FileMenuFilter.java @@@ -29,7 -29,6 +29,7 @@@ import android.view.Menu import android.view.MenuItem; import com.owncloud.android.R; +import com.owncloud.android.authentication.AccountUtils; import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.files.services.FileDownloader; import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder; @@@ -58,8 -57,7 +58,8 @@@ public class FileMenuFilter * {@link FileUploader} and {@link FileDownloader} services * @param context Android {@link Context}, needed to access build setup resources. */ - public FileMenuFilter(OCFile targetFile, Account account, ComponentsGetter cg, Context context) { + public FileMenuFilter(OCFile targetFile, Account account, ComponentsGetter cg, + Context context) { mFile = targetFile; mAccount = account; mComponentsGetter = cg; @@@ -181,7 -179,7 +181,7 @@@ toShow.add(R.id.action_sync_file); } - // SHARE FILE + // SHARE FILE // TODO add check on SHARE available on server side? boolean shareAllowed = (mContext != null && mContext.getString(R.string.share_feature).equalsIgnoreCase("on")); @@@ -191,22 -189,14 +191,22 @@@ toShow.add(R.id.action_share_file); } - // UNSHARE FILE + // UNSHARE FILE // TODO add check on SHARE available on server side? - if ( !shareAllowed || (mFile == null || !mFile.isShareByLink())) { + if ( !shareAllowed || (mFile == null || !mFile.isSharedViaLink())) { toHide.add(R.id.action_unshare_file); } else { toShow.add(R.id.action_unshare_file); } + // SHARE FILE, with Users + if (!shareAllowed || mFile == null) { + toHide.add(R.id.action_share_with_users); + } else { + toShow.add(R.id.action_share_with_users); + } + + // SEE DETAILS if (mFile == null || mFile.isFolder()) { toHide.add(R.id.action_see_details); @@@ -237,13 -227,13 +237,20 @@@ toShow.add(R.id.action_unfavorite_file); } + // STREAM + if (mFile != null && !mFile.isDown() && (mFile.isAudio() || mFile.isVideo())){ + toShow.add(R.id.action_stream_file); + } else { + toHide.add(R.id.action_stream_file); + } + + // SET PICTURE AS + if (mFile == null || !mFile.isImage()){ + toHide.add(R.id.action_set_as_wallpaper); + } else { + toShow.add(R.id.action_set_as_wallpaper); + } + } }