| | |
| | | import com.lcjian.library.util.common.StringUtils; |
| | | import com.lcjian.library.widget.RatioLayout; |
| | | import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator; |
| | | import com.qq.e.ads.cfg.DownAPPConfirmPolicy; |
| | | import com.qq.e.ads.cfg.VideoOption; |
| | | import com.qq.e.ads.nativ.ADSize; |
| | | import com.qq.e.ads.nativ.NativeExpressAD; |
| | | import com.qq.e.ads.nativ.NativeExpressADView; |
| | | import com.qq.e.comm.util.AdError; |
| | | import com.umeng.analytics.MobclickAgent; |
| | | import com.viewpagerindicator.LinePageIndicator; |
| | | import com.weikou.beibeivideo.BasicTextHttpResponseHandler; |
| | |
| | | import com.weikou.beibeivideo.entity.HomeType; |
| | | import com.weikou.beibeivideo.entity.HomeTypeItem; |
| | | import com.weikou.beibeivideo.entity.HomeVideo; |
| | | import com.weikou.beibeivideo.entity.JumpDetail; |
| | | import com.weikou.beibeivideo.entity.VideoInfo; |
| | | import com.weikou.beibeivideo.entity.VideoType; |
| | | import com.weikou.beibeivideo.entity.ad.ExpressAdContainer; |
| | | import com.weikou.beibeivideo.entity.recommend.RecommendContent; |
| | | import com.weikou.beibeivideo.entity.recommend.HomeClass; |
| | | import com.weikou.beibeivideo.ui.category.bean.HotStar; |
| | | import com.weikou.beibeivideo.ui.mine.BrowserActivity; |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.util.DimenUtils; |
| | | import com.weikou.beibeivideo.util.JumpActivityUtil; |
| | | import com.weikou.beibeivideo.util.ad.AdUtil; |
| | | import com.weikou.beibeivideo.util.ad.ExpressAdManager; |
| | | import com.weikou.beibeivideo.util.ui.DividerItemDecoration; |
| | | import com.ysh.wpc.appupdate.GoReview; |
| | | import com.ysh.wpc.appupdate.service.DownLoadFileService; |
| | | import com.yeshi.appupdate.GoReview; |
| | | import com.yeshi.appupdate.service.DownLoadFileService; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.json.JSONArray; |
| | |
| | | |
| | | private Context context; |
| | | |
| | | public static Fragment newInstance(VideoType type, String position) { |
| | | if (Integer.parseInt(position) < 2) { |
| | | public static Fragment newInstance(HomeClass type, String position) { |
| | | if ("recommend".equalsIgnoreCase(type.getDataType())) { |
| | | RecommendFragment fragment = new RecommendFragment(); |
| | | Bundle bundle = new Bundle(); |
| | | bundle.putSerializable("videotype", type); |
| | |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | vp_recommend = view.findViewById(R.id.vp_recommend); |
| | | ll_ad_containner = view.findViewById(R.id.ll_ad_containner); |
| | | rl_recommend_top = view.findViewById(R.id.rl_recommend_top); |
| | | if (position == 1) |
| | | if (position > 0) |
| | | rl_recommend_top.setRatio(0.56f); |
| | | indicator_recommend = view.findViewById(R.id.indicator_recommend); |
| | | mRecommendNewAdapter.setHeaderView(view); |
| | |
| | | if (jsonObject.getBoolean("IsPost")) { |
| | | JSONObject obj = jsonObject.optJSONObject("Data"); |
| | | content = obj.optString("Content"); |
| | | JSONObject jumpDetailJson = obj.optJSONObject("jumpDetail"); |
| | | JumpDetail jumpDetail = null; |
| | | if (jumpDetailJson != null) { |
| | | jumpDetail = new Gson().fromJson(jumpDetailJson.toString(), JumpDetail.class); |
| | | } |
| | | JSONObject paramsJson = obj.optJSONObject("Params"); |
| | | com.alibaba.fastjson.JSONObject params = null; |
| | | if (paramsJson != null) |
| | | params = com.alibaba.fastjson.JSONObject.parseObject(paramsJson.toString()); |
| | | |
| | | |
| | | final JumpDetail fJumpDetail = jumpDetail; |
| | | final com.alibaba.fastjson.JSONObject fParams = params; |
| | | |
| | | // 0-不显示 |
| | | // 1-显示 |
| | | final String url = obj.optString("Url"); |
| | | if (position > 0)//只有第一页才显示通知 |
| | | content = null; |
| | | if (!StringUtils.isBlank(content)) { |
| | | tv_notice.setVisibility(View.VISIBLE); |
| | | tv_notice.setText(content); |
| | | if (!StringUtils.isBlank(url)) { |
| | | tv_notice |
| | | .setOnClickListener(new OnClickListener() { |
| | | |
| | | @Override |
| | | public void onClick(View v) { |
| | | startActivity(new Intent( |
| | | context, |
| | | BrowserActivity.class) |
| | | .putExtra("url", url)); |
| | | |
| | | JumpActivityUtil.jumpPage(getActivity(), fJumpDetail, fParams); |
| | | } |
| | | }); |
| | | } |