Commit f23ed0f64100f2bc26c75c29ebede3bc56a64018

Authored by 韩亚云
1 parent 9414c796

轨迹列表绑定通知赛事列表页面刷新数据

config.gradle
... ... @@ -21,7 +21,7 @@ ext {
21 21 //编译方式
22 22 debug : false,
23 23 //版本号
24   - version: "0.3.4",
  24 + version: "0.3.5",
25 25 //Lib库前缀
26 26 packeg : "com.cnlive.module",
27 27 //Lib库名称
... ...
moudle_pedometer/src/main/AndroidManifest.xml
... ... @@ -52,16 +52,36 @@
52 52 android:required="true" />
53 53  
54 54 <application android:persistent="true">
55   - <activity android:name="com.cnlive.moudle.collectionTrace.ui.activity.RaceNameListActivity"></activity>
56   - <activity android:name="com.cnlive.moudle.collectionTrace.ui.activity.RaceListActivity" />
57   - <activity android:name="com.cnlive.moudle.pedometer.ui.activity.LineUpAgainActivity" />
58   - <activity android:name="com.cnlive.moudle.pedometer.ui.activity.SelfRecordActivity" />
59   - <activity android:name="com.cnlive.moudle.pedometer.ui.activity.TakePartActivity" />
60   - <activity android:name="com.cnlive.moudle.pedometer.ui.activity.RunLineActivity" />
61   - <activity android:name="com.cnlive.moudle.pedometer.ui.activity.MyRecordActivity" />
62   - <activity android:name="com.cnlive.moudle.pedometer.ui.activity.ShareRecordActivity" />
63   - <activity android:name="com.cnlive.moudle.pedometer.ui.activity.RaceRecordActivity" />
64   - <activity android:name="com.cnlive.moudle.pedometer.ui.activity.RegistrationInfoActivity" />
  55 + <activity android:name="com.cnlive.moudle.collectionTrace.ui.activity.RaceNameListActivity"
  56 + android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
  57 + android:screenOrientation="portrait"/>
  58 + <activity android:name="com.cnlive.moudle.collectionTrace.ui.activity.RaceListActivity"
  59 + android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
  60 + android:screenOrientation="portrait"/>
  61 + <activity android:name="com.cnlive.moudle.pedometer.ui.activity.LineUpAgainActivity"
  62 + android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
  63 + android:screenOrientation="portrait"/>
  64 + <activity android:name="com.cnlive.moudle.pedometer.ui.activity.SelfRecordActivity"
  65 + android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
  66 + android:screenOrientation="portrait"/>
  67 + <activity android:name="com.cnlive.moudle.pedometer.ui.activity.TakePartActivity"
  68 + android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
  69 + android:screenOrientation="portrait"/>
  70 + <activity android:name="com.cnlive.moudle.pedometer.ui.activity.RunLineActivity"
  71 + android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
  72 + android:screenOrientation="portrait"/>
  73 + <activity android:name="com.cnlive.moudle.pedometer.ui.activity.MyRecordActivity"
  74 + android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
  75 + android:screenOrientation="portrait"/>
  76 + <activity android:name="com.cnlive.moudle.pedometer.ui.activity.ShareRecordActivity"
  77 + android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
  78 + android:screenOrientation="portrait"/>
  79 + <activity android:name="com.cnlive.moudle.pedometer.ui.activity.RaceRecordActivity"
  80 + android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
  81 + android:screenOrientation="portrait"/>
  82 + <activity android:name="com.cnlive.moudle.pedometer.ui.activity.RegistrationInfoActivity"
  83 + android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
  84 + android:screenOrientation="portrait"/>
65 85  
66 86 <service
67 87 android:name="com.cnlive.moudle.pedometer.service.StepService"
... ...
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/ui/fragment/RaceListFragment.java
... ... @@ -9,9 +9,15 @@ import com.cnlive.libs.base.frame.fragment.MvpBindingFragment;
9 9 import com.cnlive.moudle.collectionTrace.frame.presenter.RaceListPresenter;
10 10 import com.cnlive.moudle.collectionTrace.frame.view.RaceListView;
11 11 import com.cnlive.moudle.pedometer.commonInfo.CommonInfo;
  12 +import com.cnlive.moudle.pedometer.model.Constant;
  13 +import com.cnlive.moudle.pedometer.model.MessageEvent;
12 14 import com.example.moudle_pedometer.R;
13 15 import com.example.moudle_pedometer.databinding.FragmentRaceListBinding;
14 16  
  17 +import org.greenrobot.eventbus.EventBus;
  18 +import org.greenrobot.eventbus.Subscribe;
  19 +import org.greenrobot.eventbus.ThreadMode;
  20 +
15 21 /**
16 22 * Created by hanyayun 019/06/24.
17 23 */
... ... @@ -28,6 +34,9 @@ public class RaceListFragment extends MvpBindingFragment&lt;RaceListView, RaceListP
28 34 @Override
29 35 public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
30 36 super.onViewCreated(view, savedInstanceState);
  37 + if (!EventBus.getDefault().isRegistered(this)) {
  38 + EventBus.getDefault().register(this);
  39 + }
31 40 if(getMvpView() != null)getMvpView().initView();
32 41 getPresenter().setData(getActivity(), CommonInfo.getUserId(getActivity()),currentPage,pageSize);
33 42 binding.refreshLayout.setOnRefreshListener(v ->{
... ... @@ -41,8 +50,25 @@ public class RaceListFragment extends MvpBindingFragment&lt;RaceListView, RaceListP
41 50 }
42 51  
43 52 @Override
  53 + public void onDestroy() {
  54 + super.onDestroy();
  55 + if (EventBus.getDefault().isRegistered(this)) {
  56 + EventBus.getDefault().unregister(this);
  57 + }
  58 + }
  59 +
  60 + @Override
44 61 protected int getLayoutId() {
45 62 return R.layout.fragment_race_list;
46 63 }
47 64  
  65 + @Subscribe(threadMode = ThreadMode.MAIN)
  66 + public void Event(MessageEvent messageEvent) {
  67 + if (messageEvent.getMessageType() == Constant.UPDATA_COLL_BIND_TRACE_LIST) {
  68 + if (getMvpView() != null) {
  69 + currentPage = 1;
  70 + getPresenter().setData(getActivity(), CommonInfo.getUserId(getActivity()),currentPage,pageSize);
  71 + }
  72 + }
  73 + }
48 74 }
... ...