Commit 05344cfa8d2ceb28471338653313e8c87922dab9
1 parent
e618cea0
Exists in
yxb_dev
and in
2 other branches
no message
Showing
3 changed files
with
46 additions
and
21 deletions
Show diff stats
app/src/main/java/com/shunzhi/parent/ui/activity/mywebview/WebViewActivity.java
| ... | ... | @@ -116,6 +116,7 @@ public class WebViewActivity extends BaseCompatActivity { |
| 116 | 116 | initWebView(); |
| 117 | 117 | initWebSetting(nesteScrollWebView.getSettings()); |
| 118 | 118 | nesteScrollWebView.loadUrl(getIntent().getStringExtra("url")); |
| 119 | +// Log.d("66666","getIntent().getStringExtra(\"url\")="+getIntent().getStringExtra("url")); | |
| 119 | 120 | } |
| 120 | 121 | |
| 121 | 122 | @Override | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/StartFragment.java
| ... | ... | @@ -3,18 +3,14 @@ package com.shunzhi.parent.ui.fragment; |
| 3 | 3 | import android.os.Bundle; |
| 4 | 4 | import android.support.annotation.NonNull; |
| 5 | 5 | import android.support.annotation.Nullable; |
| 6 | -import android.support.v4.view.ViewPager; | |
| 7 | 6 | import android.text.TextUtils; |
| 8 | -import android.util.Log; | |
| 9 | 7 | import android.view.View; |
| 10 | 8 | import android.widget.ImageView; |
| 11 | 9 | import android.widget.TextView; |
| 12 | 10 | |
| 13 | -import com.bumptech.glide.Glide; | |
| 14 | 11 | import com.share.mvpsdk.base.BasePresenter; |
| 15 | 12 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
| 16 | 13 | import com.shunzhi.parent.AppConfig; |
| 17 | -import com.shunzhi.parent.AppContext; | |
| 18 | 14 | import com.shunzhi.parent.R; |
| 19 | 15 | import com.shunzhi.parent.bean.GuangGaoBean; |
| 20 | 16 | import com.shunzhi.parent.bean.channel.ChannelBean; |
| ... | ... | @@ -28,6 +24,8 @@ import com.stx.xhb.xbanner.XBanner; |
| 28 | 24 | import java.util.ArrayList; |
| 29 | 25 | import java.util.List; |
| 30 | 26 | |
| 27 | +import cn.jzvd.JZVideoPlayerStandard; | |
| 28 | + | |
| 31 | 29 | public class StartFragment extends BaseMVPCompatFragment<ConsultContract.ConsultPresenter, ConsultContract.IConsultModel> |
| 32 | 30 | implements ConsultContract.IConsultView { |
| 33 | 31 | |
| ... | ... | @@ -35,6 +33,10 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult |
| 35 | 33 | |
| 36 | 34 | TextView tvJump; |
| 37 | 35 | |
| 36 | + boolean isQidong =false; | |
| 37 | + | |
| 38 | + JZVideoPlayerStandard jiecaoVideo; | |
| 39 | + | |
| 38 | 40 | @Override |
| 39 | 41 | public int getLayoutId() { |
| 40 | 42 | return R.layout.fragment_start; |
| ... | ... | @@ -45,8 +47,16 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult |
| 45 | 47 | |
| 46 | 48 | xBanner = view.findViewById(R.id.xBanner); |
| 47 | 49 | tvJump=view.findViewById(R.id.tvJump); |
| 48 | - | |
| 49 | - if (!TextUtils.isEmpty(AppConfig.getAppConfig(getContext()).get(AppConfig.APP_IS_START))) { | |
| 50 | + jiecaoVideo=view.findViewById(R.id.jiecaoVideo); | |
| 51 | + jiecaoVideo.tinyBackImageView.setVisibility(View.GONE); | |
| 52 | + jiecaoVideo.backButton.setVisibility(View.GONE); | |
| 53 | + jiecaoVideo.replayTextView.setVisibility(View.GONE); | |
| 54 | + jiecaoVideo.batteryLevel.setVisibility(View.GONE); | |
| 55 | + jiecaoVideo.thumbImageView.setVisibility(View.GONE); | |
| 56 | + jiecaoVideo.loadingProgressBar.setVisibility(View.GONE); | |
| 57 | + | |
| 58 | + isQidong=TextUtils.isEmpty(AppConfig.getAppConfig(getContext()).get(AppConfig.APP_IS_START)); | |
| 59 | + if (!isQidong) { | |
| 50 | 60 | mPresenter.getBanners("0", "余杭区"); |
| 51 | 61 | AppConfig.getAppConfig(getContext()).set(AppConfig.APP_IS_START, "1"); |
| 52 | 62 | } else mPresenter.getBanners("1","余杭区"); |
| ... | ... | @@ -90,23 +100,32 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult |
| 90 | 100 | |
| 91 | 101 | private void initBannes(List<GuangGaoBean> guangGaoBeanList) { |
| 92 | 102 | try { |
| 93 | - final List<String> imgUrl = new ArrayList<>(); | |
| 94 | - List<String> describeList = new ArrayList<>(); | |
| 95 | - for (int i = 0; i < guangGaoBeanList.size(); i++) { | |
| 96 | - imgUrl.add(AppConfig.BASE_URL_FILE+guangGaoBeanList.get(i).fileSrc); | |
| 97 | - describeList.add(guangGaoBeanList.get(i).describe); | |
| 98 | - } | |
| 99 | - xBanner.setData(imgUrl, describeList); | |
| 100 | - xBanner.stopAutoPlay(); | |
| 101 | - xBanner.setmAutoPalyTime(10000); | |
| 103 | + if (!isQidong){ | |
| 104 | + String fileUrl=""; | |
| 105 | + for (int i = 0; i < guangGaoBeanList.size(); i++) { | |
| 106 | + if (guangGaoBeanList.get(i).fileSrc.contains(".mp4")){ | |
| 107 | + fileUrl=AppConfig.BASE_URL_FILE+guangGaoBeanList.get(i).fileSrc; | |
| 108 | + } | |
| 109 | + } | |
| 110 | + jiecaoVideo | |
| 111 | + }else { | |
| 112 | + final List<String> imgUrl = new ArrayList<>(); | |
| 113 | + List<String> describeList = new ArrayList<>(); | |
| 114 | + for (int i = 0; i < guangGaoBeanList.size(); i++) { | |
| 115 | + imgUrl.add(AppConfig.BASE_URL_FILE+guangGaoBeanList.get(i).fileSrc); | |
| 116 | + describeList.add(guangGaoBeanList.get(i).describe); | |
| 117 | + } | |
| 118 | + xBanner.setData(imgUrl, describeList); | |
| 119 | + xBanner.stopAutoPlay(); | |
| 120 | + xBanner.setmAutoPalyTime(10000); | |
| 102 | 121 | // xBanner.setSlideScrollMode(View.OVER_SCROLL_NEVER); |
| 103 | - xBanner.setmAdapter(new XBanner.XBannerAdapter() { | |
| 104 | - @Override | |
| 105 | - public void loadBanner(XBanner banner, Object model, View view, int position) { | |
| 106 | - GlideUtils.showImg(getActivity(),(ImageView) view,imgUrl.get(position)); | |
| 122 | + xBanner.setmAdapter(new XBanner.XBannerAdapter() { | |
| 123 | + @Override | |
| 124 | + public void loadBanner(XBanner banner, Object model, View view, int position) { | |
| 125 | + GlideUtils.showImg(getActivity(),(ImageView) view,imgUrl.get(position)); | |
| 126 | + } | |
| 127 | + }); | |
| 107 | 128 | } |
| 108 | - }); | |
| 109 | - | |
| 110 | 129 | |
| 111 | 130 | }catch (Exception e){ |
| 112 | 131 | e.printStackTrace(); | ... | ... |
app/src/main/res/layout/fragment_start.xml
| ... | ... | @@ -11,6 +11,11 @@ |
| 11 | 11 | android:id="@+id/xBanner" |
| 12 | 12 | ></com.stx.xhb.xbanner.XBanner> |
| 13 | 13 | |
| 14 | + <cn.jzvd.JZVideoPlayerStandard | |
| 15 | + android:id="@+id/jiecaoVideo" | |
| 16 | + android:layout_width="match_parent" | |
| 17 | + android:layout_height="match_parent"></cn.jzvd.JZVideoPlayerStandard> | |
| 18 | + | |
| 14 | 19 | <TextView |
| 15 | 20 | android:id="@+id/tvJump" |
| 16 | 21 | android:layout_width="wrap_content" | ... | ... |