resolves: #483 - adding proper email sharee handling

This commit is contained in:
AndyScherzinger 2016-12-30 17:25:54 +01:00
parent 6f77ef8f4b
commit f79b7ca2c0
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
10 changed files with 12 additions and 6 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 737 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -60,7 +60,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/editShareButton"
android:src="@drawable/ic_navigate_next"
android:src="@drawable/ic_dots_vertical"
android:padding="@dimen/standard_half_padding"
android:layout_gravity="center_vertical"/>

View file

@ -471,6 +471,7 @@
<string name="search_users_and_groups_hint">Search users and groups</string>
<string name="share_group_clarification">%1$s (group)</string>
<string name="share_remote_clarification">%1$s (remote)</string>
<string name="share_email_clarification">%1$s (email)</string>
<string name="share_known_remote_clarification">%1$s ( at %2$s )</string>
<string name="share_sharee_unavailable">Sorry, your server version does not allow share with users within clients.

View file

@ -1582,10 +1582,12 @@ public class FileDataStorageManager {
+ ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + AND
+ " (" + ProviderTableMeta.OCSHARES_SHARE_TYPE + "=? OR "
+ ProviderTableMeta.OCSHARES_SHARE_TYPE + "=? OR "
+ ProviderTableMeta.OCSHARES_SHARE_TYPE + "=? OR "
+ ProviderTableMeta.OCSHARES_SHARE_TYPE + "=? ) ";
String [] whereArgs = new String[]{ filePath, accountName ,
Integer.toString(ShareType.USER.getValue()),
Integer.toString(ShareType.GROUP.getValue()),
Integer.toString(ShareType.EMAIL.getValue()),
Integer.toString(ShareType.FEDERATED.getValue())};
Cursor cursor = null;

View file

@ -336,6 +336,7 @@ public class FileContentProvider extends ContentProvider {
} else if (
newShareType == ShareType.USER.getValue() ||
newShareType == ShareType.GROUP.getValue() ||
newShareType == ShareType.EMAIL.getValue() ||
newShareType == ShareType.FEDERATED.getValue() ) {
fileValues.put(ProviderTableMeta.FILE_SHARED_WITH_SHAREE, 1);
}

View file

@ -78,17 +78,23 @@ public class ShareUserListAdapter extends ArrayAdapter {
TextView userName = (TextView) view.findViewById(R.id.userOrGroupName);
ImageView iconView = (ImageView) view.findViewById(R.id.icon);
final ImageView editShareButton = (ImageView) view.findViewById(R.id.editShareButton);
final ImageView unshareButton = (ImageView) view.findViewById(R.id.unshareButton);
String name = share.getSharedWithDisplayName();
Drawable icon = getContext().getResources().getDrawable(R.drawable.ic_user);
if (share.getShareType() == ShareType.GROUP) {
name = getContext().getString(R.string.share_group_clarification, name);
icon = getContext().getResources().getDrawable(R.drawable.ic_group);
} else if (share.getShareType() == ShareType.EMAIL) {
name = getContext().getString(R.string.share_email_clarification, name);
icon = getContext().getResources().getDrawable(R.drawable.ic_email);
editShareButton.setVisibility(View.INVISIBLE);
}
userName.setText(name);
iconView.setImageDrawable(icon);
/// bind listener to edit privileges
final ImageView editShareButton = (ImageView) view.findViewById(R.id.editShareButton);
editShareButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -97,7 +103,6 @@ public class ShareUserListAdapter extends ArrayAdapter {
});
/// bind listener to unshare
final ImageView unshareButton = (ImageView) view.findViewById(R.id.unshareButton);
unshareButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -113,7 +118,4 @@ public class ShareUserListAdapter extends ArrayAdapter {
void unshareButtonPressed(OCShare share);
void editShare(OCShare share);
}
}