use of cn.liuyin.manhua.adapter.SearchAdapter in project Manhua by ag2s20150909.
the class SearchActivity method showList.
private void showList(final SearchResult data) {
SearchAdapter adapter = new SearchAdapter(this, data);
lv.setLayoutAnimation(new LayoutAnimationController(AnimationUtils.loadAnimation(this, R.anim.list_animation), 0.5f));
lv.setAdapter(adapter);
Toast.makeText(getApplicationContext(), "共有" + (data.results.size()) + "条结果", Toast.LENGTH_LONG).show();
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> p1, View p2, int p3, long p4) {
try {
BookShelf.addBook(data.results.get(p3));
Intent i = new Intent(getApplicationContext(), ListActivity.class);
i.putExtra("url", data.results.get(p3).link);
i.putExtra("book", data.results.get(p3));
// Toast.makeText(getApplicationContext(), data.get(p3).get("link"), 1).show();
startActivity(i);
} catch (Exception e) {
mHander.obtainMessage(0, e.getMessage()).sendToTarget();
}
}
});
}
use of cn.liuyin.manhua.adapter.SearchAdapter in project Manhua by ag2s20150909.
the class HomeActivity method showList.
private void showList(final SearchResult data) {
SearchAdapter adapter = new SearchAdapter(this, data);
lv.setLayoutAnimation(new LayoutAnimationController(AnimationUtils.loadAnimation(this, R.anim.list_animation), 0.5f));
lv.setAdapter(adapter);
Toast.makeText(getApplicationContext(), "共有" + (data.results.size()) + "条结果", Toast.LENGTH_LONG).show();
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> p1, View p2, int p3, long p4) {
try {
BookShelf.addBook(data.results.get(p3));
Intent i = new Intent(getApplicationContext(), ListActivity.class);
i.putExtra("url", data.results.get(p3).link);
i.putExtra("book", data.results.get(p3));
// Toast.makeText(getApplicationContext(), data.get(p3).get("link"), 1).show();
startActivity(i);
} catch (Exception e) {
mHander.obtainMessage(0, e.getMessage()).sendToTarget();
}
}
});
}
Aggregations