RecyclerVIEw rv_featureList;private VIEw currentFocusedLayout,oldFocusedLayout;@OverrIDepublic voID onCreate(Bundle instanceState) { rv_featuredList.addOnScrollListener(new RecyclerVIEw.OnScrollListener() { @OverrIDe public voID onScrollStateChanged(RecyclerVIEw recyclerVIEw,int newState) { super.onScrollStateChanged(recyclerVIEw,newState); if (newState == AbsListVIEw.OnScrollListener.SCRolL_STATE_IDLE) { //get the recyclervIEw position which is completely visible and first int positionVIEw = ((linearlayoutmanager) rv_featuredList.getLayoutManager()).findFirstCompletelyVisibleItemposition(); Log.i("VISISBLE",positionVIEw + ""); if (positionVIEw >= 0) { if (oldFocusedLayout != null) { //Stop the prevIoUs vIDeo playback after new scroll VIDeoVIEw vv_dashboard = (VIDeoVIEw) oldFocusedLayout.findVIEwByID(R.ID.vv_dashboard); vv_dashboard.stopPlayback(); } currentFocusedLayout = ((linearlayoutmanager) rv_featuredList.getLayoutManager()).findVIEwByposition(positionVIEw); VIDeoVIEw vv_dashboard = (VIDeoVIEw) currentFocusedLayout.findVIEwByID(R.ID.vv_dashboard); //to play vIDeo of selected recylervIEw,vIDeosData is an array-List which is send to recyclervIEw adapter to fill the vIEw. Here we getting that specific vIDeo which is displayed through recyclervIEw. playVIDeo(vIDeosData.get(positionVIEw)); oldFocusedLayout = currentFocusedLayout; } } } });}总结
以上是内存溢出为你收集整理的android – 如何播放当前焦点在回收站视图中的视频视频视频全部内容,希望文章能够帮你解决android – 如何播放当前焦点在回收站视图中的视频视频视频所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)