Commit 34523b04f6b740afe456158a43801d18e0086717

Authored by 陶汉栋
2 parents 88c7d7d2 011cb910

no message

app/src/main/java/com/shunzhi/parent/ui/fragment/StartFragment.java
1 1 package com.shunzhi.parent.ui.fragment;
2 2  
3 3 import android.os.Bundle;
  4 +import android.os.CountDownTimer;
4 5 import android.os.Handler;
5 6 import android.os.Message;
6 7 import android.support.annotation.NonNull;
... ... @@ -41,6 +42,20 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult
41 42  
42 43 JZVideoPlayerStandard jiecaoVideo;
43 44  
  45 +
  46 + CountDownTimer countDownTimer=new CountDownTimer(5*1000,1000) {
  47 + @Override
  48 + public void onTick(long l) {
  49 + tvJump.setText("跳转"+l/1000+"s");
  50 + }
  51 +
  52 + @Override
  53 + public void onFinish() {
  54 + startNewActivity(MainActivity.class);
  55 + getActivity().finish();
  56 + }
  57 + };
  58 +
44 59 @Override
45 60 public int getLayoutId() {
46 61 return R.layout.fragment_start;
... ... @@ -58,7 +73,7 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult
58 73 jiecaoVideo.batteryLevel.setVisibility(View.GONE);
59 74 jiecaoVideo.thumbImageView.setVisibility(View.GONE);
60 75 jiecaoVideo.loadingProgressBar.setVisibility(View.GONE);
61   -
  76 + countDownTimer.start();
62 77 isQidong = TextUtils.isEmpty(AppConfig.getAppConfig(getContext()).get(AppConfig.APP_IS_START));
63 78 if (isQidong) {
64 79 jiecaoVideo.setVisibility(View.VISIBLE);
... ... @@ -150,5 +165,6 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult
150 165 @Override
151 166 public void onDestroy() {
152 167 super.onDestroy();
  168 + if (null!=countDownTimer)countDownTimer.cancel();
153 169 }
154 170 }
... ...
app/src/main/java/com/shunzhi/parent/views/TextAndImgShowView.java
... ... @@ -86,8 +86,7 @@ public class TextAndImgShowView extends LinearLayout {
86 86 DisplayUtils.dp2px(layout_control.getPaddingLeft() + layout_control.getPaddingRight()+20
87 87 )) / 4;
88 88 layout.setLayoutParams(params);
89   - LayoutParams params1 = new LayoutParams(DisplayUtils.dp2px(45), DisplayUtils.dp2px(45));
90   - ToastUtils.showToast(DisplayUtils.dp2px(55)+"");
  89 + LayoutParams params1 = new LayoutParams(DisplayUtils.dp2px(40), DisplayUtils.dp2px(40));
91 90 image.setLayoutParams(params1);
92 91 }
93 92 }
... ...
app/src/main/res/layout/fragment_ce_ping.xml
... ... @@ -140,8 +140,10 @@
140 140 android:layout_width="wrap_content"
141 141 android:layout_height="wrap_content"
142 142 android:text="活动专栏"
  143 + android:layout_marginLeft="@dimen/size_dp_5"
  144 + android:layout_marginRight="@dimen/size_dp_5"
143 145 android:textColor="@color/huodong_blue"
144   - android:textSize="@dimen/textSize18"
  146 + android:textSize="@dimen/textSize16"
145 147  
146 148 />
147 149  
... ... @@ -197,6 +199,7 @@
197 199 android:background="@drawable/shape_stroke_radius4_white"
198 200 android:padding="@dimen/size_dp_2"
199 201 android:text="点击参与"
  202 + android:visibility="gone"
200 203 android:textColor="@color/white"
201 204 android:textSize="@dimen/textSize14" />
202 205  
... ... @@ -250,6 +253,7 @@
250 253 android:background="@drawable/shape_stroke_radius4_white"
251 254 android:padding="@dimen/size_dp_2"
252 255 android:text="点击参与"
  256 + android:visibility="gone"
253 257 android:textColor="@color/white"
254 258 android:textSize="@dimen/textSize14" />
255 259  
... ... @@ -296,6 +300,7 @@
296 300 android:background="@drawable/shape_stroke_radius4_white"
297 301 android:padding="@dimen/size_dp_2"
298 302 android:text="点击参与"
  303 + android:visibility="gone"
299 304 android:textColor="@color/white"
300 305 android:textSize="@dimen/textSize14" />
301 306  
... ...