|
@@ -97,19 +97,22 @@ public class FgtFootprint extends BaseListFragment4<UserFootprint> {
|
|
|
mRecyclerView.setAdapter(adapter);
|
|
mRecyclerView.setAdapter(adapter);
|
|
|
adapter.setOnItemClickListener((adapter, view, position) -> {
|
|
adapter.setOnItemClickListener((adapter, view, position) -> {
|
|
|
UserFootprint item = ListUtil.getItem(list, position);
|
|
UserFootprint item = ListUtil.getItem(list, position);
|
|
|
- if(item != null){
|
|
|
|
|
- switch (item.getType()){
|
|
|
|
|
- default:
|
|
|
|
|
- case UserFootprint.TYPE_APP:
|
|
|
|
|
- Jump2View.getInstance().goPlayGameDetail(activity, item.getRelation_id());
|
|
|
|
|
- break;
|
|
|
|
|
- case UserFootprint.TYPE_ARTICLE:
|
|
|
|
|
- Jump2View.getInstance().goFindItem(activity, item.getRelation_id());
|
|
|
|
|
- break;
|
|
|
|
|
- case UserFootprint.TYPE_TASK:
|
|
|
|
|
- Jump2View.getInstance().goTaskDetailView(activity, item.getRelation_id());
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (item != null) {
|
|
|
|
|
+ if (item.getPlatform() == UserFootprint.PLATFORM_ALL || item.getPlatform() == UserFootprint.PLATFORM_ANDROID)
|
|
|
|
|
+ switch (item.getType()) {
|
|
|
|
|
+ default:
|
|
|
|
|
+ case UserFootprint.TYPE_APP:
|
|
|
|
|
+ Jump2View.getInstance().goPlayGameDetail(activity, item.getRelation_id());
|
|
|
|
|
+ break;
|
|
|
|
|
+ case UserFootprint.TYPE_ARTICLE:
|
|
|
|
|
+ Jump2View.getInstance().goFindItem(activity, item.getRelation_id());
|
|
|
|
|
+ break;
|
|
|
|
|
+ case UserFootprint.TYPE_TASK:
|
|
|
|
|
+ Jump2View.getInstance().goTaskDetailView(activity, item.getRelation_id());
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ G.showToast("请使用苹果手机进行查看");
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -231,36 +234,36 @@ public class FgtFootprint extends BaseListFragment4<UserFootprint> {
|
|
|
String start_date = String.format(Locale.CHINA, "%d-%02d-%02d", year, month, 1);
|
|
String start_date = String.format(Locale.CHINA, "%d-%02d-%02d", year, month, 1);
|
|
|
String end_date = String.format(Locale.CHINA, "%d-%02d-%02d", year, month, TimeUtil.getTotalDay(month));
|
|
String end_date = String.format(Locale.CHINA, "%d-%02d-%02d", year, month, TimeUtil.getTotalDay(month));
|
|
|
SheepApp.getInstance().getNetComponent().getApiService().getUserFootPrintDateCount(start_date, end_date)
|
|
SheepApp.getInstance().getNetComponent().getApiService().getUserFootPrintDateCount(start_date, end_date)
|
|
|
- .subscribeOn(Schedulers.io())
|
|
|
|
|
- .observeOn(AndroidSchedulers.mainThread())
|
|
|
|
|
- .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onNext(BaseMessage baseMessage) {
|
|
|
|
|
- List<FootprintCountRespons> newList = baseMessage.getDataList(FootprintCountRespons.class);
|
|
|
|
|
- if(!ListUtil.isEmpty(newList)){
|
|
|
|
|
- loadFootprintCountList(year, month, newList);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ .subscribeOn(Schedulers.io())
|
|
|
|
|
+ .observeOn(AndroidSchedulers.mainThread())
|
|
|
|
|
+ .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onNext(BaseMessage baseMessage) {
|
|
|
|
|
+ List<FootprintCountRespons> newList = baseMessage.getDataList(FootprintCountRespons.class);
|
|
|
|
|
+ if (!ListUtil.isEmpty(newList)) {
|
|
|
|
|
+ loadFootprintCountList(year, month, newList);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onError(BaseMessage baseMessage) {
|
|
|
|
|
- if(TestUtil.isDev())
|
|
|
|
|
- G.showToast(baseMessage);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onError(BaseMessage baseMessage) {
|
|
|
|
|
+ if (TestUtil.isDev())
|
|
|
|
|
+ G.showToast(baseMessage);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void loadFootprintCountList(final int year, final int month, List<FootprintCountRespons> newList) {
|
|
private void loadFootprintCountList(final int year, final int month, List<FootprintCountRespons> newList) {
|
|
|
final Map<String, Calendar> map = new HashMap<>();
|
|
final Map<String, Calendar> map = new HashMap<>();
|
|
|
ListUtil.forEach(newList, new Action1<FootprintCountRespons>() {
|
|
ListUtil.forEach(newList, new Action1<FootprintCountRespons>() {
|
|
|
- @Override
|
|
|
|
|
- public void call(FootprintCountRespons item) {
|
|
|
|
|
- if(item != null && item.getCount() > 0) {
|
|
|
|
|
- Calendar calendar = getSchemeCalendar(year, month, item.getDay(), String.valueOf(item.getCount()));
|
|
|
|
|
- map.put(calendar.toString(), calendar);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void call(FootprintCountRespons item) {
|
|
|
|
|
+ if (item != null && item.getCount() > 0) {
|
|
|
|
|
+ Calendar calendar = getSchemeCalendar(year, month, item.getDay(), String.valueOf(item.getCount()));
|
|
|
|
|
+ map.put(calendar.toString(), calendar);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
//此方法在巨大的数据量上不影响遍历性能,推荐使用
|
|
//此方法在巨大的数据量上不影响遍历性能,推荐使用
|
|
|
mCalendarView.setSchemeDate(map);
|
|
mCalendarView.setSchemeDate(map);
|
|
|
|
|
|