Commit ddc684059e269a97115123ee3f97d15cbac314a4

Authored by 杨帅
1 parent a3662d3e

1 修改详情页相关UI

moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/ALLScoreDetailFragmentPresenter.java
@@ -76,6 +76,19 @@ public class ALLScoreDetailFragmentPresenter extends MvpBasePresenter<ALLScoreDe @@ -76,6 +76,19 @@ public class ALLScoreDetailFragmentPresenter extends MvpBasePresenter<ALLScoreDe
76 } 76 }
77 77
78 } 78 }
  79 + //如果用户点击暂停按钮,进行分段查询
  80 + if (runningFinishBean.isPause()) {
  81 + long continueTime = 0;
  82 + if (!TextUtils.isEmpty(runningFinishBean.getUserContinueTime())) {
  83 + continueTime = Long.parseLong(runningFinishBean.getUserContinueTime());
  84 + }
  85 + long userFinishTime=0;
  86 + if (!TextUtils.isEmpty(runningFinishBean.getUserFinishTime())){
  87 + userFinishTime = Long.parseLong(runningFinishBean.getUserFinishTime());
  88 + }
  89 + //开始进行轨迹查询
  90 +
  91 + }
79 } 92 }
80 //查询失败 93 //查询失败
81 else { 94 else {
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunRaceDetailFragmentView.java
@@ -14,6 +14,7 @@ import android.support.v4.content.ContextCompat; @@ -14,6 +14,7 @@ import android.support.v4.content.ContextCompat;
14 import android.text.TextUtils; 14 import android.text.TextUtils;
15 import android.util.Log; 15 import android.util.Log;
16 import android.view.View; 16 import android.view.View;
  17 +import android.view.ViewGroup;
17 import android.widget.LinearLayout; 18 import android.widget.LinearLayout;
18 import android.widget.Toast; 19 import android.widget.Toast;
19 20
@@ -57,6 +58,7 @@ import com.baidu.trace.model.SortType; @@ -57,6 +58,7 @@ import com.baidu.trace.model.SortType;
57 import com.cnlive.libs.base.logic.Event; 58 import com.cnlive.libs.base.logic.Event;
58 import com.cnlive.libs.base.logic.callback.FailureCallback; 59 import com.cnlive.libs.base.logic.callback.FailureCallback;
59 import com.cnlive.libs.base.logic.callback.SuccessCallback; 60 import com.cnlive.libs.base.logic.callback.SuccessCallback;
  61 +import com.cnlive.libs.base.util.StatusBarUtil2;
60 import com.cnlive.moudle.pedometer.commonInfo.CollCommonInfo; 62 import com.cnlive.moudle.pedometer.commonInfo.CollCommonInfo;
61 import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; 63 import com.cnlive.moudle.pedometer.commonInfo.CommonInfo;
62 import com.cnlive.moudle.pedometer.model.Constant; 64 import com.cnlive.moudle.pedometer.model.Constant;
@@ -83,6 +85,7 @@ import com.cnlive.moudle.pedometer.utils.TimeUtil; @@ -83,6 +85,7 @@ import com.cnlive.moudle.pedometer.utils.TimeUtil;
83 import com.cnlive.strike.application.GlideApp; 85 import com.cnlive.strike.application.GlideApp;
84 import com.example.moudle_pedometer.R; 86 import com.example.moudle_pedometer.R;
85 import com.hannesdorfmann.mosby3.mvp.MvpView; 87 import com.hannesdorfmann.mosby3.mvp.MvpView;
  88 +import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
86 import com.sothree.slidinguppanel.SlidingUpPanelLayout; 89 import com.sothree.slidinguppanel.SlidingUpPanelLayout;
87 90
88 import java.io.File; 91 import java.io.File;
@@ -242,6 +245,23 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { @@ -242,6 +245,23 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
242 fragment.binding.slidingLayout.addPanelSlideListener(new SlidingUpPanelLayout.PanelSlideListener() { 245 fragment.binding.slidingLayout.addPanelSlideListener(new SlidingUpPanelLayout.PanelSlideListener() {
243 @Override 246 @Override
244 public void onPanelSlide(View panel, float slideOffset) { 247 public void onPanelSlide(View panel, float slideOffset) {
  248 + //设置顶层卡片特效
  249 +// if (slideOffset > 0.6) {
  250 +// fragment.binding.llTop.setVisibility(View.VISIBLE);
  251 +//// ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) fragment.binding.scrollView.getLayoutParams();
  252 +//// params.topMargin = ScreenUtil.dip2px(getContext(), 50);
  253 +//// fragment.binding.scrollView.setLayoutParams(params);
  254 +// } else {
  255 +// fragment.binding.llTop.setVisibility(View.GONE);
  256 +// }
  257 + if (slideOffset <= 0.6) {
  258 + if (fragment.binding.flTop.getVisibility() == View.VISIBLE) {
  259 + QMUIStatusBarHelper.setStatusBarLightMode(fragment.getActivity());
  260 + StatusBarUtil2.setColor(fragment.getActivity(), getContext().getResources().getColor(R.color.white), 0);
  261 + fragment.binding.flTop.setVisibility(View.GONE);
  262 + }
  263 + }
  264 + //设置卡片缩放特效
245 if (slideOffset >= 0 && slideOffset <= 1) { 265 if (slideOffset >= 0 && slideOffset <= 1) {
246 int leakWidth = (int) (ScreenUtil.dip2px(getContext(), 15) / 0.6); 266 int leakWidth = (int) (ScreenUtil.dip2px(getContext(), 15) / 0.6);
247 LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); 267 LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
@@ -281,6 +301,47 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { @@ -281,6 +301,47 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
281 301
282 @Override 302 @Override
283 public void onPanelStateChanged(View panel, SlidingUpPanelLayout.PanelState previousState, SlidingUpPanelLayout.PanelState newState) { 303 public void onPanelStateChanged(View panel, SlidingUpPanelLayout.PanelState previousState, SlidingUpPanelLayout.PanelState newState) {
  304 +// Log.e(TAG, "previousState: " + previousState + ",newState:" + newState);
  305 + if (previousState == SlidingUpPanelLayout.PanelState.ANCHORED && newState == SlidingUpPanelLayout.PanelState.DRAGGING) {
  306 + if (fragment.binding.flTop.getVisibility() != View.VISIBLE) {
  307 + QMUIStatusBarHelper.setStatusBarDarkMode(fragment.getActivity());
  308 + StatusBarUtil2.setColor(fragment.getActivity(), getContext().getResources().getColor(R.color.run_main_bg), 0);
  309 + fragment.binding.flTop.setVisibility(View.VISIBLE);
  310 +
  311 + }
  312 + } else if (previousState == SlidingUpPanelLayout.PanelState.DRAGGING && newState == SlidingUpPanelLayout.PanelState.EXPANDED) {
  313 + if (fragment.binding.flTop.getVisibility() != View.VISIBLE) {
  314 + QMUIStatusBarHelper.setStatusBarDarkMode(fragment.getActivity());
  315 + StatusBarUtil2.setColor(fragment.getActivity(), getContext().getResources().getColor(R.color.run_main_bg), 0);
  316 + fragment.binding.flTop.setVisibility(View.VISIBLE);
  317 +
  318 + }
  319 + } else if (previousState == SlidingUpPanelLayout.PanelState.EXPANDED && newState == SlidingUpPanelLayout.PanelState.DRAGGING) {
  320 + QMUIStatusBarHelper.setStatusBarLightMode(fragment.getActivity());
  321 + StatusBarUtil2.setColor(fragment.getActivity(), getContext().getResources().getColor(R.color.white), 0);
  322 +
  323 + if (fragment.binding.flTop.getVisibility() != View.GONE) {
  324 + fragment.binding.flTop.setVisibility(View.GONE);
  325 + }
  326 + } else if (previousState == SlidingUpPanelLayout.PanelState.DRAGGING && newState == SlidingUpPanelLayout.PanelState.ANCHORED) {
  327 + QMUIStatusBarHelper.setStatusBarLightMode(fragment.getActivity());
  328 + StatusBarUtil2.setColor(fragment.getActivity(), getContext().getResources().getColor(R.color.white), 0);
  329 +
  330 + if (fragment.binding.flTop.getVisibility() != View.GONE) {
  331 + fragment.binding.flTop.setVisibility(View.GONE);
  332 + }
  333 + }
  334 +
  335 + }
  336 + });
  337 + //卡片滑动上层标题
  338 + fragment.binding.llTopBack.setOnClickListener(new View.OnClickListener() {
  339 + @Override
  340 + public void onClick(View view) {
  341 + if (getContext() == null) {
  342 + return;
  343 + }
  344 + fragment.getActivity().finish();
284 } 345 }
285 }); 346 });
286 /*************************设置相关页面数据***************************/ 347 /*************************设置相关页面数据***************************/
@@ -293,9 +354,9 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { @@ -293,9 +354,9 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
293 fragment.binding.includeStreet.tvRaceTitle.setText(runRaceDetailInfo.getTitle()); 354 fragment.binding.includeStreet.tvRaceTitle.setText(runRaceDetailInfo.getTitle());
294 //根据标题字数动态设置卡片高度 355 //根据标题字数动态设置卡片高度
295 if (runRaceDetailInfo.getTitle().length() > 19) { 356 if (runRaceDetailInfo.getTitle().length() > 19) {
296 - fragment.binding.slidingLayout.setPanelHeight(ScreenUtil.dip2px(getContext(), 149)); 357 + fragment.binding.slidingLayout.setPanelHeight(ScreenUtil.dip2px(getContext(), 200));
297 } else { 358 } else {
298 - fragment.binding.slidingLayout.setPanelHeight(ScreenUtil.dip2px(getContext(), 141)); 359 + fragment.binding.slidingLayout.setPanelHeight(ScreenUtil.dip2px(getContext(), 181));
299 } 360 }
300 fragment.binding.slidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); 361 fragment.binding.slidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
301 } 362 }
@@ -317,21 +378,21 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { @@ -317,21 +378,21 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
317 fragment.binding.includeStreet.tvEndAddr.setText(runRaceDetailInfo.getEndLocation()); 378 fragment.binding.includeStreet.tvEndAddr.setText(runRaceDetailInfo.getEndLocation());
318 } 379 }
319 //设置起始报名时间 380 //设置起始报名时间
320 - if (!TextUtils.isEmpty(TimeUtil.getStampToTime(runRaceDetailInfo.getSign_up_start_time(), "yyyy-MM-dd"))) {  
321 - fragment.binding.includeStreet.tvSignUpStartTime.setText(TimeUtil.getStampToTime(runRaceDetailInfo.getSign_up_start_time(), "yyyy-MM-dd")); 381 + if (!TextUtils.isEmpty(TimeUtil.getStampToTime(runRaceDetailInfo.getSign_up_start_time(), "yyyy.MM.dd"))) {
  382 + fragment.binding.includeStreet.tvSignUpStartTime.setText(TimeUtil.getStampToTime(runRaceDetailInfo.getSign_up_start_time(), "yyyy.MM.dd"));
322 383
323 } 384 }
324 //设置终止报名时间 385 //设置终止报名时间
325 - if (!TextUtils.isEmpty(TimeUtil.getStampToTime(runRaceDetailInfo.getSign_up_end_time(), "yyyy-MM-dd"))) {  
326 - fragment.binding.includeStreet.tvSignUpEndTime.setText(TimeUtil.getStampToTime(runRaceDetailInfo.getSign_up_end_time(), "yyyy-MM-dd")); 386 + if (!TextUtils.isEmpty(TimeUtil.getStampToTime(runRaceDetailInfo.getSign_up_end_time(), "yyyy.MM.dd"))) {
  387 + fragment.binding.includeStreet.tvSignUpEndTime.setText(TimeUtil.getStampToTime(runRaceDetailInfo.getSign_up_end_time(), "yyyy.MM.dd"));
327 } 388 }
328 //设置活动开始时间 389 //设置活动开始时间
329 - if (!TextUtils.isEmpty(TimeUtil.getStampToTime(runRaceDetailInfo.getStart_time(), "yyyy-MM-dd"))) {  
330 - fragment.binding.includeStreet.tvActiveStartTime.setText(TimeUtil.getStampToTime(runRaceDetailInfo.getStart_time(), "yyyy-MM-dd")); 390 + if (!TextUtils.isEmpty(TimeUtil.getStampToTime(runRaceDetailInfo.getStart_time(), "yyyy.MM.dd"))) {
  391 + fragment.binding.includeStreet.tvActiveStartTime.setText(TimeUtil.getStampToTime(runRaceDetailInfo.getStart_time(), "yyyy.MM.dd"));
331 } 392 }
332 //设置活动结束时间 393 //设置活动结束时间
333 - if (!TextUtils.isEmpty(TimeUtil.getStampToTime(runRaceDetailInfo.getEnd_time(), "yyyy-MM-dd"))) {  
334 - fragment.binding.includeStreet.tvActiveEndTime.setText(TimeUtil.getStampToTime(runRaceDetailInfo.getEnd_time(), "yyyy-MM-dd")); 394 + if (!TextUtils.isEmpty(TimeUtil.getStampToTime(runRaceDetailInfo.getEnd_time(), "yyyy.MM.dd"))) {
  395 + fragment.binding.includeStreet.tvActiveEndTime.setText(TimeUtil.getStampToTime(runRaceDetailInfo.getEnd_time(), "yyyy.MM.dd"));
335 } 396 }
336 //设置活动类型 397 //设置活动类型
337 if (!TextUtils.isEmpty(runRaceDetailInfo.getEventType())) { 398 if (!TextUtils.isEmpty(runRaceDetailInfo.getEventType())) {
moudle_pedometer/src/main/res/drawable-hdpi/icon_run_white_back.png 0 → 100644

542 Bytes

moudle_pedometer/src/main/res/drawable-xhdpi/icon_run_white_back.png 0 → 100644

705 Bytes

moudle_pedometer/src/main/res/drawable-xxhdpi/icon_run_white_back.png 0 → 100644

1.17 KB

moudle_pedometer/src/main/res/layout/fragment_run_race_detail.xml
@@ -72,6 +72,7 @@ @@ -72,6 +72,7 @@
72 android:id="@+id/scrollView" 72 android:id="@+id/scrollView"
73 android:layout_width="match_parent" 73 android:layout_width="match_parent"
74 android:layout_height="match_parent" 74 android:layout_height="match_parent"
  75 + android:layout_marginTop="40dp"
75 android:scrollbars="none"> 76 android:scrollbars="none">
76 77
77 <LinearLayout 78 <LinearLayout
@@ -141,6 +142,40 @@ @@ -141,6 +142,40 @@
141 android:visibility="gone" /> 142 android:visibility="gone" />
142 143
143 </RelativeLayout> 144 </RelativeLayout>
  145 +
  146 + <FrameLayout
  147 + android:id="@+id/fl_top"
  148 + android:layout_width="match_parent"
  149 + android:layout_height="40dp"
  150 + android:layout_gravity="top"
  151 + android:background="@color/run_main_bg"
  152 + android:gravity="center"
  153 + android:visibility="gone">
  154 +
  155 + <LinearLayout
  156 + android:id="@+id/ll_top_back"
  157 + android:layout_width="wrap_content"
  158 + android:layout_height="match_parent"
  159 + android:layout_gravity="center_vertical"
  160 + android:gravity="center"
  161 + android:padding="10dp">
  162 +
  163 + <ImageView
  164 + android:layout_width="12dp"
  165 + android:layout_height="20dp"
  166 + android:background="@drawable/icon_run_white_back" />
  167 + </LinearLayout>
  168 +
  169 + <TextView
  170 + android:layout_width="wrap_content"
  171 + android:layout_height="wrap_content"
  172 + android:layout_gravity="center"
  173 + android:text="路线详情"
  174 + android:textColor="@color/white"
  175 + android:textSize="18sp"
  176 + />
  177 + </FrameLayout>
  178 +
144 <com.cnlive.strike.ui.widget.UIEmptyView 179 <com.cnlive.strike.ui.widget.UIEmptyView
145 android:id="@+id/empty_layout" 180 android:id="@+id/empty_layout"
146 android:layout_width="match_parent" 181 android:layout_width="match_parent"
moudle_pedometer/src/main/res/layout/layout_run_detail_street.xml
@@ -3,8 +3,7 @@ @@ -3,8 +3,7 @@
3 3
4 <LinearLayout xmlns:FivePersonIconView="http://schemas.android.com/apk/res-auto" 4 <LinearLayout xmlns:FivePersonIconView="http://schemas.android.com/apk/res-auto"
5 android:layout_width="match_parent" 5 android:layout_width="match_parent"
6 - android:layout_height="wrap_content"  
7 - android:background="@color/white"> 6 + android:layout_height="wrap_content">
8 7
9 <LinearLayout 8 <LinearLayout
10 android:id="@+id/ll_run_detail_street_root" 9 android:id="@+id/ll_run_detail_street_root"
@@ -25,7 +24,7 @@ @@ -25,7 +24,7 @@
25 android:layout_height="wrap_content" 24 android:layout_height="wrap_content"
26 android:layout_marginLeft="15dp" 25 android:layout_marginLeft="15dp"
27 android:layout_marginRight="15dp" 26 android:layout_marginRight="15dp"
28 - android:background="@drawable/shape_left_right_10dp_white_raduis_bg" 27 + android:background="@color/white"
29 android:orientation="vertical"> 28 android:orientation="vertical">
30 <!--活动标题--> 29 <!--活动标题-->
31 <TextView 30 <TextView
@@ -33,7 +32,7 @@ @@ -33,7 +32,7 @@
33 android:layout_width="wrap_content" 32 android:layout_width="wrap_content"
34 android:layout_height="wrap_content" 33 android:layout_height="wrap_content"
35 android:layout_marginLeft="10dp" 34 android:layout_marginLeft="10dp"
36 - android:layout_marginTop="10dp" 35 + android:layout_marginTop="15dp"
37 android:text="--" 36 android:text="--"
38 android:textColor="@color/text_black" 37 android:textColor="@color/text_black"
39 android:textSize="18sp" 38 android:textSize="18sp"
@@ -78,15 +77,18 @@ @@ -78,15 +77,18 @@
78 android:textSize="15sp" /> 77 android:textSize="15sp" />
79 78
80 </LinearLayout> 79 </LinearLayout>
  80 +
  81 + <View
  82 + android:layout_width="match_parent"
  83 + android:layout_height="1dp"
  84 + android:layout_marginLeft="35dp"
  85 + android:layout_marginTop="-5dp"
  86 + android:layout_marginRight="35dp"
  87 + android:layout_marginBottom="5dp"
  88 + android:background="@color/line" />
81 </LinearLayout> 89 </LinearLayout>
82 90
83 - <View  
84 - android:layout_width="match_parent"  
85 - android:layout_height="1dp"  
86 - android:layout_marginLeft="35dp"  
87 - android:layout_marginRight="35dp"  
88 - android:layout_marginBottom="5dp"  
89 - android:background="@color/line" /> 91 +
90 <!--按钮--> 92 <!--按钮-->
91 <RelativeLayout 93 <RelativeLayout
92 android:id="@+id/rl_start_btn" 94 android:id="@+id/rl_start_btn"
@@ -129,6 +131,8 @@ @@ -129,6 +131,8 @@
129 android:layout_marginRight="15dp" 131 android:layout_marginRight="15dp"
130 android:background="@color/white" 132 android:background="@color/white"
131 android:orientation="vertical"> 133 android:orientation="vertical">
  134 +
  135 +
132 <!--起点--> 136 <!--起点-->
133 <LinearLayout 137 <LinearLayout
134 android:layout_width="match_parent" 138 android:layout_width="match_parent"
@@ -242,7 +246,7 @@ @@ -242,7 +246,7 @@
242 android:layout_width="wrap_content" 246 android:layout_width="wrap_content"
243 android:layout_height="match_parent" 247 android:layout_height="match_parent"
244 android:layout_marginLeft="5dp" 248 android:layout_marginLeft="5dp"
245 - android:text="——" 249 + android:text=""
246 android:textColor="@color/text_black" 250 android:textColor="@color/text_black"
247 android:textSize="15sp" /> 251 android:textSize="15sp" />
248 252
@@ -304,7 +308,7 @@ @@ -304,7 +308,7 @@
304 android:layout_width="wrap_content" 308 android:layout_width="wrap_content"
305 android:layout_height="match_parent" 309 android:layout_height="match_parent"
306 android:layout_marginLeft="5dp" 310 android:layout_marginLeft="5dp"
307 - android:text="——" 311 + android:text=""
308 android:textColor="@color/text_black" 312 android:textColor="@color/text_black"
309 android:textSize="15sp" /> 313 android:textSize="15sp" />
310 314