|
@@ -257,8 +257,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.RUN_TASK, allTaskAcceptedTaskList));
|
|
tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.RUN_TASK, allTaskAcceptedTaskList));
|
|
|
}
|
|
}
|
|
|
//正在进行中的任务下面的线是否显示
|
|
//正在进行中的任务下面的线是否显示
|
|
|
- if (recyclerview_line != null)
|
|
|
|
|
- recyclerview_line.setVisibility(isAcceptedTaskListEmpty ? View.GONE : View.VISIBLE);
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(recyclerview_line, !isAcceptedTaskListEmpty);
|
|
|
|
|
|
|
|
//发布的任务列表----注:3.0开始已经没有展示,使用viewpager展示
|
|
//发布的任务列表----注:3.0开始已经没有展示,使用viewpager展示
|
|
|
if (!ListUtil.isEmpty(releaseEtyLists)) {
|
|
if (!ListUtil.isEmpty(releaseEtyLists)) {
|
|
@@ -555,7 +554,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
// ((ViewGroup) activity.getWindow().getDecorView()).addView(titleCardLayout);
|
|
// ((ViewGroup) activity.getWindow().getDecorView()).addView(titleCardLayout);
|
|
|
- titleCardLayout.setVisibility(View.GONE);
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(titleCardLayout, false);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -754,9 +753,9 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
public void onScrollChange(NestedScrollView nestedScrollView, int x, int y, int oldX, int oldY) {
|
|
public void onScrollChange(NestedScrollView nestedScrollView, int x, int y, int oldX, int oldY) {
|
|
|
listTitle.getLocationInWindow(locate);
|
|
listTitle.getLocationInWindow(locate);
|
|
|
if (locate[1] < 0 && titleCardLayout.getVisibility() == View.GONE) {
|
|
if (locate[1] < 0 && titleCardLayout.getVisibility() == View.GONE) {
|
|
|
- titleCardLayout.setVisibility(View.VISIBLE);
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(titleCardLayout, true);
|
|
|
} else if (locate[1] > 20 && titleCardLayout.getVisibility() == View.VISIBLE) {
|
|
} else if (locate[1] > 20 && titleCardLayout.getVisibility() == View.VISIBLE) {
|
|
|
- titleCardLayout.setVisibility(View.GONE);
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(titleCardLayout, false);
|
|
|
}
|
|
}
|
|
|
//设置搜索框颜色变化
|
|
//设置搜索框颜色变化
|
|
|
// float ratio = Math.min(bannerHeight, y) * 1.0f / bannerHeight;
|
|
// float ratio = Math.min(bannerHeight, y) * 1.0f / bannerHeight;
|
|
@@ -863,7 +862,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
//公告
|
|
//公告
|
|
|
List<BulletinEnty> cacheBulletinEtyList = DataUtil.getInstance().getCacheList(ApiKey.bulletin, BulletinEnty.class);
|
|
List<BulletinEnty> cacheBulletinEtyList = DataUtil.getInstance().getCacheList(ApiKey.bulletin, BulletinEnty.class);
|
|
|
if (ListUtil.isEmpty(cacheBulletinEtyList)) {
|
|
if (ListUtil.isEmpty(cacheBulletinEtyList)) {
|
|
|
- homepageItemNoticeLayout.setVisibility(View.GONE);
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(homepageItemNoticeLayout, false);
|
|
|
} else {
|
|
} else {
|
|
|
bulletinEntyLists.clear();
|
|
bulletinEntyLists.clear();
|
|
|
bulletinEntyLists.addAll(cacheBulletinEtyList);
|
|
bulletinEntyLists.addAll(cacheBulletinEtyList);
|
|
@@ -872,7 +871,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
//轮播
|
|
//轮播
|
|
|
List<SlideshowEty> cacheSlideshowEtyList = DataUtil.getInstance().getCacheList(ApiKey.slideshow, SlideshowEty.class);
|
|
List<SlideshowEty> cacheSlideshowEtyList = DataUtil.getInstance().getCacheList(ApiKey.slideshow, SlideshowEty.class);
|
|
|
if (ListUtil.isEmpty(cacheSlideshowEtyList)) {
|
|
if (ListUtil.isEmpty(cacheSlideshowEtyList)) {
|
|
|
- banner.setVisibility(View.GONE);
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(banner, false);
|
|
|
} else {
|
|
} else {
|
|
|
for (SlideshowEty slideshowEty : cacheSlideshowEtyList) {
|
|
for (SlideshowEty slideshowEty : cacheSlideshowEtyList) {
|
|
|
slideshowEtyLists.add(slideshowEty);
|
|
slideshowEtyLists.add(slideshowEty);
|
|
@@ -883,13 +882,13 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
//首页list
|
|
//首页list
|
|
|
List<HomeListEntity> cacheHomeListEtyList = DataUtil.getInstance().getCacheList(ApiKey.home_list, HomeListEntity.class);
|
|
List<HomeListEntity> cacheHomeListEtyList = DataUtil.getInstance().getCacheList(ApiKey.home_list, HomeListEntity.class);
|
|
|
if (ListUtil.isEmpty(cacheHomeListEtyList)) {
|
|
if (ListUtil.isEmpty(cacheHomeListEtyList)) {
|
|
|
- home_list_gridview_layout.setVisibility(View.GONE);
|
|
|
|
|
- full_home_list_rv.setVisibility(View.GONE);
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(home_list_gridview_layout, false);
|
|
|
|
|
+ ViewUtil.setVisibility(full_home_list_rv, false);
|
|
|
} else {
|
|
} else {
|
|
|
- home_list_gridview_layout.setVisibility(View.VISIBLE);
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(home_list_gridview_layout, true);
|
|
|
fullHomeList.clear();
|
|
fullHomeList.clear();
|
|
|
CommonUtil.getInstance().splitHomeList(cacheHomeListEtyList, homeListEntitys, fullHomeList);
|
|
CommonUtil.getInstance().splitHomeList(cacheHomeListEtyList, homeListEntitys, fullHomeList);
|
|
|
- full_home_list_rv.setVisibility(fullHomeList.isEmpty() ? View.GONE : View.VISIBLE);
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(full_home_list_rv, !fullHomeList.isEmpty());
|
|
|
boolean isShowQB = false;
|
|
boolean isShowQB = false;
|
|
|
boolean isShowMd = false;
|
|
boolean isShowMd = false;
|
|
|
for (int i = 0; i < homeListEntitys.size(); i++) {
|
|
for (int i = 0; i < homeListEntitys.size(); i++) {
|
|
@@ -909,10 +908,10 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
addNewTask();
|
|
addNewTask();
|
|
|
SheepApp.getInstance().setShowQB(isShowQB);
|
|
SheepApp.getInstance().setShowQB(isShowQB);
|
|
|
SheepApp.getInstance().setShowMidong(isShowMd);
|
|
SheepApp.getInstance().setShowMidong(isShowMd);
|
|
|
- full_home_list_rv.getAdapter().notifyDataSetChanged();
|
|
|
|
|
|
|
+ ViewUtil.notifyDataSetChanged(full_home_list_rv);
|
|
|
adpHomeListGrideview.notifyDataSetChanged();
|
|
adpHomeListGrideview.notifyDataSetChanged();
|
|
|
adpHomeListListview.notifyDataSetChanged();
|
|
adpHomeListListview.notifyDataSetChanged();
|
|
|
- home_list_gridview_listview.setVisibility(homeListEntitysListview.isEmpty() ? View.GONE : View.VISIBLE);
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(home_list_gridview_listview, !homeListEntitysListview.isEmpty());
|
|
|
}
|
|
}
|
|
|
refreshData();
|
|
refreshData();
|
|
|
}
|
|
}
|
|
@@ -925,11 +924,9 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
@Override
|
|
@Override
|
|
|
public void onNext(Integer result) {
|
|
public void onNext(Integer result) {
|
|
|
if (result != 0) {//无网络
|
|
if (result != 0) {//无网络
|
|
|
- if (check_net_ll != null)
|
|
|
|
|
- check_net_ll.setVisibility(View.VISIBLE);
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(check_net_ll, true);
|
|
|
} else {
|
|
} else {
|
|
|
- if (check_net_ll != null)
|
|
|
|
|
- check_net_ll.setVisibility(View.GONE);
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(check_net_ll, false);
|
|
|
}
|
|
}
|
|
|
notifyDataSetChanged();
|
|
notifyDataSetChanged();
|
|
|
}
|
|
}
|
|
@@ -1107,7 +1104,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void failData2View(Object o) {
|
|
public void failData2View(Object o) {
|
|
|
- G.showToast("网络错误");
|
|
|
|
|
|
|
+// G.showToast("网络错误");
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1161,12 +1158,12 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
// G.showToast(" 未查询到正在运行的任务!");
|
|
// G.showToast(" 未查询到正在运行的任务!");
|
|
|
break;
|
|
break;
|
|
|
default:
|
|
default:
|
|
|
- G.showToast(" 网络错误!");
|
|
|
|
|
|
|
+// G.showToast(" 网络错误!");
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
- G.showToast(" 网络错误!");
|
|
|
|
|
|
|
+// G.showToast(" 网络错误!");
|
|
|
}
|
|
}
|
|
|
allTaskAcceptedTaskList.clear();
|
|
allTaskAcceptedTaskList.clear();
|
|
|
mHandler.sendEmptyMessage(WHAT_LOAD_RUN_TASK);
|
|
mHandler.sendEmptyMessage(WHAT_LOAD_RUN_TASK);
|
|
@@ -1216,7 +1213,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
if (isNewData) {
|
|
if (isNewData) {
|
|
|
List<SlideshowEty> slideshowEtyList = baseMessage.getDataList(SlideshowEty.class);
|
|
List<SlideshowEty> slideshowEtyList = baseMessage.getDataList(SlideshowEty.class);
|
|
|
if (ListUtil.isEmpty(slideshowEtyList)) {
|
|
if (ListUtil.isEmpty(slideshowEtyList)) {
|
|
|
- banner.setVisibility(View.GONE);
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(banner, false);
|
|
|
} else {
|
|
} else {
|
|
|
slideshowEtyLists.clear();
|
|
slideshowEtyLists.clear();
|
|
|
slideshowTitleList.clear();
|
|
slideshowTitleList.clear();
|
|
@@ -1240,7 +1237,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
if (isNewData) {
|
|
if (isNewData) {
|
|
|
List<BulletinEnty> bulletinEntyList = JSONArray.parseArray(JSONArray.toJSONString(baseMessage.getData()), BulletinEnty.class);
|
|
List<BulletinEnty> bulletinEntyList = JSONArray.parseArray(JSONArray.toJSONString(baseMessage.getData()), BulletinEnty.class);
|
|
|
if (ListUtil.isEmpty(bulletinEntyList)) {
|
|
if (ListUtil.isEmpty(bulletinEntyList)) {
|
|
|
- homepageItemNoticeLayout.setVisibility(View.GONE);
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(homepageItemNoticeLayout, false);
|
|
|
} else {
|
|
} else {
|
|
|
bulletinEntyLists.clear();
|
|
bulletinEntyLists.clear();
|
|
|
bulletinEntyLists.addAll(bulletinEntyList);
|
|
bulletinEntyLists.addAll(bulletinEntyList);
|
|
@@ -1255,16 +1252,16 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
if (isNewData) {
|
|
if (isNewData) {
|
|
|
List<HomeListEntity> homeListEntityList = baseMessage.getDataList(HomeListEntity.class);
|
|
List<HomeListEntity> homeListEntityList = baseMessage.getDataList(HomeListEntity.class);
|
|
|
if (ListUtil.isEmpty(homeListEntityList)) {
|
|
if (ListUtil.isEmpty(homeListEntityList)) {
|
|
|
- home_list_gridview_layout.setVisibility(View.GONE);
|
|
|
|
|
- full_home_list_rv.setVisibility(View.GONE);
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(home_list_gridview_layout, false);
|
|
|
|
|
+ ViewUtil.setVisibility(full_home_list_rv, false);
|
|
|
} else {
|
|
} else {
|
|
|
- home_list_gridview_layout.setVisibility(View.VISIBLE);
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(home_list_gridview_layout, true);
|
|
|
homeListEntitys.clear();
|
|
homeListEntitys.clear();
|
|
|
homeListEntitysGridview.clear();
|
|
homeListEntitysGridview.clear();
|
|
|
homeListEntitysListview.clear();
|
|
homeListEntitysListview.clear();
|
|
|
fullHomeList.clear();
|
|
fullHomeList.clear();
|
|
|
CommonUtil.getInstance().splitHomeList(homeListEntityList, homeListEntitys, fullHomeList);
|
|
CommonUtil.getInstance().splitHomeList(homeListEntityList, homeListEntitys, fullHomeList);
|
|
|
- full_home_list_rv.setVisibility(fullHomeList.isEmpty() ? View.GONE : View.VISIBLE);
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(full_home_list_rv, !fullHomeList.isEmpty());
|
|
|
boolean isShowQB = false;
|
|
boolean isShowQB = false;
|
|
|
boolean isShowMd = false;
|
|
boolean isShowMd = false;
|
|
|
for (int i = 0; i < homeListEntitys.size(); i++) {
|
|
for (int i = 0; i < homeListEntitys.size(); i++) {
|
|
@@ -1287,7 +1284,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
ViewUtil.notifyDataSetChanged(full_home_list_rv);
|
|
ViewUtil.notifyDataSetChanged(full_home_list_rv);
|
|
|
adpHomeListGrideview.notifyDataSetChanged();
|
|
adpHomeListGrideview.notifyDataSetChanged();
|
|
|
adpHomeListListview.notifyDataSetChanged();
|
|
adpHomeListListview.notifyDataSetChanged();
|
|
|
- home_list_gridview_listview.setVisibility(homeListEntitysListview.isEmpty() ? View.GONE : View.VISIBLE);
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(home_list_gridview_listview, !homeListEntitysListview.isEmpty());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1295,7 +1292,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
@Override
|
|
@Override
|
|
|
public void failhomeList(BaseMessage baseMessage) {
|
|
public void failhomeList(BaseMessage baseMessage) {
|
|
|
if (homeListEntitys.isEmpty() && fullHomeList.isEmpty())
|
|
if (homeListEntitys.isEmpty() && fullHomeList.isEmpty())
|
|
|
- home_list_gridview_layout.setVisibility(View.GONE);
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(home_list_gridview_layout, false);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1327,9 +1324,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void onPause() {
|
|
public void onPause() {
|
|
|
- if (titleCardLayout != null) {
|
|
|
|
|
- titleCardLayout.setVisibility(View.GONE);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(titleCardLayout, false);
|
|
|
super.onPause();
|
|
super.onPause();
|
|
|
if (upview1 != null) {
|
|
if (upview1 != null) {
|
|
|
//停止滚动
|
|
//停止滚动
|
|
@@ -1398,12 +1393,16 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void onStop() {
|
|
public void onStop() {
|
|
|
- super.onStop();
|
|
|
|
|
//结束轮播
|
|
//结束轮播
|
|
|
- banner.stopAutoPlay();
|
|
|
|
|
|
|
+ if(banner != null)
|
|
|
|
|
+ banner.stopAutoPlay();
|
|
|
|
|
+ super.onStop();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void bindBanner() {
|
|
private void bindBanner() {
|
|
|
|
|
+ if(banner == null){
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
//结束轮播
|
|
//结束轮播
|
|
|
banner.stopAutoPlay();
|
|
banner.stopAutoPlay();
|
|
|
banner.setVisibility(View.VISIBLE);
|
|
banner.setVisibility(View.VISIBLE);
|
|
@@ -1460,7 +1459,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
* 公共
|
|
* 公共
|
|
|
*/
|
|
*/
|
|
|
private void inviteNotice(final List<BulletinEnty> bulletinEntyList) {
|
|
private void inviteNotice(final List<BulletinEnty> bulletinEntyList) {
|
|
|
- homepageItemNoticeLayout.setVisibility(View.GONE);
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(homepageItemNoticeLayout, false);
|
|
|
homepageItemNoticeMv.removeAllViews();
|
|
homepageItemNoticeMv.removeAllViews();
|
|
|
for (final BulletinEnty entity : bulletinEntyList) {
|
|
for (final BulletinEnty entity : bulletinEntyList) {
|
|
|
StringBuilder sb = new StringBuilder();
|
|
StringBuilder sb = new StringBuilder();
|