Commit ce7abc12fe2eaf6d2e01c7747dc078bc2b79bd9c
1 parent
05344cfa
Exists in
yxb_dev
and in
2 other branches
no message
Showing
2 changed files
with
35 additions
and
19 deletions
Show diff stats
app/src/main/java/com/shunzhi/parent/ui/activity/LoginAndRegistActivity.java
... | ... | @@ -19,9 +19,11 @@ public class LoginAndRegistActivity extends BaseCompatActivity { |
19 | 19 | protected void initView(Bundle savedInstanceState) { |
20 | 20 | if (savedInstanceState == null) { |
21 | 21 | type = getIntent().getStringExtra("type"); |
22 | - Log.e("aaa--==",type); | |
23 | - mFragments[0] = LoginAndRegistFragment.getInstance(type); | |
24 | - loadRootFragment(R.id.frame, mFragments[0]); | |
22 | + if (null!=type){ | |
23 | + mFragments[0] = LoginAndRegistFragment.getInstance(type); | |
24 | + loadRootFragment(R.id.frame, mFragments[0]); | |
25 | + } | |
26 | + | |
25 | 27 | } else { |
26 | 28 | mFragments[0] = findFragment(LoginAndRegistFragment.class); |
27 | 29 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/StartFragment.java
... | ... | @@ -11,6 +11,7 @@ import android.widget.TextView; |
11 | 11 | import com.share.mvpsdk.base.BasePresenter; |
12 | 12 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
13 | 13 | import com.shunzhi.parent.AppConfig; |
14 | +import com.shunzhi.parent.AppContext; | |
14 | 15 | import com.shunzhi.parent.R; |
15 | 16 | import com.shunzhi.parent.bean.GuangGaoBean; |
16 | 17 | import com.shunzhi.parent.bean.channel.ChannelBean; |
... | ... | @@ -33,7 +34,7 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult |
33 | 34 | |
34 | 35 | TextView tvJump; |
35 | 36 | |
36 | - boolean isQidong =false; | |
37 | + boolean isQidong = false; | |
37 | 38 | |
38 | 39 | JZVideoPlayerStandard jiecaoVideo; |
39 | 40 | |
... | ... | @@ -46,8 +47,8 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult |
46 | 47 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
47 | 48 | |
48 | 49 | xBanner = view.findViewById(R.id.xBanner); |
49 | - tvJump=view.findViewById(R.id.tvJump); | |
50 | - jiecaoVideo=view.findViewById(R.id.jiecaoVideo); | |
50 | + tvJump = view.findViewById(R.id.tvJump); | |
51 | + jiecaoVideo = view.findViewById(R.id.jiecaoVideo); | |
51 | 52 | jiecaoVideo.tinyBackImageView.setVisibility(View.GONE); |
52 | 53 | jiecaoVideo.backButton.setVisibility(View.GONE); |
53 | 54 | jiecaoVideo.replayTextView.setVisibility(View.GONE); |
... | ... | @@ -55,11 +56,17 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult |
55 | 56 | jiecaoVideo.thumbImageView.setVisibility(View.GONE); |
56 | 57 | jiecaoVideo.loadingProgressBar.setVisibility(View.GONE); |
57 | 58 | |
58 | - isQidong=TextUtils.isEmpty(AppConfig.getAppConfig(getContext()).get(AppConfig.APP_IS_START)); | |
59 | - if (!isQidong) { | |
60 | - mPresenter.getBanners("0", "余杭区"); | |
59 | + isQidong = TextUtils.isEmpty(AppConfig.getAppConfig(getContext()).get(AppConfig.APP_IS_START)); | |
60 | + if (isQidong) { | |
61 | + jiecaoVideo.setVisibility(View.VISIBLE); | |
62 | + xBanner.setVisibility(View.GONE); | |
61 | 63 | AppConfig.getAppConfig(getContext()).set(AppConfig.APP_IS_START, "1"); |
62 | - } else mPresenter.getBanners("1","余杭区"); | |
64 | + mPresenter.getBanners("0", AppContext.getInstance().district==""?"越城区":AppContext.getInstance().district); | |
65 | + } else { | |
66 | + jiecaoVideo.setVisibility(View.GONE); | |
67 | + xBanner.setVisibility(View.VISIBLE); | |
68 | + mPresenter.getBanners("1", AppContext.getInstance().district==""?"越城区":AppContext.getInstance().district); | |
69 | + } | |
63 | 70 | |
64 | 71 | |
65 | 72 | tvJump.setOnClickListener(new View.OnClickListener() { |
... | ... | @@ -100,19 +107,21 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult |
100 | 107 | |
101 | 108 | private void initBannes(List<GuangGaoBean> guangGaoBeanList) { |
102 | 109 | try { |
103 | - if (!isQidong){ | |
104 | - String fileUrl=""; | |
110 | + if (isQidong) { | |
111 | + String fileUrl = "", describe = ""; | |
105 | 112 | 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; | |
113 | + if (guangGaoBeanList.get(i).fileSrc.contains(".mp4")) { | |
114 | + fileUrl = AppConfig.BASE_URL_FILE + guangGaoBeanList.get(i).fileSrc; | |
115 | + describe = guangGaoBeanList.get(i).describe; | |
108 | 116 | } |
109 | 117 | } |
110 | - jiecaoVideo | |
111 | - }else { | |
118 | + jiecaoVideo.setUp(fileUrl, JZVideoPlayerStandard.SCREEN_WINDOW_NORMAL, describe); | |
119 | + jiecaoVideo.startVideo(); | |
120 | + } else { | |
112 | 121 | final List<String> imgUrl = new ArrayList<>(); |
113 | 122 | List<String> describeList = new ArrayList<>(); |
114 | 123 | for (int i = 0; i < guangGaoBeanList.size(); i++) { |
115 | - imgUrl.add(AppConfig.BASE_URL_FILE+guangGaoBeanList.get(i).fileSrc); | |
124 | + imgUrl.add(AppConfig.BASE_URL_FILE + guangGaoBeanList.get(i).fileSrc); | |
116 | 125 | describeList.add(guangGaoBeanList.get(i).describe); |
117 | 126 | } |
118 | 127 | xBanner.setData(imgUrl, describeList); |
... | ... | @@ -122,13 +131,18 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult |
122 | 131 | xBanner.setmAdapter(new XBanner.XBannerAdapter() { |
123 | 132 | @Override |
124 | 133 | public void loadBanner(XBanner banner, Object model, View view, int position) { |
125 | - GlideUtils.showImg(getActivity(),(ImageView) view,imgUrl.get(position)); | |
134 | + GlideUtils.showImg(getActivity(), (ImageView) view, imgUrl.get(position)); | |
126 | 135 | } |
127 | 136 | }); |
128 | 137 | } |
129 | 138 | |
130 | - }catch (Exception e){ | |
139 | + } catch (Exception e) { | |
131 | 140 | e.printStackTrace(); |
132 | 141 | } |
133 | 142 | } |
143 | + | |
144 | + @Override | |
145 | + public void onDestroy() { | |
146 | + super.onDestroy(); | |
147 | + } | |
134 | 148 | } | ... | ... |