コード例 #1
0
ファイル: HomeFragment.java プロジェクト: shun99/googleplay
 @Override
 public void LoadDate() {
   HomeDateProtocol homeProtocol = new HomeDateProtocol(0);
   homeProtocol.setOnDateListener(
       new OnDateListener<HomeInfo>() {
         public void onRefresh(HomeInfo homeInfo) {
           if (homeInfo == null) {
             mLoadingPage.current_state = LoadingPage.STATE_ERROR;
           } else {
             mAppInfoList = new ArrayList<AppInfo>();
             mAppInfoList.addAll(homeInfo.list);
             mPictureList = homeInfo.picture;
             mLoadingPage.current_state = LoadingPage.STATE_SUCCESS;
             CURREN_PAGE = CURREN_PAGE + 20;
           }
           showViewByCurrentState();
         }
       });
 }
コード例 #2
0
ファイル: HomeFragment.java プロジェクト: shun99/googleplay
  @Override
  public void LoadMoreDate() {
    HomeDateProtocol homeProtocol = new HomeDateProtocol(CURREN_PAGE);
    homeProtocol.setOnDateListener(
        new OnDateListener<HomeInfo>() {

          @Override
          public void onRefresh(HomeInfo appInfo) {
            if (appInfo == null) {
              mHomeAdapter.mLondingCurrentState = MoreHolder.LOADMORE_ERROE;
              mHomeAdapter.notifyDataSetChanged();
            } else {
              mAppInfoList.addAll(appInfo.list);
              mHomeAdapter.mLondingCurrentState = MoreHolder.LOADMORE_ING;
              CURREN_PAGE = CURREN_PAGE + 20;
              mHomeAdapter.notifyDataSetChanged(); // 刷新页面
            }
          }
        });
  }