Ejemplo n.º 1
0
  @Override
  public ListData<SociaxItem> refreshHeader(SociaxItem obj)
      throws VerifyErrorException, ApiException, ListAreEmptyException, DataInvalidException {

    if (obj == null) {
      return refreshNew(PAGE_COUNT);
    }

    this.getApiUsers().unsetNotificationCount(NotifyCount.Type.comment, getMyUid());

    ListData<SociaxItem> commentDatas =
        getApiStatuses().commentReceiveMyHeaderTimeline((ReceiveComment) obj, PAGE_COUNT);

    Thinksns app = (Thinksns) this.context.getApplicationContext();
    MyCommentSqlHelper mCommentSqlHelper = app.getMyCommentSql();

    if (commentDatas.size() > 0) {
      int dbSize = mCommentSqlHelper.getDBCommentSize();
      if (dbSize >= 20) {
        mCommentSqlHelper.deleteWeibo(commentDatas.size());
      } else if ((dbSize + commentDatas.size()) >= 20) {
        mCommentSqlHelper.deleteWeibo(dbSize + commentDatas.size() - 20);
      }
      for (int i = 0; i < commentDatas.size(); i++) {
        mCommentSqlHelper.addComment((ReceiveComment) commentDatas.get(i));
      }
    }

    return commentDatas;
  }
Ejemplo n.º 2
0
 private User loadingHeader(int position, ImageView userheader) {
   User temp = getItem(position).getUser();
   userheader.setTag(temp);
   Thinksns app = (Thinksns) this.context.getApplicationContext();
   if (
   /* temp.hasHeader() && */ app.isNetWorkOn()) {
     if (temp.isNullForHeaderCache()) {
       dowloaderTask(temp.getUserface(), userheader, BitmapDownloaderTask.Type.FACE);
     } else {
       Bitmap cache = temp.getHeader();
       if (cache == null) {
         dowloaderTask(temp.getUserface(), userheader, BitmapDownloaderTask.Type.FACE);
       } else {
         userheader.setImageBitmap(cache);
       }
     }
   }
   return temp;
 }
Ejemplo n.º 3
0
 private ApiStatuses getApiStatuses() {
   Thinksns app = thread.getApp();
   return app.getStatuses();
 }