| | |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.util.ad.AdUtil; |
| | | import com.weikou.beibeivideo.util.ad.GDTConstant; |
| | | import com.weikou.beibeivideo.util.ui.IPageEventListener; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | | import java.util.List; |
| | | |
| | | public class VideoDetailVideoAdFragment extends Fragment implements View.OnClickListener { |
| | | |
| | | private final static String TAG = "VideoDetailVideoAdFragment"; |
| | | |
| | | |
| | | |
| | | private MediaView mediaView; |
| | | |
| | |
| | | private TextView tv_skip; |
| | | |
| | | private ProgressBar pb_progress; |
| | | |
| | | private IPageEventListener pageEventListener; |
| | | |
| | | public void setPageEventListener(IPageEventListener pageEventListener) { |
| | | this.pageEventListener = pageEventListener; |
| | | } |
| | | |
| | | @Override |
| | | public void onCreate(@Nullable Bundle savedInstanceState) { |
| | |
| | | View root = LayoutInflater.from(getContext()).inflate(R.layout.item_video_detail_ad, null); |
| | | initView(root); |
| | | tv_skip.setOnClickListener(this); |
| | | if (pageEventListener != null) |
| | | pageEventListener.onCreateView(); |
| | | return root; |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public void onResume() { |
| | | Log.i(TAG, "onResume"); |
| | | super.onResume(); |
| | | if (mAdData != null) { |
| | | // 必须要在Activity.onResume()时通知到广告数据,以便重置广告恢复状态 |
| | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onAttach(Context context) { |
| | | super.onAttach(context); |
| | | } |
| | | |
| | | public interface IVideoAdListener { |
| | | |
| | |
| | | public void startPlay(); |
| | | |
| | | } |
| | | |
| | | |
| | | } |