mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-15 18:28:47 +00:00
Fixed the links to the store sites
This commit is contained in:
parent
c23b980ff2
commit
964864f0fc
@ -56,7 +56,7 @@ public class StoreFragment extends Fragment {
|
|||||||
storeURLs.add("https://www.ebay.com/");
|
storeURLs.add("https://www.ebay.com/");
|
||||||
|
|
||||||
listView = root.findViewById(R.id.listOfStores);
|
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);
|
listView.setAdapter(myAdapter);
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
@ -64,9 +64,9 @@ public class StoreFragment extends Fragment {
|
|||||||
|
|
||||||
class MyAdapter extends ArrayAdapter<String> {
|
class MyAdapter extends ArrayAdapter<String> {
|
||||||
Context context;
|
Context context;
|
||||||
ArrayList<Integer> storeLogos = new ArrayList<>();
|
ArrayList<Integer> storeLogos;
|
||||||
ArrayList<String> storeNames = new ArrayList<>();
|
ArrayList<String> storeNames;
|
||||||
ArrayList<String> storeURLs = new ArrayList<>();
|
ArrayList<String> storeURLs;
|
||||||
|
|
||||||
MyAdapter (Context c, ArrayList<Integer> logos, ArrayList<String> names, ArrayList<String> urls) {
|
MyAdapter (Context c, ArrayList<Integer> logos, ArrayList<String> names, ArrayList<String> urls) {
|
||||||
super(c, R.layout.shopping_list_product_entry, R.id.productView, names);
|
super(c, R.layout.shopping_list_product_entry, R.id.productView, names);
|
||||||
@ -116,7 +116,8 @@ public class StoreFragment extends Fragment {
|
|||||||
name.setOnClickListener(new View.OnClickListener() {
|
name.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
gotoUrl(storeURLs.get(position));
|
Uri uri = Uri.parse(storeURLs.get(position));
|
||||||
|
startActivity(new Intent(Intent.ACTION_VIEW, uri));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -129,9 +130,4 @@ public class StoreFragment extends Fragment {
|
|||||||
return listproduct;
|
return listproduct;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void gotoUrl(String url) {
|
|
||||||
Uri u = Uri.parse(url);
|
|
||||||
startActivity(new Intent(Intent.ACTION_VIEW, u));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user