// packaged method private void refreshIntroduceListView(boolean isError) { if (mMediaDetailInfo != null && mMediaDetailInfo.mediainfo != null) { mIntroduceAdapter.setData(mMediaDetailInfo.mediainfo); return; } if (isError) { mIntroduceLoadingListView.setEmptyView(mIntroduceRetryView); } else { mIntroduceLoadingListView.setEmptyView(mIntroduceEmptyView); } }
// get data private void getMediaDetailData() { if (mMediaDetailInfo == null) { if (mMediaInfo != null) { boolean getAll = true; mIntroduceLoadingListView.setShowLoading(true); mMediaDetailInfoSupply.getMediaDetailInfo( mMediaInfo.mediaid, getAll, MediaFeeDef.MEDIA_ALL, null); } } }
@Override public void onMediaDetailInfoDone(MediaDetailInfo2 mediaDetailInfo, boolean isError) { mIntroduceLoadingListView.setShowLoading(false); mMediaDetailInfo = mediaDetailInfo; if (mMediaInfo != null && mMediaDetailInfo != null) { if (mMediaDetailInfo.mediainfo != null) { mMediaInfo.smallImageURL = mMediaDetailInfo.mediainfo.smallImageURL; } } refreshIntroduceListView(isError); }
private void initUI() { mIntroduceListView = mIntroduceLoadingListView.getListView(); mIntroduceAdapter = new IntroduceAdapter(mContext); mIntroduceListView.setAdapter(mIntroduceAdapter); mIntroduceLoadView = View.inflate(mContext, R.layout.load_view_black, null); mIntroduceLoadingListView.setLoadingView(mIntroduceLoadView); mIntroduceEmptyView = View.inflate(mContext, R.layout.empty_view_black, null); TextView emptyHint = (TextView) mIntroduceEmptyView.findViewById(R.id.empty_hint); emptyHint.setText(mContext.getResources().getString(R.string.detail_introduce_empty_hint)); mIntroduceRetryView = new RetryView(mContext, RetryView.STYLE_BLACK); mIntroduceRetryView.setOnRetryLoadListener( new OnRetryLoadListener() { @Override public void OnRetryLoad(View vClicked) { getMediaDetailData(); } }); }
private void initData() { initDataSupply(); mIntroduceLoadingListView.setShowLoading(true); }