diff --git a/app/src/main/java/com/waynell/videolist/demo/activity/ListViewActivity.java b/app/src/main/java/com/waynell/videolist/demo/activity/ListViewActivity.java index 44327b8..6c7942e 100644 --- a/app/src/main/java/com/waynell/videolist/demo/activity/ListViewActivity.java +++ b/app/src/main/java/com/waynell/videolist/demo/activity/ListViewActivity.java @@ -13,6 +13,7 @@ import com.waynell.videolist.demo.R; import com.waynell.videolist.demo.holder.BaseViewHolder; +import com.waynell.videolist.demo.holder.VideoViewHolder; import com.waynell.videolist.demo.holder.ViewHolderFactory; import com.waynell.videolist.demo.model.BaseItem; import com.waynell.videolist.demo.util.ItemUtils; @@ -140,8 +141,8 @@ public ListItem getListItem(int position) { for (int i = 0; i < childCount; i++) { View view = mListView.getChildAt(i); if(view != null) { - if (view.getTag() instanceof BaseViewHolder) { - BaseViewHolder holder = (BaseViewHolder) view.getTag(); + if (view.getTag() instanceof VideoViewHolder) { + VideoViewHolder holder = (VideoViewHolder) view.getTag(); int holderPosition = mHolderHelper.get(holder); if (holderPosition == position) { return holder; diff --git a/app/src/main/java/com/waynell/videolist/demo/holder/BaseViewHolder.java b/app/src/main/java/com/waynell/videolist/demo/holder/BaseViewHolder.java index c163f30..7e5ca40 100644 --- a/app/src/main/java/com/waynell/videolist/demo/holder/BaseViewHolder.java +++ b/app/src/main/java/com/waynell/videolist/demo/holder/BaseViewHolder.java @@ -4,14 +4,13 @@ import android.view.View; import com.waynell.videolist.demo.model.BaseItem; -import com.waynell.videolist.visibility.items.ListItem; import butterknife.ButterKnife; /** * @author Wayne */ -public abstract class BaseViewHolder extends RecyclerView.ViewHolder implements ListItem { +public abstract class BaseViewHolder extends RecyclerView.ViewHolder { public BaseViewHolder(View itemView) { super(itemView); @@ -19,14 +18,4 @@ public BaseViewHolder(View itemView) { } public abstract void onBind(int position, T iItem); - - @Override - public void setActive(View newActiveView, int newActiveViewPosition) { - - } - - @Override - public void deactivate(View currentView, int position) { - - } } diff --git a/app/src/main/java/com/waynell/videolist/demo/holder/VideoViewHolder.java b/app/src/main/java/com/waynell/videolist/demo/holder/VideoViewHolder.java index f2d6f7c..aeb9fff 100644 --- a/app/src/main/java/com/waynell/videolist/demo/holder/VideoViewHolder.java +++ b/app/src/main/java/com/waynell/videolist/demo/holder/VideoViewHolder.java @@ -21,6 +21,7 @@ import com.waynell.videolist.demo.model.VideoLoadMvpView; import com.waynell.videolist.demo.target.VideoLoadTarget; import com.waynell.videolist.demo.target.VideoProgressTarget; +import com.waynell.videolist.visibility.items.ListItem; import com.waynell.videolist.widget.TextureVideoView; import java.io.File; @@ -31,7 +32,7 @@ public class VideoViewHolder extends BaseViewHolder - implements VideoLoadMvpView, ViewPropertyAnimatorListener { + implements VideoLoadMvpView, ViewPropertyAnimatorListener, ListItem { @Bind(R.id.video_view) public TextureVideoView videoView;