admin
2023-11-21 2eec3de87b6b616a69a46c1f97c2397159031d2f
BuWanVideo/src/com/weikou/beibeivideo/ui/main/DYVideoFragment.java
@@ -16,6 +16,8 @@
import com.weikou.beibeivideo.R;
import com.weikou.beibeivideo.ui.MyRetainViewFragment;
import com.weikou.beibeivideo.util.ad.KSConstant;
import com.weikou.beibeivideo.util.video.DPEventCollectUtil;
import com.weikou.beibeivideo.util.video.DPHolder;
import com.weikou.beibeivideo.widget.MySwipeRefreshLayout;
import java.util.Map;
@@ -33,11 +35,18 @@
    private static final String TAG = "DYVideoFragment";
    private IDPWidget mIDPWidget;
    private MySwipeRefreshLayout swipeRefreshLayout;
    private FragmentManager fragmentManager;
    public DYVideoFragment() {
        super();
        setName(DYNewsFragment.class.getName());
    }
    public DYVideoFragment(FragmentManager fragmentManager) {
        super();
        setName(DYNewsFragment.class.getName());
        this.fragmentManager = fragmentManager;
    }
    @Override
@@ -97,7 +106,9 @@
    }
    private void init() {
        mIDPWidget = DPSdk.factory().createDraw(DPWidgetDrawParams.obtain().hideClose(true, null)
        mIDPWidget = DPHolder.getInstance().buildDrawWidget(DPWidgetDrawParams.obtain().hideClose(true, null)
                .drawContentType(DPWidgetDrawParams.DRAW_CONTENT_TYPE_ALL)
                .listener(new IDPNewsListener() {
                    @Override
                    public void onDPRefreshFinish() {
@@ -127,6 +138,14 @@
                    @Override
                    public void onDPVideoOver(Map<String, Object> map) {
                        log("onDPVideoOver");
                        DPEventCollectUtil.playDrawVideo(getContext(), null, "dy", "home", false);
                    }
                    @Override
                    public void onDPVideoCompletion(Map<String, Object> map) {
                        log("onDPVideoCompletion");
                        super.onDPVideoCompletion(map);
//                        DPEventCollectUtil.playDrawVideo(getContext(), null, "dy", "home", true);
                    }
                    @Override
@@ -144,7 +163,11 @@
        Fragment fragment = mIDPWidget.getFragment();
        if (fragment != null) {
            getChildFragmentManager().beginTransaction().add(R.id.fl_content, fragment).commitAllowingStateLoss();
            if (fragmentManager != null) {
                fragmentManager.beginTransaction().add(R.id.fl_content, fragment).commitAllowingStateLoss();
            } else {
                getChildFragmentManager().beginTransaction().add(R.id.fl_content, fragment).commitAllowingStateLoss();
            }
        }
    }