use of com.github.asifmujteba.easyvolleysample.UI.adapters.ProductsAdapter in project EasyVolley by asifmujteba.
the class ProductsActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
productsAdapter = new ProductsAdapter(mContext, new ArrayList<Product>());
gridView.setEmptyView(emptyElement);
gridView.setAdapter(productsAdapter);
gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Product product = productsAdapter.getItem(position);
DetailsActivity.launch(mContext, product, (ImageView) view.findViewById(R.id.imageView));
}
});
swipeContainer.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
loadProducts();
}
});
loadProducts();
}
Aggregations