Commit 01ec96b459169f3c7c78c0f3af7206c373fec15b

Authored by 韩亚云
1 parent 70d69cfc

重新上传页面

moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/LineUpAgainPresenter.java 0 → 100644
  1 +package com.cnlive.moudle.pedometer.frame.presenter;
  2 +
  3 +import com.cnlive.moudle.pedometer.frame.view.LineUpAgainView;
  4 +import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter;
  5 +
  6 +/**
  7 + * Created by hanyayun 019/06/20.
  8 + */
  9 +public class LineUpAgainPresenter extends MvpBasePresenter<LineUpAgainView> {
  10 + public void getData(){
  11 + getView().setData();
  12 + }
  13 +}
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/LineUpAgainView.java 0 → 100644
  1 +package com.cnlive.moudle.pedometer.frame.view;
  2 +
  3 +import android.support.v7.widget.LinearLayoutManager;
  4 +
  5 +import com.cnlive.moudle.pedometer.ui.adapter.LineUpAgainAdapter;
  6 +import com.cnlive.moudle.pedometer.ui.fragment.LineUpAgainFragment;
  7 +import com.example.moudle_pedometer.R;
  8 +import com.hannesdorfmann.mosby3.mvp.MvpView;
  9 +import com.scwang.smartrefresh.layout.footer.ClassicsFooter;
  10 +import com.scwang.smartrefresh.layout.header.ClassicsHeader;
  11 +
  12 +import java.util.ArrayList;
  13 +import java.util.List;
  14 +
  15 +
  16 +/**
  17 + * Created by hanyayun 019/06/20.
  18 + */
  19 +public class LineUpAgainView implements MvpView {
  20 +
  21 + private LineUpAgainFragment fragment;
  22 +
  23 + public LineUpAgainView(LineUpAgainFragment fragment) {
  24 + this.fragment = fragment;
  25 + }
  26 +
  27 + public void initView(){
  28 + fragment.binding.topbar.addLeftImageButton(R.drawable.top_back_black, R.id.fragment_back).setOnClickListener(v -> {
  29 + fragment.getActivity().finish();
  30 + });
  31 + fragment.binding.topbar.setTitle("重新上传");
  32 +
  33 +// fragment.binding.refreshLayout.setRefreshHeader(new ClassicsHeader(fragment.getActivity()));
  34 +// fragment.binding.refreshLayout.setRefreshFooter(new ClassicsFooter(fragment.getActivity()));
  35 + fragment.binding.recycler.setLayoutManager(new LinearLayoutManager(fragment.getActivity()));
  36 + }
  37 +
  38 + public void setData(){
  39 + List<String> list = new ArrayList<>();
  40 + list.add("fffff");
  41 + list.add("fffff");
  42 + list.add("fffff");
  43 + list.add("fffff");
  44 + list.add("fffff");
  45 + LineUpAgainAdapter againAdapter = new LineUpAgainAdapter(list,fragment.getActivity());
  46 + fragment.binding.recycler.setAdapter(againAdapter);
  47 + }
  48 +}
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RaceRecorView.java
@@ -40,6 +40,15 @@ public class RaceRecorView implements MvpView { @@ -40,6 +40,15 @@ public class RaceRecorView implements MvpView {
40 .create(); 40 .create();
41 } 41 }
42 42
  43 + public void initView(){
  44 + fragment.binding.topbar.addLeftImageButton(R.drawable.top_back_black, R.id.fragment_back).setOnClickListener(v -> {
  45 + fragment.getActivity().finish();
  46 + });
  47 + fragment.binding.topbar.setTitle("全部成绩");
  48 + fragment.binding.refreshLayout.setRefreshHeader(new ClassicsHeader(fragment.getActivity()));
  49 + fragment.binding.refreshLayout.setRefreshFooter(new ClassicsFooter(fragment.getActivity()));
  50 + }
  51 +
43 public void setData(BaseInfo<RaceRecordInfo> raceRecordInfoBaseInfo){ 52 public void setData(BaseInfo<RaceRecordInfo> raceRecordInfoBaseInfo){
44 hideLoading(); 53 hideLoading();
45 fragment.binding.ryRecord.setVisibility(View.VISIBLE); 54 fragment.binding.ryRecord.setVisibility(View.VISIBLE);
@@ -99,15 +108,6 @@ public class RaceRecorView implements MvpView { @@ -99,15 +108,6 @@ public class RaceRecorView implements MvpView {
99 fragment.binding.refreshLayout.finishLoadMore(); 108 fragment.binding.refreshLayout.finishLoadMore();
100 } 109 }
101 110
102 - public void initView(){  
103 - fragment.binding.topbar.addLeftImageButton(R.drawable.top_back_black, R.id.fragment_back).setOnClickListener(v -> {  
104 - fragment.getActivity().finish();  
105 - });  
106 - fragment.binding.topbar.setTitle("全部成绩");  
107 - fragment.binding.refreshLayout.setRefreshHeader(new ClassicsHeader(fragment.getActivity()));  
108 - fragment.binding.refreshLayout.setRefreshFooter(new ClassicsFooter(fragment.getActivity()));  
109 - }  
110 -  
111 public void showEmpty(){ 111 public void showEmpty(){
112 fragment.binding.refreshLayout.setVisibility(View.GONE); 112 fragment.binding.refreshLayout.setVisibility(View.GONE);
113 fragment.binding.emptyNet.setVisibility(View.VISIBLE); 113 fragment.binding.emptyNet.setVisibility(View.VISIBLE);
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/activity/LineUpAgainActivity.java
@@ -7,6 +7,8 @@ import android.os.Bundle; @@ -7,6 +7,8 @@ import android.os.Bundle;
7 7
8 import com.cnlive.libs.base.util.StatusBarUtil; 8 import com.cnlive.libs.base.util.StatusBarUtil;
9 import com.cnlive.libs.base.util.StatusBarUtil2; 9 import com.cnlive.libs.base.util.StatusBarUtil2;
  10 +import com.cnlive.moudle.pedometer.ui.fragment.LineUpAgainFragment;
  11 +import com.cnlive.moudle.pedometer.ui.fragment.RaceRecorFragment;
10 import com.example.moudle_pedometer.R; 12 import com.example.moudle_pedometer.R;
11 13
12 /** 14 /**
@@ -27,5 +29,7 @@ public class LineUpAgainActivity extends AppCompatActivity { @@ -27,5 +29,7 @@ public class LineUpAgainActivity extends AppCompatActivity {
27 StatusBarUtil.setStatusBarWrite(this); 29 StatusBarUtil.setStatusBarWrite(this);
28 StatusBarUtil2.setColor(this, getResources().getColor(R.color.color_fff), 0); 30 StatusBarUtil2.setColor(this, getResources().getColor(R.color.color_fff), 0);
29 setContentView(R.layout.activity_line_up_again); 31 setContentView(R.layout.activity_line_up_again);
  32 +
  33 + getSupportFragmentManager().beginTransaction().replace(R.id.line_up_container,new LineUpAgainFragment()).commit();
30 } 34 }
31 } 35 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/activity/RegistrationInfoActivity.java
@@ -28,6 +28,5 @@ public class RegistrationInfoActivity extends AppCompatActivity { @@ -28,6 +28,5 @@ public class RegistrationInfoActivity extends AppCompatActivity {
28 StatusBarUtil2.setColor(this, getResources().getColor(R.color.color_fff), 0); 28 StatusBarUtil2.setColor(this, getResources().getColor(R.color.color_fff), 0);
29 setContentView(R.layout.activity_registration_info); 29 setContentView(R.layout.activity_registration_info);
30 getSupportFragmentManager().beginTransaction().replace(R.id.container, RegistrationInfoFragment.newInstance()).commit(); 30 getSupportFragmentManager().beginTransaction().replace(R.id.container, RegistrationInfoFragment.newInstance()).commit();
31 - setContentView(R.layout.activity_registration_info);  
32 } 31 }
33 } 32 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/adapter/LineUpAgainAdapter.java 0 → 100644
  1 +package com.cnlive.moudle.pedometer.ui.adapter;
  2 +
  3 +
  4 +import android.content.Context;
  5 +import android.support.annotation.NonNull;
  6 +import android.support.v7.widget.RecyclerView;
  7 +import android.view.LayoutInflater;
  8 +import android.view.View;
  9 +import android.view.ViewGroup;
  10 +import android.widget.ImageView;
  11 +import android.widget.RelativeLayout;
  12 +import android.widget.TextView;
  13 +
  14 +import com.cnlive.moudle.pedometer.net.bean.EventRouteRecordBeanVoListBean;
  15 +import com.cnlive.moudle.pedometer.utils.TimeUtil;
  16 +import com.example.moudle_pedometer.R;
  17 +
  18 +import java.util.List;
  19 +
  20 +/**
  21 + * Created by hanyayun 019/06/20.
  22 + */
  23 +public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter.MyHolder> {
  24 +
  25 + private List<String> list;
  26 + private Context context;
  27 + private OnClickListener onClickListener;
  28 +
  29 + public void setOnClickListener(OnClickListener onClickListener) {
  30 + this.onClickListener = onClickListener;
  31 + }
  32 +
  33 + public LineUpAgainAdapter(List<String> list, Context context) {
  34 + this.list = list;
  35 + this.context = context;
  36 + }
  37 +
  38 + @NonNull
  39 + @Override
  40 + public MyHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
  41 + View view = LayoutInflater.from(context).inflate(R.layout.line_up__item_view,viewGroup,false);
  42 + return new MyHolder(view);
  43 + }
  44 +
  45 + @Override
  46 + public void onBindViewHolder(@NonNull MyHolder myHolder, int i) {
  47 +
  48 +// myHolder.again_up.setOnClickListener(v -> );
  49 + if(onClickListener != null) myHolder.ry_re.setOnClickListener(v -> onClickListener.onClickListener(list.get(i),i));
  50 +
  51 + }
  52 +
  53 + @Override
  54 + public int getItemCount() {
  55 + return list.size();
  56 + }
  57 +
  58 + class MyHolder extends RecyclerView.ViewHolder{
  59 +
  60 + TextView up_day;
  61 + TextView up_record_time;
  62 + ImageView up_item_img;
  63 + TextView up_item_title;
  64 + TextView up_kilometer_num;
  65 + TextView up_record_minit;
  66 + TextView up_record_speed;
  67 + TextView up_record_step;
  68 + TextView again_up;
  69 + RelativeLayout ry_re;
  70 +
  71 + public MyHolder(@NonNull View itemView) {
  72 + super(itemView);
  73 + up_day = itemView.findViewById(R.id.up_day);
  74 + up_record_time = itemView.findViewById(R.id.up_record_time);
  75 + up_item_img = itemView.findViewById(R.id.up_item_img);
  76 + up_item_title = itemView.findViewById(R.id.up_item_title);
  77 + up_kilometer_num = itemView.findViewById(R.id.up_kilometer_num);
  78 + up_record_minit = itemView.findViewById(R.id.up_record_minit);
  79 + up_record_speed = itemView.findViewById(R.id.up_record_speed);
  80 + up_record_step = itemView.findViewById(R.id.up_record_step);
  81 + again_up = itemView.findViewById(R.id.again_up);
  82 + ry_re = itemView.findViewById(R.id.ry_re);
  83 + }
  84 + }
  85 +
  86 +
  87 + public interface OnClickListener{
  88 + void onClickListener(String bean, int position);
  89 + }
  90 +}
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/adapter/RaceRecordAdapter.java
@@ -18,6 +18,9 @@ import com.example.moudle_pedometer.R; @@ -18,6 +18,9 @@ import com.example.moudle_pedometer.R;
18 18
19 import java.util.List; 19 import java.util.List;
20 20
  21 +/**
  22 + * Created by hanyayun 019/05/31.
  23 + */
21 public class RaceRecordAdapter extends RecyclerView.Adapter<RaceRecordAdapter.MyHolder> { 24 public class RaceRecordAdapter extends RecyclerView.Adapter<RaceRecordAdapter.MyHolder> {
22 25
23 private List<EventRouteRecordBeanVoListBean> list; 26 private List<EventRouteRecordBeanVoListBean> list;
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/LineUpAgainFragment.java 0 → 100644
  1 +package com.cnlive.moudle.pedometer.ui.fragment;
  2 +
  3 +
  4 +import android.os.Bundle;
  5 +import android.support.annotation.NonNull;
  6 +import android.support.annotation.Nullable;
  7 +import android.view.View;
  8 +
  9 +import com.cnlive.libs.base.frame.fragment.MvpBindingFragment;
  10 +import com.cnlive.moudle.pedometer.frame.presenter.LineUpAgainPresenter;
  11 +import com.cnlive.moudle.pedometer.frame.view.LineUpAgainView;
  12 +import com.example.moudle_pedometer.R;
  13 +import com.example.moudle_pedometer.databinding.FragmentLineUpAgainBinding;
  14 +
  15 +/**
  16 + * Created by hanyayun 019/06/20.
  17 + */
  18 +public class LineUpAgainFragment extends MvpBindingFragment<LineUpAgainView, LineUpAgainPresenter,Object,FragmentLineUpAgainBinding> {
  19 +
  20 +
  21 + public LineUpAgainFragment() {
  22 + // Required empty public constructor
  23 + }
  24 +
  25 +
  26 + @Override
  27 + protected int getLayoutId() {
  28 + return R.layout.fragment_line_up_again;
  29 + }
  30 +
  31 + @Override
  32 + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
  33 + super.onViewCreated(view, savedInstanceState);
  34 + if(getMvpView() != null) getMvpView().initView();
  35 + getPresenter().getData();
  36 + binding.refreshLayout.setEnableLoadMore(false);
  37 + binding.refreshLayout.setEnableRefresh(false);
  38 + }
  39 +}
moudle_pedometer/src/main/res/layout/activity_line_up_again.xml
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 -<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:app="http://schemas.android.com/apk/res-auto" 3 xmlns:app="http://schemas.android.com/apk/res-auto"
4 xmlns:tools="http://schemas.android.com/tools" 4 xmlns:tools="http://schemas.android.com/tools"
5 android:layout_width="match_parent" 5 android:layout_width="match_parent"
6 android:layout_height="match_parent" 6 android:layout_height="match_parent"
7 tools:context="com.cnlive.moudle.pedometer.ui.activity.LineUpAgainActivity"> 7 tools:context="com.cnlive.moudle.pedometer.ui.activity.LineUpAgainActivity">
8 8
9 -</android.support.constraint.ConstraintLayout> 9 + <RelativeLayout
  10 + android:id="@+id/line_up_container"
  11 + android:layout_width="match_parent"
  12 + android:layout_height="match_parent"/>
  13 +</RelativeLayout>
moudle_pedometer/src/main/res/layout/fragment_line_up_again.xml 0 → 100644
  1 +<layout xmlns:android="http://schemas.android.com/apk/res/android">
  2 +
  3 + <LinearLayout
  4 + android:layout_width="match_parent"
  5 + android:layout_height="match_parent"
  6 + android:orientation="vertical">
  7 +
  8 + <com.qmuiteam.qmui.widget.QMUITopBar
  9 + android:id="@+id/topbar"
  10 + android:layout_width="match_parent"
  11 + android:layout_height="?attr/qmui_topbar_height" />
  12 +
  13 + <com.scwang.smartrefresh.layout.SmartRefreshLayout
  14 + android:id="@+id/refreshLayout"
  15 + android:layout_width="match_parent"
  16 + android:layout_height="match_parent"
  17 + android:background="#F8F8F8" >
  18 +
  19 + <android.support.v7.widget.RecyclerView
  20 + android:id="@+id/recycler"
  21 + android:layout_width="match_parent"
  22 + android:layout_height="match_parent"
  23 + />
  24 +
  25 + </com.scwang.smartrefresh.layout.SmartRefreshLayout>
  26 + </LinearLayout>
  27 +</layout>
  28 +
moudle_pedometer/src/main/res/layout/line_up__item_view.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<layout xmlns:android="http://schemas.android.com/apk/res/android">
  3 +
  4 + <data>
  5 +
  6 + </data>
  7 + <RelativeLayout
  8 + android:id="@+id/ry_re"
  9 + android:layout_width="match_parent"
  10 + android:layout_height="wrap_content"
  11 + android:background="@color/white"
  12 + android:layout_marginTop="10dp"
  13 + android:layout_marginLeft="10dp"
  14 + android:layout_marginRight="10dp"
  15 + android:padding="10dp">
  16 +
  17 + <TextView
  18 + android:id="@+id/up_day"
  19 + android:layout_width="wrap_content"
  20 + android:layout_height="wrap_content"
  21 + android:textColor="#333333"
  22 + android:textSize="14sp"
  23 + android:text="5月1日" />
  24 +
  25 + <TextView
  26 + android:id="@+id/up_record_time"
  27 + android:layout_width="wrap_content"
  28 + android:layout_height="wrap_content"
  29 + android:layout_toRightOf="@id/up_day"
  30 + android:layout_marginLeft="15dp"
  31 + android:textColor="#999999"
  32 + android:textSize="14sp"
  33 + android:text="15:30" />
  34 +
  35 + <TextView
  36 + android:layout_width="wrap_content"
  37 + android:layout_height="wrap_content"
  38 + android:layout_marginRight="10dp"
  39 + android:textColor="#FE4E4E"
  40 + android:textSize="12sp"
  41 + android:text="@string/up_fail"
  42 + android:layout_alignParentRight="true"/>
  43 +
  44 + <LinearLayout
  45 + android:id="@+id/ly"
  46 + android:layout_width="match_parent"
  47 + android:layout_height="100dp"
  48 + android:layout_below="@id/up_day"
  49 + android:orientation="horizontal">
  50 +
  51 + <ImageView
  52 + android:id="@+id/up_item_img"
  53 + android:layout_width="80dp"
  54 + android:layout_height="80dp"
  55 + android:layout_gravity="center_vertical"
  56 + android:src="@drawable/defaults" />
  57 +
  58 + <RelativeLayout
  59 + android:layout_width="match_parent"
  60 + android:layout_height="80dp"
  61 + android:layout_gravity="center_vertical"
  62 + android:layout_marginLeft="15dp">
  63 +
  64 + <TextView
  65 + android:id="@+id/up_item_title"
  66 + android:layout_width="wrap_content"
  67 + android:layout_height="wrap_content"
  68 + android:textSize="12sp"
  69 + android:textColor="#333333"
  70 + android:text="奥森南园跑道" />
  71 +
  72 + <LinearLayout
  73 + android:layout_width="wrap_content"
  74 + android:layout_height="wrap_content"
  75 + android:layout_centerVertical="true"
  76 + android:orientation="horizontal">
  77 + <TextView
  78 + android:id="@+id/up_kilometer_num"
  79 + android:layout_width="wrap_content"
  80 + android:layout_height="wrap_content"
  81 + android:text="1.23"
  82 + android:textColor="#333333"
  83 + android:textSize="30sp"
  84 + android:layout_centerVertical="true"
  85 + />
  86 +
  87 + <TextView
  88 + android:layout_width="wrap_content"
  89 + android:layout_height="wrap_content"
  90 + android:layout_centerVertical="true"
  91 + android:text="@string/kilometer"
  92 + android:textColor="#333333"
  93 + android:textSize="12sp"
  94 + android:layout_marginLeft="5dp"/>
  95 + </LinearLayout>
  96 +
  97 +
  98 + <LinearLayout
  99 + android:layout_width="wrap_content"
  100 + android:layout_height="wrap_content"
  101 + android:layout_alignParentBottom="true">
  102 +
  103 + <TextView
  104 + android:id="@+id/up_record_minit"
  105 + android:layout_width="wrap_content"
  106 + android:layout_height="wrap_content"
  107 + android:drawableRight="@drawable/time_cost"
  108 + android:drawablePadding="5dp"
  109 + android:textColor="#333333"
  110 + android:textSize="13sp"
  111 + android:text="00:27:23" />
  112 +
  113 + <TextView
  114 + android:id="@+id/up_record_speed"
  115 + android:layout_width="wrap_content"
  116 + android:layout_height="wrap_content"
  117 + android:layout_marginLeft="20dp"
  118 + android:drawableRight="@drawable/speed"
  119 + android:drawablePadding="5dp"
  120 + android:textColor="#333333"
  121 + android:textSize="13sp"
  122 + android:text="22'22''" />
  123 +
  124 + <TextView
  125 + android:id="@+id/up_record_step"
  126 + android:layout_width="wrap_content"
  127 + android:layout_height="wrap_content"
  128 + android:layout_marginLeft="20dp"
  129 + android:drawableRight="@drawable/step"
  130 + android:drawablePadding="5dp"
  131 + android:text="1234" />
  132 + </LinearLayout>
  133 + </RelativeLayout>
  134 + </LinearLayout>
  135 +
  136 + <View
  137 + android:id="@+id/view"
  138 + android:layout_width="match_parent"
  139 + android:layout_height="1dp"
  140 + android:background="@color/line"
  141 + android:layout_below="@id/ly"
  142 + />
  143 +
  144 + <TextView
  145 + android:id="@+id/again_up"
  146 + android:layout_width="wrap_content"
  147 + android:layout_height="wrap_content"
  148 + android:layout_alignParentRight="true"
  149 + android:layout_below="@id/view"
  150 + android:layout_marginTop="10dp"
  151 + android:layout_marginRight="10dp"
  152 + android:background="@drawable/green_raduis_bg"
  153 + android:text="@string/again_up"
  154 + android:textColor="#36C28D"
  155 + android:textSize="12sp"
  156 + android:paddingTop="7dp"
  157 + android:paddingBottom="7dp"
  158 + android:paddingRight="10dp"
  159 + android:paddingLeft="10dp"
  160 + />
  161 + </RelativeLayout>
  162 +</layout>
moudle_pedometer/src/main/res/values/strings.xml
@@ -80,6 +80,7 @@ @@ -80,6 +80,7 @@
80 <string name="no_finish">未完成</string> 80 <string name="no_finish">未完成</string>
81 <string name="again_up">重新上传</string> 81 <string name="again_up">重新上传</string>
82 <string name="myrecord">我的记录</string> 82 <string name="myrecord">我的记录</string>
  83 + <string name="up_fail">上传失败</string>
83 84
84 85
85 </resources> 86 </resources>