Esempio n. 1
0
 public void showList(List<Poem> poems) {
   // 第一次加载
   if (poemListAdapter == null) {
     poemListAdapter = new PoemListAdapter(getActivity(), poems);
     listView.setILoadListener(new LoadListener());
     listView.setAdapter(poemListAdapter);
   } else {
     poemListAdapter.onDateChange(poems);
   }
 }
Esempio n. 2
0
 public List<Poem> getData() {
   if (RANDOM.equals(classfy)) {
     return jsonUtil.getRandomPoem();
   } else if (AUTHOR.equals(classfy)) {
     List<Poem> poems = jsonUtil.getPoemByAuthorName(info, listView.getPage());
     if (poems.size() >= 1) {
       return poems;
     }
     return null;
   } else if (STYLE.equals(classfy)) {
     List<Poem> poems = jsonUtil.getPoemByTag(info, listView.getPage());
     if (poems.size() >= 1) {
       return poems;
     }
     return null;
   }
   // TODO还没有做完,分类没有全部完成
   return jsonUtil.getRandomPoem();
 }
Esempio n. 3
0
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_loadlist, container, false);
    listView = (LoadListView) view.findViewById(R.id.load_listview);

    initData();

    listView.setOnItemClickListener(new poemItemClickLlistener());
    return view;
  }