mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-13 09:48:47 +00:00
Merge pull request #165 from ClaytonWWilson/aaron-branch-2
Aaron branch 2
This commit is contained in:
commit
f8e2a2f0fe
@ -170,8 +170,6 @@ public class ListPage extends AppCompatActivity implements Requestor.Receiver, R
|
||||
//Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.list, menu);
|
||||
|
||||
|
||||
|
||||
MenuItem renameItem = menu.findItem(R.id.action_rename_list);
|
||||
renameItem.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
||||
@Override
|
||||
@ -186,7 +184,9 @@ public class ListPage extends AppCompatActivity implements Requestor.Receiver, R
|
||||
shareItem.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
Toast.makeText(ListPage.this, "Share List", Toast.LENGTH_SHORT).show();
|
||||
Intent listSharees = new Intent(ListPage.this, ListSharees.class);
|
||||
listSharees.putExtra("listID", selectedList.getListID());
|
||||
ListPage.this.startActivity(listSharees);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
@ -195,7 +195,6 @@ public class ListPage extends AppCompatActivity implements Requestor.Receiver, R
|
||||
duplicateItem.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
|
||||
ListDuplicate duplicate = new ListDuplicate(selectedList.getListID(), String.format("%s copy", selectedList.getName()));
|
||||
|
||||
Properties configs = new Properties();
|
||||
|
||||
@ -94,10 +94,10 @@ public class ShoppingListsAdapter extends BaseAdapter implements Requestor.Recei
|
||||
@Override
|
||||
public void run() {
|
||||
if(sharee.getShareWithEmail().equals(am.getEmail(requestor))) {
|
||||
tvListName.setText(curList.getName() + " (sh. me)");
|
||||
tvListName.setText(curList.getName() + " (sh. by me)");
|
||||
}
|
||||
else {
|
||||
tvListName.setText(curList.getName() + " (sh. " + sharee.getShareWithEmail() + ")");
|
||||
tvListName.setText(curList.getName() + " (sh. by " + sharee.getShareWithEmail() + ")");
|
||||
}
|
||||
|
||||
String listText = tvListName.getText().toString();
|
||||
|
||||
@ -61,10 +61,10 @@ public class ShoppingListsSwipeableAdapter extends BaseAdapter implements Reques
|
||||
@Override
|
||||
public void run() {
|
||||
if(sharee.getShareWithEmail().equals(am.getEmail(requestor))) {
|
||||
holder.listName.setText(curList.getName() + " (sh. me)");
|
||||
holder.listName.setText(curList.getName() + " (sh. by me)");
|
||||
}
|
||||
else {
|
||||
holder.listName.setText(curList.getName() + " (sh. " + sharee.getShareWithEmail() + ")");
|
||||
holder.listName.setText(curList.getName() + " (sh. by " + sharee.getShareWithEmail() + ")");
|
||||
}
|
||||
|
||||
String listText = holder.listName.getText().toString();
|
||||
@ -97,7 +97,7 @@ public class ShoppingListsSwipeableAdapter extends BaseAdapter implements Reques
|
||||
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);
|
||||
|
||||
@ -147,14 +147,14 @@ public class ShoppingListsSwipeableAdapter extends BaseAdapter implements Reques
|
||||
}
|
||||
});
|
||||
|
||||
holder.shareList.setOnClickListener(new View.OnClickListener() {
|
||||
/*holder.shareList.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent listSharees = new Intent(activity, ListSharees.class);
|
||||
listSharees.putExtra("listID", curList.getListID());
|
||||
activity.startActivity(listSharees);
|
||||
}
|
||||
});
|
||||
});*/
|
||||
|
||||
holder.frontView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@ -172,7 +172,7 @@ public class ShoppingListsSwipeableAdapter extends BaseAdapter implements Reques
|
||||
SwipeRevealLayout swipeLayout;
|
||||
View frontView;
|
||||
View deleteList;
|
||||
View shareList;
|
||||
//View shareList;
|
||||
TextView listName;
|
||||
TextView itemCount;
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.example.listify.ui.store;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.net.Uri;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
@ -55,7 +56,7 @@ public class StoreFragment extends Fragment {
|
||||
storeURLs.add("https://www.ebay.com/");
|
||||
|
||||
listView = root.findViewById(R.id.listOfStores);
|
||||
myAdapter = new StoreFragment.MyAdapter(this.getContext(), storeLogos, storeNames, storeNames);
|
||||
myAdapter = new StoreFragment.MyAdapter(this.getContext(), storeLogos, storeNames, storeURLs);
|
||||
listView.setAdapter(myAdapter);
|
||||
|
||||
return root;
|
||||
@ -63,9 +64,9 @@ public class StoreFragment extends Fragment {
|
||||
|
||||
class MyAdapter extends ArrayAdapter<String> {
|
||||
Context context;
|
||||
ArrayList<Integer> storeLogos = new ArrayList<>();
|
||||
ArrayList<String> storeNames = new ArrayList<>();
|
||||
ArrayList<String> storeURLs = new ArrayList<>();
|
||||
ArrayList<Integer> storeLogos;
|
||||
ArrayList<String> storeNames;
|
||||
ArrayList<String> storeURLs;
|
||||
|
||||
MyAdapter (Context c, ArrayList<Integer> logos, ArrayList<String> names, ArrayList<String> urls) {
|
||||
super(c, R.layout.shopping_list_product_entry, R.id.productView, names);
|
||||
@ -111,10 +112,12 @@ public class StoreFragment extends Fragment {
|
||||
name.setText(storeNames.get(position));
|
||||
name.setTextColor(Color.parseColor("#0000FF"));
|
||||
name.setTextSize(20);
|
||||
name.setPaintFlags(name.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
|
||||
name.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
gotoUrl(storeURLs.get(position));
|
||||
Uri uri = Uri.parse(storeURLs.get(position));
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, uri));
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -127,9 +130,4 @@ public class StoreFragment extends Fragment {
|
||||
return listproduct;
|
||||
}
|
||||
}
|
||||
|
||||
private void gotoUrl(String url) {
|
||||
Uri u = Uri.parse(url);
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, u));
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,12 +17,12 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
<!--<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"/>
|
||||
android:background="@color/colorAccent"/>-->
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/delete_list"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user