From 1981dee5aec45793d3c4ebdbc4e637528c71b3c5 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 03 二月 2021 19:20:47 +0800 Subject: [PATCH] 'PPTV' --- BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/RecommendFragment.java | 40 +++++++++++++++++++++++++++------------- 1 files changed, 27 insertions(+), 13 deletions(-) diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/RecommendFragment.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/RecommendFragment.java index 7002ac0..3797b3f 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/RecommendFragment.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/RecommendFragment.java @@ -43,20 +43,21 @@ 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.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.yeshi.ec.library_baiducpu.fragment.BaiDuNewsFragment; -import com.yeshi.ec.library_baiducpu.fragment.BaiDuVideosFragment; -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; @@ -103,8 +104,8 @@ 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); @@ -133,6 +134,8 @@ } catch (IOException e) { e.printStackTrace(); } + + } @@ -189,7 +192,7 @@ 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); @@ -571,23 +574,34 @@ 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); } }); } -- Gitblit v1.8.0