mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-15 18:28:47 +00:00
Merge pull request #138 from ClaytonWWilson/aaron-branch-2
Aaron branch 2
This commit is contained in:
commit
46b31b7103
@ -45,6 +45,7 @@ public class ListSharees extends AppCompatActivity implements Requestor.Receiver
|
||||
MyAdapter myAdapter;
|
||||
Requestor requestor;
|
||||
|
||||
Button shareList;
|
||||
Button removeSharee;
|
||||
|
||||
ArrayList<String> lShareeEmails = new ArrayList<>();
|
||||
@ -68,6 +69,23 @@ public class ListSharees extends AppCompatActivity implements Requestor.Receiver
|
||||
listView = findViewById(R.id.listOfSharees);
|
||||
myAdapter = new MyAdapter(this, lShareeEmails);
|
||||
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
|
||||
@ -75,7 +93,7 @@ public class ListSharees extends AppCompatActivity implements Requestor.Receiver
|
||||
ListShare sharee = (ListShare) delivered;
|
||||
|
||||
if(sharee != null) {
|
||||
lShareeEmails.add("sharee.getShareWithEmail()");
|
||||
lShareeEmails.add(sharee.getShareWithEmail());
|
||||
|
||||
if(sharee.getEntries() != null) {
|
||||
for(ListShare ls : sharee.getEntries()) {
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ public class ShoppingListsSwipeableAdapter extends BaseAdapter {
|
||||
holder.swipeLayout = (SwipeRevealLayout)convertView.findViewById(R.id.swipe_layout);
|
||||
holder.frontView = convertView.findViewById(R.id.front_layout);
|
||||
holder.deleteList = convertView.findViewById(R.id.delete_list);
|
||||
// holder.shareList = convertView.findViewById(R.id.share_list);
|
||||
holder.shareList = convertView.findViewById(R.id.share_list);
|
||||
holder.listName = (TextView) convertView.findViewById(R.id.shopping_list_name);
|
||||
holder.itemCount = (TextView) convertView.findViewById(R.id.shopping_list_item_count);
|
||||
|
||||
@ -132,7 +132,6 @@ public class ShoppingListsSwipeableAdapter extends BaseAdapter {
|
||||
|
||||
// Send the list ID and list name
|
||||
listSharees.putExtra("listID", curList.getListID());
|
||||
//listPage.putExtra("listName", curList.getName());
|
||||
|
||||
activity.startActivity(listSharees);
|
||||
}
|
||||
@ -157,7 +156,7 @@ public class ShoppingListsSwipeableAdapter extends BaseAdapter {
|
||||
SwipeRevealLayout swipeLayout;
|
||||
View frontView;
|
||||
View deleteList;
|
||||
// View shareList;
|
||||
View shareList;
|
||||
TextView listName;
|
||||
TextView itemCount;
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="17"
|
||||
android:inputType="textPersonName"
|
||||
android:hint="Sharee's email"
|
||||
android:hint="Share with"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginLeft="10dp"/>
|
||||
|
||||
|
||||
@ -17,12 +17,12 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/share_list"-->
|
||||
<!-- android:src="@drawable/ic_baseline_share_24"-->
|
||||
<!-- android:layout_width="50dp"-->
|
||||
<!-- android:layout_height="50dp"-->
|
||||
<!-- android:background="@color/colorAccent"/>-->
|
||||
<ImageView
|
||||
android:id="@+id/share_list"
|
||||
android:src="@drawable/ic_baseline_share_24"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:background="@color/colorAccent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/delete_list"
|
||||
@ -30,6 +30,7 @@
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:background="@android:color/holo_red_dark"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user