From: David A. Velasco Date: Wed, 24 Apr 2013 09:04:23 +0000 (+0200) Subject: Avoid duplicated 'refresh file' entry in context menu on an item in the list of files X-Git-Tag: oc-android-1.4.3~27^2~5 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/6a6d83311f01da26ce50b4f64111c254022eb47b Avoid duplicated 'refresh file' entry in context menu on an item in the list of files --- diff --git a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java index dac32c85..4b6d9a23 100644 --- a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java +++ b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java @@ -173,6 +173,7 @@ public class OCFileListFragment extends FragmentListView implements EditNameDial toHide.add(R.id.action_download_file); toHide.add(R.id.action_cancel_download); toHide.add(R.id.action_cancel_upload); + toHide.add(R.id.action_sync_file); toHide.add(R.id.action_see_details); if ( mContainerActivity.getFileDownloaderBinder().isDownloading(AccountUtils.getCurrentOwnCloudAccount(getActivity()), targetFile) || mContainerActivity.getFileUploaderBinder().isUploading(AccountUtils.getCurrentOwnCloudAccount(getActivity()), targetFile) ) { @@ -186,12 +187,11 @@ public class OCFileListFragment extends FragmentListView implements EditNameDial if (targetFile.isDown()) { toHide.add(R.id.action_cancel_download); toHide.add(R.id.action_cancel_upload); - item = menu.findItem(R.id.action_download_file); - if (item != null) { - item.setTitle(R.string.filedetails_sync_file); - } + toHide.add(R.id.action_download_file); + } else { toHide.add(R.id.action_open_file_with); + toHide.add(R.id.action_sync_file); } if ( mContainerActivity.getFileDownloaderBinder().isDownloading(AccountUtils.getCurrentOwnCloudAccount(getActivity()), targetFile)) { toHide.add(R.id.action_download_file); @@ -314,7 +314,8 @@ public class OCFileListFragment extends FragmentListView implements EditNameDial } return true; } - case R.id.action_download_file: { + case R.id.action_download_file: + case R.id.action_sync_file: { Account account = AccountUtils.getCurrentOwnCloudAccount(getSherlockActivity()); RemoteOperation operation = new SynchronizeFileOperation(mTargetFile, null, mContainerActivity.getStorageManager(), account, true, false, getSherlockActivity()); WebdavClient wc = OwnCloudClientUtils.createOwnCloudClient(account, getSherlockActivity().getApplicationContext());