Commit 4e66d4a11f3543d37ee319a2cc923900a4c436be
1 parent
b144777e
我的活动item跳转
Showing
4 changed files
with
16 additions
and
5 deletions
config.gradle
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/MyRecordView.java
| 1 | package com.cnlive.moudle.pedometer.frame.view; | 1 | package com.cnlive.moudle.pedometer.frame.view; |
| 2 | 2 | ||
| 3 | +import android.content.Intent; | ||
| 3 | import android.support.v7.widget.LinearLayoutManager; | 4 | import android.support.v7.widget.LinearLayoutManager; |
| 4 | import android.view.View; | 5 | import android.view.View; |
| 5 | 6 | ||
| 7 | +import com.cnlive.moudle.pedometer.ui.activity.RunRaceDetailActivity; | ||
| 6 | import com.cnlive.moudle.pedometer.ui.adapter.MyRecordAdapter; | 8 | import com.cnlive.moudle.pedometer.ui.adapter.MyRecordAdapter; |
| 7 | import com.cnlive.moudle.pedometer.ui.fragment.MyRecordFragment; | 9 | import com.cnlive.moudle.pedometer.ui.fragment.MyRecordFragment; |
| 8 | import com.hannesdorfmann.mosby3.mvp.MvpView; | 10 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| @@ -28,7 +30,15 @@ public class MyRecordView implements MvpView { | @@ -28,7 +30,15 @@ public class MyRecordView implements MvpView { | ||
| 28 | list.add("fff"); | 30 | list.add("fff"); |
| 29 | list.add("fff"); | 31 | list.add("fff"); |
| 30 | list.add("fff"); | 32 | list.add("fff"); |
| 31 | - fragment.binding.myRecordRecy.setAdapter(new MyRecordAdapter(list,fragment.getActivity(),true)); | 33 | + MyRecordAdapter myRecordAdapter = new MyRecordAdapter(list,fragment.getActivity(),true); |
| 34 | + fragment.binding.myRecordRecy.setAdapter(myRecordAdapter); | ||
| 35 | + myRecordAdapter.setClickListener(new MyRecordAdapter.OnClickListener() { | ||
| 36 | + @Override | ||
| 37 | + public void onClickListener(String msg, int position) { | ||
| 38 | + Intent intent = new Intent(fragment.getActivity(), RunRaceDetailActivity.class); | ||
| 39 | + fragment.getActivity().startActivity(intent); | ||
| 40 | + } | ||
| 41 | + }); | ||
| 32 | } | 42 | } |
| 33 | 43 | ||
| 34 | public void initView(){ | 44 | public void initView(){ |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RunLineFragment.java
| @@ -44,7 +44,7 @@ public class RunLineFragment extends Fragment { | @@ -44,7 +44,7 @@ public class RunLineFragment extends Fragment { | ||
| 44 | @Override | 44 | @Override |
| 45 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | 45 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { |
| 46 | super.onViewCreated(view, savedInstanceState); | 46 | super.onViewCreated(view, savedInstanceState); |
| 47 | - binding.topbar.setTitle("我的活动"); | 47 | + binding.topbar.setTitle("约跑路线"); |
| 48 | binding.topbar.addLeftImageButton(R.drawable.top_back_black, R.id.fragment_back).setOnClickListener(v -> { | 48 | binding.topbar.addLeftImageButton(R.drawable.top_back_black, R.id.fragment_back).setOnClickListener(v -> { |
| 49 | getActivity().finish(); | 49 | getActivity().finish(); |
| 50 | }); | 50 | }); |
moudle_pedometer/src/main/res/layout/activity_my_record.xml
| @@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
| 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 | android:orientation="vertical" | 7 | android:orientation="vertical" |
| 8 | + android:background="@color/white" | ||
| 8 | tools:context="com.cnlive.moudle.pedometer.ui.activity.MyRecordActivity"> | 9 | tools:context="com.cnlive.moudle.pedometer.ui.activity.MyRecordActivity"> |
| 9 | 10 | ||
| 10 | <com.qmuiteam.qmui.widget.QMUITopBar | 11 | <com.qmuiteam.qmui.widget.QMUITopBar |
| @@ -18,7 +19,6 @@ | @@ -18,7 +19,6 @@ | ||
| 18 | android:layout_height="wrap_content" | 19 | android:layout_height="wrap_content" |
| 19 | app:tabIndicatorColor="#23D41E" | 20 | app:tabIndicatorColor="#23D41E" |
| 20 | app:tabIndicatorHeight="2dp" | 21 | app:tabIndicatorHeight="2dp" |
| 21 | - android:background="@color/white" | ||
| 22 | android:layout_gravity="center_horizontal" | 22 | android:layout_gravity="center_horizontal" |
| 23 | app:tabMode="scrollable" | 23 | app:tabMode="scrollable" |
| 24 | app:tabSelectedTextColor="#23D41E" | 24 | app:tabSelectedTextColor="#23D41E" |
| @@ -27,7 +27,8 @@ | @@ -27,7 +27,8 @@ | ||
| 27 | <android.support.v4.view.ViewPager | 27 | <android.support.v4.view.ViewPager |
| 28 | android:id="@+id/viewpager" | 28 | android:id="@+id/viewpager" |
| 29 | android:layout_width="match_parent" | 29 | android:layout_width="match_parent" |
| 30 | - android:layout_height="match_parent" /> | 30 | + android:layout_height="match_parent" |
| 31 | + android:background="#F7F4F4"/> | ||
| 31 | 32 | ||
| 32 | 33 | ||
| 33 | </LinearLayout> | 34 | </LinearLayout> |