Commit 34523b04f6b740afe456158a43801d18e0086717
Exists in
yxb_dev
and in
2 other branches
no message
Showing
3 changed files
with
24 additions
and
4 deletions
Show diff stats
app/src/main/java/com/shunzhi/parent/ui/fragment/StartFragment.java
1 | package com.shunzhi.parent.ui.fragment; | 1 | package com.shunzhi.parent.ui.fragment; |
2 | 2 | ||
3 | import android.os.Bundle; | 3 | import android.os.Bundle; |
4 | +import android.os.CountDownTimer; | ||
4 | import android.os.Handler; | 5 | import android.os.Handler; |
5 | import android.os.Message; | 6 | import android.os.Message; |
6 | import android.support.annotation.NonNull; | 7 | import android.support.annotation.NonNull; |
@@ -41,6 +42,20 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | @@ -41,6 +42,20 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | ||
41 | 42 | ||
42 | JZVideoPlayerStandard jiecaoVideo; | 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 | @Override | 59 | @Override |
45 | public int getLayoutId() { | 60 | public int getLayoutId() { |
46 | return R.layout.fragment_start; | 61 | return R.layout.fragment_start; |
@@ -58,7 +73,7 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | @@ -58,7 +73,7 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | ||
58 | jiecaoVideo.batteryLevel.setVisibility(View.GONE); | 73 | jiecaoVideo.batteryLevel.setVisibility(View.GONE); |
59 | jiecaoVideo.thumbImageView.setVisibility(View.GONE); | 74 | jiecaoVideo.thumbImageView.setVisibility(View.GONE); |
60 | jiecaoVideo.loadingProgressBar.setVisibility(View.GONE); | 75 | jiecaoVideo.loadingProgressBar.setVisibility(View.GONE); |
61 | - | 76 | + countDownTimer.start(); |
62 | isQidong = TextUtils.isEmpty(AppConfig.getAppConfig(getContext()).get(AppConfig.APP_IS_START)); | 77 | isQidong = TextUtils.isEmpty(AppConfig.getAppConfig(getContext()).get(AppConfig.APP_IS_START)); |
63 | if (isQidong) { | 78 | if (isQidong) { |
64 | jiecaoVideo.setVisibility(View.VISIBLE); | 79 | jiecaoVideo.setVisibility(View.VISIBLE); |
@@ -150,5 +165,6 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | @@ -150,5 +165,6 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | ||
150 | @Override | 165 | @Override |
151 | public void onDestroy() { | 166 | public void onDestroy() { |
152 | super.onDestroy(); | 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,8 +86,7 @@ public class TextAndImgShowView extends LinearLayout { | ||
86 | DisplayUtils.dp2px(layout_control.getPaddingLeft() + layout_control.getPaddingRight()+20 | 86 | DisplayUtils.dp2px(layout_control.getPaddingLeft() + layout_control.getPaddingRight()+20 |
87 | )) / 4; | 87 | )) / 4; |
88 | layout.setLayoutParams(params); | 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 | image.setLayoutParams(params1); | 90 | image.setLayoutParams(params1); |
92 | } | 91 | } |
93 | } | 92 | } |
app/src/main/res/layout/fragment_ce_ping.xml
@@ -140,8 +140,10 @@ | @@ -140,8 +140,10 @@ | ||
140 | android:layout_width="wrap_content" | 140 | android:layout_width="wrap_content" |
141 | android:layout_height="wrap_content" | 141 | android:layout_height="wrap_content" |
142 | android:text="活动专栏" | 142 | android:text="活动专栏" |
143 | + android:layout_marginLeft="@dimen/size_dp_5" | ||
144 | + android:layout_marginRight="@dimen/size_dp_5" | ||
143 | android:textColor="@color/huodong_blue" | 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,6 +199,7 @@ | ||
197 | android:background="@drawable/shape_stroke_radius4_white" | 199 | android:background="@drawable/shape_stroke_radius4_white" |
198 | android:padding="@dimen/size_dp_2" | 200 | android:padding="@dimen/size_dp_2" |
199 | android:text="点击参与" | 201 | android:text="点击参与" |
202 | + android:visibility="gone" | ||
200 | android:textColor="@color/white" | 203 | android:textColor="@color/white" |
201 | android:textSize="@dimen/textSize14" /> | 204 | android:textSize="@dimen/textSize14" /> |
202 | 205 | ||
@@ -250,6 +253,7 @@ | @@ -250,6 +253,7 @@ | ||
250 | android:background="@drawable/shape_stroke_radius4_white" | 253 | android:background="@drawable/shape_stroke_radius4_white" |
251 | android:padding="@dimen/size_dp_2" | 254 | android:padding="@dimen/size_dp_2" |
252 | android:text="点击参与" | 255 | android:text="点击参与" |
256 | + android:visibility="gone" | ||
253 | android:textColor="@color/white" | 257 | android:textColor="@color/white" |
254 | android:textSize="@dimen/textSize14" /> | 258 | android:textSize="@dimen/textSize14" /> |
255 | 259 | ||
@@ -296,6 +300,7 @@ | @@ -296,6 +300,7 @@ | ||
296 | android:background="@drawable/shape_stroke_radius4_white" | 300 | android:background="@drawable/shape_stroke_radius4_white" |
297 | android:padding="@dimen/size_dp_2" | 301 | android:padding="@dimen/size_dp_2" |
298 | android:text="点击参与" | 302 | android:text="点击参与" |
303 | + android:visibility="gone" | ||
299 | android:textColor="@color/white" | 304 | android:textColor="@color/white" |
300 | android:textSize="@dimen/textSize14" /> | 305 | android:textSize="@dimen/textSize14" /> |
301 | 306 |