/** 加载帖子详情评论 */ private void loadFavoriteNoteDetailComments() { FDNutritionMealWrapper nutritionMealWrapper = new FDNutritionMealWrapper(this); nutritionMealWrapper.getStudentFavoriteNoteComments( favoriteNote.getContentId(), pageNo, LOAD_MORE_MAX_COUNT, new FDCallback() { public void onCallback(Object callback) { if (callback == null) return; long totalRecord = 0; FDResultPage<FDNoteComment> noteCommentPage = (FDResultPage<FDNoteComment>) callback; totalPage = noteCommentPage.getPageCount(); List<FDNoteComment> noteCommentsList = noteCommentPage.getResultList(); if (noteCommentsList == null || pageNo == 1) { commentsList.clear(); totalRecord = 0; } if (noteCommentsList != null) { commentsList.addAll(noteCommentsList); totalRecord = noteCommentPage.getTotalRecord(); } noteCommentAdapter.setSearchTableData(commentsList); noteCommentCountView.setText("共" + totalRecord + "条"); onCommentLoad(totalRecord); } }); }
public void onClick(View view) { if (view == backLayout) { this.finish(); } else if (view == noteForwardButton) { forwardNoteView(); } else if (view == noteCommentButton) { commentNoteView(); } else if (view == favoriteLayout) { if (noteDetail == null) return; FDNutritionMealWrapper studentWrapper = new FDNutritionMealWrapper(context); int favoriteEanble = noteDetail.getIsCollected() == 0 ? 1 : 0; studentWrapper.setStudentFavoriteNote( noteDetail.getContentId(), favoriteEanble, new FDCallback() { public void onCallback(Object callback) { if (callback == null) return; int status = (Integer) callback; if (status == 0) { FDViewUtil.showTaggleToast(context, noteDetail.getIsCollected(), "收藏"); loadFavoriteNoteDetail(); } } }); } }
/** 加载收藏的帖子详情 */ private void loadFavoriteNoteDetail() { if (favoriteNote == null) return; FDNutritionMealWrapper nutritionMealWrapper = new FDNutritionMealWrapper(this); nutritionMealWrapper.getStudentFavoriteNoteDetail( favoriteNote.getContentId(), new FDCallback() { public void onCallback(Object callback) { noteDetail = (FDFavoriteNoteDetail) callback; setFavoriteNoteDetailView(); } }); }