mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-16 10:48:46 +00:00
Can now share list in Sharee page
This commit is contained in:
parent
78186ffbc4
commit
5cb920f494
@ -45,6 +45,7 @@ public class ListSharees extends AppCompatActivity implements Requestor.Receiver
|
|||||||
MyAdapter myAdapter;
|
MyAdapter myAdapter;
|
||||||
Requestor requestor;
|
Requestor requestor;
|
||||||
|
|
||||||
|
Button shareList;
|
||||||
Button removeSharee;
|
Button removeSharee;
|
||||||
|
|
||||||
ArrayList<String> lShareeEmails = new ArrayList<>();
|
ArrayList<String> lShareeEmails = new ArrayList<>();
|
||||||
@ -68,6 +69,23 @@ public class ListSharees extends AppCompatActivity implements Requestor.Receiver
|
|||||||
listView = findViewById(R.id.listOfSharees);
|
listView = findViewById(R.id.listOfSharees);
|
||||||
myAdapter = new MyAdapter(this, lShareeEmails);
|
myAdapter = new MyAdapter(this, lShareeEmails);
|
||||||
listView.setAdapter(myAdapter);
|
listView.setAdapter(myAdapter);
|
||||||
|
|
||||||
|
shareList = (Button) findViewById(R.id.buttonShare);
|
||||||
|
shareList.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
EditText sharedEmailText = (EditText) findViewById(R.id.editTextShareeEmail);
|
||||||
|
String sharedEmail = sharedEmailText.getText().toString();
|
||||||
|
|
||||||
|
ListShare listShare = new ListShare(listID, sharedEmail, "Read, Write, Delete, Share", null);
|
||||||
|
try {
|
||||||
|
requestor.putObject(listShare);
|
||||||
|
}
|
||||||
|
catch(Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -122,6 +140,12 @@ public class ListSharees extends AppCompatActivity implements Requestor.Receiver
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//No need to show owner
|
||||||
|
if(position == 0) {
|
||||||
|
shareeEmail.setVisibility(View.GONE);
|
||||||
|
removeSharee.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
return listproduct;
|
return listproduct;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:ems="17"
|
android:ems="17"
|
||||||
android:inputType="textPersonName"
|
android:inputType="textPersonName"
|
||||||
android:hint="Sharee's email"
|
android:hint="Share with"
|
||||||
android:layout_marginTop="30dp"
|
android:layout_marginTop="30dp"
|
||||||
android:layout_marginLeft="10dp"/>
|
android:layout_marginLeft="10dp"/>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user