@Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView != null && convertView.getTag() instanceof BaseHolder) { mHolder = (BaseHolder) convertView.getTag(); } else { mHolder = getHolder(mContext); // 1 } mHolder.setData(mDatas.get(position)); // 2 return mHolder.getRootView(); }
@Override public void setData(AbsVideoRes mData) { super.setData(mData); tv_title.setText(mData.getVideoTitle()); FrecsoUtils.loadImage(mData.getVideoThumbnail(), image); FrecsoUtils.loadImage(mData.getSmallVideoThumbnail(), image_serie); }
public void test_all() { BaseHolder pkg = new BaseHolder(); passer.pass_state(pkg); assertNotNull("passer returned null for state value", pkg.value); this.test_state(pkg.value); pkg.value = null; passer.pass_ops(pkg); assertNotNull("passer returned null for interface value", pkg.value); this.test_ops(pkg.value); this.test_exception(pkg.value); passer.pass_nil(pkg); assertNull("passer returned not null for null value", pkg.value); }
@Override public void setData(AppInfo mData) { // 设置数据时,恢复原来的下载状态 mDownloadManager = DownloadManager.getInstance(); DownloadInfo downloadInfo = mDownloadManager.getDownloadInfo(mData); if (downloadInfo != null) { currentState = downloadInfo.getCurrentState(); progress = downloadInfo.getProgress(); } else { currentState = DownloadManager.STATE_NONE; progress = 0; } super.setData(mData); }
@Override public void init() { super.init(); Typeface mTypeface = Typeface.createFromAsset(mContext.getAssets(), "fonts/Roboto-Thin.ttf"); tv_title.setTypeface(mTypeface); Object mObject = mView.getTag(R.id.tag_first); if (mObject != null && mObject instanceof ParallaxViewController) { ((ParallaxViewController) mObject).imageParallax(image); } mView.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(mContext, PlayActivity.class); intent.putExtra("video", mData); mContext.startActivity(intent); } }); }