Commit b97b19f4df67ae95b2368c05ab94b9e0aec1b4b7

Authored by 韩亚云
1 parent f4aa2c68

已参与页面添加

moudle_pedometer/src/main/AndroidManifest.xml
... ... @@ -52,7 +52,8 @@
52 52 android:required="true" />
53 53  
54 54 <application android:persistent="true">
55   - <activity android:name="com.cnlive.moudle.pedometer.ui.activity.RunLineActivity"></activity>
  55 + <activity android:name="com.cnlive.moudle.pedometer.ui.activity.TakePartActivity"></activity>
  56 + <activity android:name="com.cnlive.moudle.pedometer.ui.activity.RunLineActivity" />
56 57 <activity android:name="com.cnlive.moudle.pedometer.ui.activity.MyRecordActivity" />
57 58 <activity android:name="com.cnlive.moudle.pedometer.ui.activity.ShareRecordActivity" />
58 59 <activity android:name="com.cnlive.moudle.pedometer.ui.activity.RaceRecordActivity" />
... ...
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/TakePartPresenter.java 0 → 100644
  1 +package com.cnlive.moudle.pedometer.frame.presenter;
  2 +
  3 +import com.cnlive.moudle.pedometer.frame.view.TakePartView;
  4 +import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter;
  5 +
  6 +/**
  7 + * Created by hanyayun 019/06/03.
  8 + */
  9 +public class TakePartPresenter extends MvpBasePresenter<TakePartView> {
  10 +
  11 +}
... ...
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunRaceDetailFragmentView.java
... ... @@ -45,8 +45,10 @@ import com.cnlive.moudle.pedometer.ui.activity.PedometerMainActivity;
45 45 import com.cnlive.moudle.pedometer.ui.activity.RaceRecordActivity;
46 46 import com.cnlive.moudle.pedometer.ui.activity.RegistrationInfoActivity;
47 47 import com.cnlive.moudle.pedometer.ui.activity.RunningMapActivity;
  48 +import com.cnlive.moudle.pedometer.ui.activity.TakePartActivity;
48 49 import com.cnlive.moudle.pedometer.ui.fragment.RunMainFragment;
49 50 import com.cnlive.moudle.pedometer.ui.fragment.RunRaceDetailFragment;
  51 +import com.cnlive.moudle.pedometer.ui.fragment.TakePartFragment;
50 52 import com.cnlive.moudle.pedometer.utils.BitmapUtil;
51 53 import com.cnlive.moudle.pedometer.utils.ScreenUtil;
52 54 import com.example.moudle_pedometer.R;
... ... @@ -220,6 +222,9 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
220 222 fragment.binding.includePersonScore.findViewById(R.id.check_all_cord).setOnClickListener(v -> {
221 223 RaceRecordActivity.newInstance(fragment.getActivity());
222 224 });
  225 + fragment.binding.includeStreet.fiveJoinPerson.setOnClickListener(v ->{
  226 + TakePartActivity.newInstance(fragment.getActivity());
  227 + });
223 228 }
224 229  
225 230 private void initMap() {
... ...
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/TakePartView.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.TakePartAdapter;
  6 +import com.cnlive.moudle.pedometer.ui.fragment.TakePartFragment;
  7 +import com.example.moudle_pedometer.R;
  8 +import com.hannesdorfmann.mosby3.mvp.MvpView;
  9 +
  10 +import java.util.ArrayList;
  11 +import java.util.List;
  12 +
  13 +/**
  14 + * Created by hanyayun 019/06/03.
  15 + */
  16 +public class TakePartView implements MvpView {
  17 +
  18 + private TakePartFragment fragment;
  19 +
  20 + public TakePartView(TakePartFragment fragment) {
  21 + this.fragment = fragment;
  22 + }
  23 +
  24 + public void initView(){
  25 + fragment.binding.topbar.addLeftImageButton(R.drawable.top_back_black, R.id.fragment_back).setOnClickListener(v -> {
  26 + fragment.getActivity().finish();
  27 + });
  28 + fragment.binding.topbar.setTitle("已参与");
  29 + fragment.binding.takePartRecy.setLayoutManager(new LinearLayoutManager(fragment.getActivity()));
  30 + List<String> list = new ArrayList<>();
  31 + for(int i = 0;i < 6;i++){
  32 + list.add("ss");
  33 + }
  34 + fragment.binding.takePartRecy.setAdapter(new TakePartAdapter(list,fragment.getActivity()));
  35 + }
  36 +}
... ...
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/activity/TakePartActivity.java 0 → 100644
  1 +package com.cnlive.moudle.pedometer.ui.activity;
  2 +
  3 +import android.app.Activity;
  4 +import android.content.Intent;
  5 +import android.support.v7.app.AppCompatActivity;
  6 +import android.os.Bundle;
  7 +
  8 +import com.cnlive.libs.base.util.StatusBarUtil;
  9 +import com.cnlive.libs.base.util.StatusBarUtil2;
  10 +import com.cnlive.moudle.pedometer.ui.fragment.TakePartFragment;
  11 +import com.example.moudle_pedometer.R;
  12 +
  13 +/**
  14 + * 已参与
  15 + * Created by hanyayun 019/06/03.
  16 + */
  17 +public class TakePartActivity extends AppCompatActivity {
  18 +
  19 +
  20 + public static void newInstance(Activity context){
  21 + Intent intent = new Intent(context,TakePartActivity.class);
  22 + context.startActivity(intent);
  23 + }
  24 +
  25 + @Override
  26 + protected void onCreate(Bundle savedInstanceState) {
  27 + super.onCreate(savedInstanceState);
  28 + StatusBarUtil.setStatusBarWrite(this);
  29 + StatusBarUtil2.setColor(this, getResources().getColor(R.color.color_fff), 0);
  30 + setContentView(R.layout.activity_take_part);
  31 + getSupportFragmentManager().beginTransaction().replace(R.id.take_park_container, new TakePartFragment()).commit();
  32 + }
  33 +}
... ...
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/adapter/TakePartAdapter.java 0 → 100644
  1 +package com.cnlive.moudle.pedometer.ui.adapter;
  2 +
  3 +import android.content.Context;
  4 +import android.support.annotation.NonNull;
  5 +import android.support.v7.widget.RecyclerView;
  6 +import android.view.LayoutInflater;
  7 +import android.view.View;
  8 +import android.view.ViewGroup;
  9 +
  10 +import com.example.moudle_pedometer.R;
  11 +
  12 +import java.util.List;
  13 +
  14 +/**
  15 + * Created by hanyayun 019/06/04.
  16 + */
  17 +public class TakePartAdapter extends RecyclerView.Adapter<TakePartAdapter.MyHolder> {
  18 +
  19 + private List<String> list;
  20 + private Context context;
  21 +
  22 + public TakePartAdapter(List<String> list, Context context) {
  23 + this.list = list;
  24 + this.context = context;
  25 + }
  26 +
  27 + @NonNull
  28 + @Override
  29 + public TakePartAdapter.MyHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
  30 + View view = LayoutInflater.from(context).inflate(R.layout.item_tabke_part,viewGroup,false);
  31 + return new MyHolder(view);
  32 + }
  33 +
  34 + @Override
  35 + public void onBindViewHolder(@NonNull TakePartAdapter.MyHolder myViewHolder, int i) {
  36 +
  37 + }
  38 +
  39 + @Override
  40 + public int getItemCount() {
  41 + return list.size();
  42 + }
  43 +
  44 + class MyHolder extends RecyclerView.ViewHolder{
  45 +
  46 + public MyHolder(@NonNull View itemView) {
  47 + super(itemView);
  48 + }
  49 + }
  50 +}
... ...
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/TakePartFragment.java 0 → 100644
  1 +package com.cnlive.moudle.pedometer.ui.fragment;
  2 +
  3 +
  4 +import android.os.Bundle;
  5 +import android.support.annotation.Nullable;
  6 +import android.support.v4.app.Fragment;
  7 +import android.view.LayoutInflater;
  8 +import android.view.View;
  9 +import android.view.ViewGroup;
  10 +
  11 +import com.cnlive.libs.base.frame.fragment.MvpBindingFragment;
  12 +import com.cnlive.moudle.pedometer.frame.presenter.TakePartPresenter;
  13 +import com.cnlive.moudle.pedometer.frame.view.TakePartView;
  14 +import com.example.moudle_pedometer.R;
  15 +import com.example.moudle_pedometer.databinding.FragmentTakePartBinding;
  16 +
  17 +/**
  18 + * Created by hanyayun 019/06/03.
  19 + */
  20 +public class TakePartFragment extends MvpBindingFragment<TakePartView, TakePartPresenter,Object, FragmentTakePartBinding> {
  21 +
  22 +
  23 + public TakePartFragment() {
  24 + // Required empty public constructor
  25 + }
  26 +
  27 + @Override
  28 + protected int getLayoutId() {
  29 + return R.layout.fragment_take_part;
  30 + }
  31 +
  32 + @Override
  33 + public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
  34 + super.onViewCreated(view, savedInstanceState);
  35 + if(getMvpView() != null)getMvpView().initView();
  36 + }
  37 +}
... ...
moudle_pedometer/src/main/res/layout/activity_take_part.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="match_parent"
  7 + tools:context="com.cnlive.moudle.pedometer.ui.activity.TakePartActivity">
  8 +
  9 + <RelativeLayout
  10 + android:id="@+id/take_park_container"
  11 + android:layout_width="match_parent"
  12 + android:layout_height="match_parent"/>
  13 +</RelativeLayout>
... ...
moudle_pedometer/src/main/res/layout/fragment_run_line.xml
... ... @@ -14,6 +14,12 @@
14 14 android:id="@+id/run_line_recy"
15 15 android:layout_width="match_parent"
16 16 android:layout_height="match_parent" />
  17 +
  18 + <com.cnlive.strike.ui.widget.UIEmptyView
  19 + android:id="@+id/empty"
  20 + android:layout_width="match_parent"
  21 + android:layout_height="match_parent"
  22 + android:visibility="gone" />
17 23 </LinearLayout>
18 24  
19 25 </layout>
... ...
moudle_pedometer/src/main/res/layout/fragment_take_part.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:background="@color/white"
  7 + android:orientation="vertical">
  8 +
  9 + <com.qmuiteam.qmui.widget.QMUITopBar
  10 + android:id="@+id/topbar"
  11 + android:layout_width="match_parent"
  12 + android:layout_height="?attr/actionBarSize"/>
  13 +
  14 + <android.support.v7.widget.RecyclerView
  15 + android:id="@+id/take_part_recy"
  16 + android:layout_width="match_parent"
  17 + android:layout_height="match_parent"/>
  18 +
  19 + <com.cnlive.strike.ui.widget.UIEmptyView
  20 + android:id="@+id/empty"
  21 + android:layout_width="match_parent"
  22 + android:layout_height="match_parent"
  23 + android:visibility="gone" />
  24 + </LinearLayout>
  25 +
  26 +</layout>
  27 +
... ...
moudle_pedometer/src/main/res/layout/item_tabke_part.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<RelativeLayout
  3 + xmlns:android="http://schemas.android.com/apk/res/android"
  4 + android:layout_width="match_parent"
  5 + android:layout_height="wrap_content"
  6 + android:background="@color/white">
  7 +
  8 + <ImageView
  9 + android:id="@+id/icon_img"
  10 + android:layout_width="50dp"
  11 + android:layout_height="50dp"
  12 + android:layout_margin="15dp"
  13 + android:src="@drawable/ic_icon"
  14 + />
  15 +
  16 + <TextView
  17 + android:layout_width="wrap_content"
  18 + android:layout_height="wrap_content"
  19 + android:text="用户"
  20 + android:layout_toRightOf="@id/icon_img"
  21 + android:layout_centerVertical="true"
  22 + />
  23 +
  24 + <View
  25 + android:layout_width="match_parent"
  26 + android:layout_height="1dp"
  27 + android:layout_alignParentBottom="true"
  28 + android:background="@color/line"
  29 + />
  30 +</RelativeLayout>
0 31 \ No newline at end of file
... ...