|
@@ -17,6 +17,7 @@ import com.edufound.reader.bean.HttpResultBean;
|
|
|
import com.edufound.reader.bean.HttpResultDataListBean;
|
|
|
import com.edufound.reader.bean.UserRecordBean;
|
|
|
import com.edufound.reader.contract.RecommendFragmentContract;
|
|
|
+import com.edufound.reader.cusview.CusToast;
|
|
|
import com.edufound.reader.cusview.RvListJzvdStd;
|
|
|
import com.edufound.reader.model.RecommendFragmentModel;
|
|
|
import com.edufound.reader.receiver.BackPageReceiver;
|
|
@@ -56,7 +57,6 @@ public class RecommendFragmentPresenter extends BasePresenter<RecommendFragmentC
|
|
|
int mTotalSize = 20;
|
|
|
int mPageIndex = 1;
|
|
|
boolean loadOver = false;
|
|
|
- private String intoPage;
|
|
|
|
|
|
|
|
|
public RecommendFragmentPresenter(Context context) {
|
|
@@ -68,10 +68,6 @@ public class RecommendFragmentPresenter extends BasePresenter<RecommendFragmentC
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void setIntoPage(String name) {
|
|
|
- intoPage = name;
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public void initVideoList(RecyclerView rv, int type, int startPosition) {
|
|
|
rv.setOutlineProvider(new ViewOutlineProvider() {
|
|
@@ -153,11 +149,6 @@ public class RecommendFragmentPresenter extends BasePresenter<RecommendFragmentC
|
|
|
}
|
|
|
// Logger.e("mCurrentPosition:" + mCurrentPosition);
|
|
|
// Logger.e("mDataList:" + mDataList.size());
|
|
|
- }
|
|
|
- });
|
|
|
- rv.addOnChildAttachStateChangeListener(new RecyclerView.OnChildAttachStateChangeListener() {
|
|
|
- @Override
|
|
|
- public void onChildViewAttachedToWindow(View view) {
|
|
|
scrollToNextFunction(rv, false);
|
|
|
}
|
|
|
|
|
@@ -179,7 +170,7 @@ public class RecommendFragmentPresenter extends BasePresenter<RecommendFragmentC
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Object getCurPlayVideo() {
|
|
|
+ public int getCurPlayVideoIndex() {
|
|
|
return mCurrentPosition;
|
|
|
}
|
|
|
|
|
@@ -257,8 +248,7 @@ public class RecommendFragmentPresenter extends BasePresenter<RecommendFragmentC
|
|
|
|
|
|
@Override
|
|
|
public void onFailure(HttpInfo info) throws IOException {
|
|
|
- Logger.e("获取推荐列表失败:" + info.getRetDetail());
|
|
|
- Logger.e("info.getUrl():" + info.getUrl());
|
|
|
+ CusToast.getInstance(mView.getActivity()).show(info.getRetDetail(), 3000);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -326,9 +316,6 @@ public class RecommendFragmentPresenter extends BasePresenter<RecommendFragmentC
|
|
|
public void getRecordInfoById(String id) {
|
|
|
|
|
|
if (mView == null) {
|
|
|
- Logger.e("mView==null了");
|
|
|
- Logger.e("activityName==" + intoPage);
|
|
|
- Logger.e("loadtype:" + loadType);
|
|
|
return;
|
|
|
}
|
|
|
mModel.getRecordInfoById(mView.getActivity(), id, new Callback() {
|
|
@@ -395,12 +382,15 @@ public class RecommendFragmentPresenter extends BasePresenter<RecommendFragmentC
|
|
|
}
|
|
|
//获取当前显示的View 的数据
|
|
|
int childCount = rv.getChildCount();
|
|
|
+ Logger.e("childCount:" + childCount);
|
|
|
//获取最后一具 Item 对应的View
|
|
|
View childAt = rv.getChildAt(childCount - 1);
|
|
|
//获取当前军舰中显示的最后一个 Item 的位置 Postion
|
|
|
int childLayoutPosition = rv.getChildLayoutPosition(childAt);
|
|
|
mView.setTopStatus(mDataList.get(childLayoutPosition));
|
|
|
RvListJzvdStd player = rv.getChildAt(0).findViewById(R.id.slidevideo_video);
|
|
|
+ Logger.e("player==null:" + (player == null));
|
|
|
+ Logger.e("player==player.state:" + player.state);
|
|
|
if (player != null) {
|
|
|
if (player.state == Jzvd.STATE_PLAYING) {
|
|
|
//正在播放
|
|
@@ -433,6 +423,7 @@ public class RecommendFragmentPresenter extends BasePresenter<RecommendFragmentC
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
public void scrollToNextFunction(RecyclerView rv, boolean needScroll) {
|
|
|
Logger.e("needScroll:" + needScroll);
|
|
|
//获取当前显示的View 的数据
|
|
@@ -442,8 +433,6 @@ public class RecommendFragmentPresenter extends BasePresenter<RecommendFragmentC
|
|
|
//获取当前军舰中显示的最后一个 Item 的位置 Postion
|
|
|
int childLayoutPosition = rv.getChildLayoutPosition(childAt);
|
|
|
//如果不是最后一个就向下滑动
|
|
|
-
|
|
|
-
|
|
|
if (childLayoutPosition < rv.getAdapter().getItemCount() - 1) {
|
|
|
if (needScroll) {
|
|
|
rv.smoothScrollToPosition(childLayoutPosition + 1);
|