mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +03:00
resolves: #483 - adding proper email sharee handling
This commit is contained in:
parent
6f77ef8f4b
commit
f79b7ca2c0
10 changed files with 12 additions and 6 deletions
BIN
res/drawable-hdpi/ic_email.png
Normal file
BIN
res/drawable-hdpi/ic_email.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 604 B |
BIN
res/drawable-mdpi/ic_email.png
Normal file
BIN
res/drawable-mdpi/ic_email.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 456 B |
BIN
res/drawable-xhdpi/ic_email.png
Normal file
BIN
res/drawable-xhdpi/ic_email.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 737 B |
BIN
res/drawable-xxhdpi/ic_email.png
Normal file
BIN
res/drawable-xxhdpi/ic_email.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1 KiB |
BIN
res/drawable-xxxhdpi/ic_email.png
Normal file
BIN
res/drawable-xxxhdpi/ic_email.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
|
@ -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"/>
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue