mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-15 18:28:47 +00:00
Merge pull request #152 from ClaytonWWilson/aaron-branch-2
Aaron branch 2
This commit is contained in:
commit
8c11a3328f
@ -59,8 +59,6 @@ public class ListShareGetter implements CallHandler{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Insert the ListShare objects to hold the data of the remaining rows into first's ListShare list
|
//Insert the ListShare objects to hold the data of the remaining rows into first's ListShare list
|
||||||
while (getListResults.next()) {
|
while (getListResults.next()) {
|
||||||
InvokeRequest invokeRequest = new InvokeRequest();
|
InvokeRequest invokeRequest = new InvokeRequest();
|
||||||
|
|||||||
@ -58,11 +58,6 @@ public class ListSharer implements CallHandler {
|
|||||||
throw new InputMismatchException("Could not find specified user to share with");
|
throw new InputMismatchException("Could not find specified user to share with");
|
||||||
}
|
}
|
||||||
String shareWithSub = new Gson().fromJson(new String(invokeResult.getPayload().array()), User.class).cognitoID;
|
String shareWithSub = new Gson().fromJson(new String(invokeResult.getPayload().array()), User.class).cognitoID;
|
||||||
// checkAccess.setString(2, shareWithSub);
|
|
||||||
// checkAccessRS = checkAccess.executeQuery();
|
|
||||||
// if (checkAccessRS.next()) {
|
|
||||||
// throw new InputMismatchException("The specified user already has access");
|
|
||||||
// }
|
|
||||||
|
|
||||||
PreparedStatement uiPositionCheck = connection.prepareStatement(UI_POSITION_CHECK);
|
PreparedStatement uiPositionCheck = connection.prepareStatement(UI_POSITION_CHECK);
|
||||||
uiPositionCheck.setString(1, shareWithSub);
|
uiPositionCheck.setString(1, shareWithSub);
|
||||||
|
|||||||
@ -55,10 +55,12 @@ public class ListSharees extends AppCompatActivity implements Requestor.Receiver
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
EditText sharedEmailText = (EditText) findViewById(R.id.editTextShareeEmail);
|
EditText sharedEmailText = (EditText) findViewById(R.id.editTextShareeEmail);
|
||||||
String sharedEmail = sharedEmailText.getText().toString();
|
String sharedEmail = sharedEmailText.getText().toString();
|
||||||
|
|
||||||
ListShare listShare = new ListShare(listID, sharedEmail, "Read, Write, Delete, Share", null);
|
ListShare listShare = new ListShare(listID, sharedEmail, "Read, Write, Delete, Share", null);
|
||||||
try {
|
try {
|
||||||
requestor.putObject(listShare);
|
requestor.putObject(listShare);
|
||||||
|
lShareeEntries.add(listShare);
|
||||||
|
lShareeEmails.add(sharedEmail);
|
||||||
|
myAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
catch(Exception e) {
|
catch(Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -72,8 +74,8 @@ public class ListSharees extends AppCompatActivity implements Requestor.Receiver
|
|||||||
ListShare sharee = (ListShare) delivered;
|
ListShare sharee = (ListShare) delivered;
|
||||||
|
|
||||||
if(sharee != null) {
|
if(sharee != null) {
|
||||||
lShareeEmails.add(sharee.getShareWithEmail());
|
|
||||||
lShareeEntries.add(sharee);
|
lShareeEntries.add(sharee);
|
||||||
|
lShareeEmails.add(sharee.getShareWithEmail());
|
||||||
|
|
||||||
if(sharee.getEntries() != null) {
|
if(sharee.getEntries() != null) {
|
||||||
for(ListShare ls : sharee.getEntries()) {
|
for(ListShare ls : sharee.getEntries()) {
|
||||||
@ -119,7 +121,7 @@ public class ListSharees extends AppCompatActivity implements Requestor.Receiver
|
|||||||
try {
|
try {
|
||||||
lShareeEntries.get(position).setPermissionLevel(0);
|
lShareeEntries.get(position).setPermissionLevel(0);
|
||||||
ListShare toRemove = lShareeEntries.remove(position);
|
ListShare toRemove = lShareeEntries.remove(position);
|
||||||
System.out.println(toRemove);
|
lShareeEmails.remove(position);
|
||||||
requestor.putObject(toRemove);
|
requestor.putObject(toRemove);
|
||||||
myAdapter.notifyDataSetChanged();
|
myAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
@ -129,6 +131,11 @@ public class ListSharees extends AppCompatActivity implements Requestor.Receiver
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if(shareeEmail.getText().toString().equals(am.getEmail(requestor))) {
|
||||||
|
shareeEmail.setVisibility(View.GONE);
|
||||||
|
removeSharee.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
return listproduct;
|
return listproduct;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user