projects
/
pub
/
Android
/
ownCloud.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
adde411
)
Good behaviiour in servers not supporting SHAREE API: show the menu option and a...
author
masensio
<masensio@solidgear.es>
Mon, 26 Oct 2015 12:13:06 +0000
(13:13 +0100)
committer
David A. Velasco
<dvelasco@solidgear.es>
Fri, 30 Oct 2015 15:50:49 +0000
(16:50 +0100)
res/values/strings.xml
patch
|
blob
|
blame
|
history
src/com/owncloud/android/files/FileMenuFilter.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/ui/fragment/ShareFileFragment.java
patch
|
blob
|
blame
|
history
diff --git
a/res/values/strings.xml
b/res/values/strings.xml
index
591527d
..
2458d70
100644
(file)
--- a/
res/values/strings.xml
+++ b/
res/values/strings.xml
@@
-375,4
+375,7
@@
<string name="search_users_and_groups_hint">Search users and groups</string>
<string name="share_group_clarification">%1$s (group)</string>
<string name="search_users_and_groups_hint">Search users and groups</string>
<string name="share_group_clarification">%1$s (group)</string>
+ <string name="share_sharee_unavailable">Sorry, your server version does not allow share with users within clients.
+ \nPlease contact your administrator</string>
+
</resources>
</resources>
diff --git
a/src/com/owncloud/android/files/FileMenuFilter.java
b/src/com/owncloud/android/files/FileMenuFilter.java
index
8c04842
..
66ada1c
100644
(file)
--- a/
src/com/owncloud/android/files/FileMenuFilter.java
+++ b/
src/com/owncloud/android/files/FileMenuFilter.java
@@
-107,7
+107,6
@@
public class FileMenuFilter {
* @param toHide List to save the options that must be shown in the menu.
*/
private void filter(List<Integer> toShow, List <Integer> toHide) {
* @param toHide List to save the options that must be shown in the menu.
*/
private void filter(List<Integer> toShow, List <Integer> toHide) {
- boolean shareWithUsersEnable = false;
boolean synchronizing = false;
if (mComponentsGetter != null && mFile != null && mAccount != null) {
OperationsServiceBinder opsBinder = mComponentsGetter.getOperationsServiceBinder();
boolean synchronizing = false;
if (mComponentsGetter != null && mFile != null && mAccount != null) {
OperationsServiceBinder opsBinder = mComponentsGetter.getOperationsServiceBinder();
@@
-121,7
+120,6
@@
public class FileMenuFilter {
// uploading
(uploaderBinder != null && uploaderBinder.isUploading(mAccount, mFile))
);
// uploading
(uploaderBinder != null && uploaderBinder.isUploading(mAccount, mFile))
);
- shareWithUsersEnable = AccountUtils.hasSearchUsersSupport(mAccount);
}
/// decision is taken for each possible action on a file in the menu
}
/// decision is taken for each possible action on a file in the menu
@@
-202,7
+200,7
@@
public class FileMenuFilter {
}
// SHARE FILE, with Users
}
// SHARE FILE, with Users
- if (!shareAllowed ||
!shareWithUsersEnable ||
mFile == null) {
+ if (!shareAllowed || mFile == null) {
toHide.add(R.id.action_share_with_users);
} else {
toShow.add(R.id.action_share_with_users);
toHide.add(R.id.action_share_with_users);
} else {
toShow.add(R.id.action_share_with_users);
diff --git
a/src/com/owncloud/android/ui/fragment/ShareFileFragment.java
b/src/com/owncloud/android/ui/fragment/ShareFileFragment.java
index
1b95186
..
7051767
100644
(file)
--- a/
src/com/owncloud/android/ui/fragment/ShareFileFragment.java
+++ b/
src/com/owncloud/android/ui/fragment/ShareFileFragment.java
@@
-32,8
+32,10
@@
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
+import android.widget.Toast;
import com.owncloud.android.R;
import com.owncloud.android.R;
+import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.datamodel.ThumbnailsCacheManager;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.datamodel.ThumbnailsCacheManager;
import com.owncloud.android.lib.common.utils.Log_OC;
@@
-137,8
+139,14
@@
public class ShareFileFragment extends Fragment
addUserGroupButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
addUserGroupButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- // Show Search Fragment
- mListener.showSearchUsersAndGroups(mShares);
+ boolean shareWithUsersEnable = AccountUtils.hasSearchUsersSupport(mAccount);
+ if (shareWithUsersEnable) {
+ // Show Search Fragment
+ mListener.showSearchUsersAndGroups(mShares);
+ } else {
+ String message = getString(R.string.share_sharee_unavailable);
+ Toast.makeText(getActivity(), message, Toast.LENGTH_LONG).show();
+ }
}
});
}
});