|
|
@@ -8,7 +8,6 @@ import android.content.ClipboardManager;
|
|
|
import android.content.Context;
|
|
|
import android.content.DialogInterface;
|
|
|
import android.content.Intent;
|
|
|
-import android.graphics.Color;
|
|
|
import android.graphics.drawable.BitmapDrawable;
|
|
|
import android.os.Build;
|
|
|
import android.os.Handler;
|
|
|
@@ -20,6 +19,7 @@ import android.support.v4.app.NotificationManagerCompat;
|
|
|
import android.support.v4.view.ViewPager;
|
|
|
import android.support.v4.widget.NestedScrollView;
|
|
|
import android.support.v7.app.AlertDialog;
|
|
|
+import android.support.v7.widget.GridLayoutManager;
|
|
|
import android.support.v7.widget.LinearLayoutManager;
|
|
|
import android.support.v7.widget.RecyclerView;
|
|
|
import android.text.TextUtils;
|
|
|
@@ -34,7 +34,6 @@ import android.view.WindowManager;
|
|
|
import android.view.animation.Animation;
|
|
|
import android.view.animation.OvershootInterpolator;
|
|
|
import android.view.animation.TranslateAnimation;
|
|
|
-import android.widget.AdapterView;
|
|
|
import android.widget.EditText;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.LinearLayout;
|
|
|
@@ -45,6 +44,7 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.bumptech.glide.Glide;
|
|
|
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
|
|
import com.bumptech.glide.request.RequestOptions;
|
|
|
+import com.chad.library.adapter.base.BaseQuickAdapter;
|
|
|
import com.kfzs.duanduan.utils.NumberFormatUtils;
|
|
|
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
|
|
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
|
|
@@ -65,11 +65,11 @@ import com.sheep.gamegroup.model.entity.RecyleObj;
|
|
|
import com.sheep.gamegroup.model.entity.RecyleType;
|
|
|
import com.sheep.gamegroup.model.entity.Release_task;
|
|
|
import com.sheep.gamegroup.model.entity.RequestParamEty;
|
|
|
-import com.sheep.gamegroup.model.entity.RobTask;
|
|
|
import com.sheep.gamegroup.model.entity.SlideshowEty;
|
|
|
import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
|
|
|
import com.sheep.gamegroup.model.entity.UserEntity;
|
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
+import com.sheep.gamegroup.module.home.adapter.AdpHomeList;
|
|
|
import com.sheep.gamegroup.module.plugin.model.Plugin;
|
|
|
import com.sheep.gamegroup.module.skin.util.SkinUtil;
|
|
|
import com.sheep.gamegroup.presenter.SmallSheepContract;
|
|
|
@@ -77,14 +77,11 @@ import com.sheep.gamegroup.presenter.SmallSheepPresenter;
|
|
|
import com.sheep.gamegroup.presenter.TryMakeMoneyContract;
|
|
|
import com.sheep.gamegroup.presenter.TryMakeMoneyPresenter;
|
|
|
import com.sheep.gamegroup.util.CommonUtil;
|
|
|
-import com.sheep.gamegroup.util.ConfigUtil;
|
|
|
import com.sheep.gamegroup.util.DataKey;
|
|
|
import com.sheep.gamegroup.util.DataUtil;
|
|
|
import com.sheep.gamegroup.util.GlideImageLoader;
|
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
|
import com.sheep.gamegroup.util.ListUtil;
|
|
|
-import com.sheep.gamegroup.util.MyGridview;
|
|
|
-import com.sheep.gamegroup.util.MyListview;
|
|
|
import com.sheep.gamegroup.util.RefreshUtil;
|
|
|
import com.sheep.gamegroup.util.SysAppUtil;
|
|
|
import com.sheep.gamegroup.util.TestUtil;
|
|
|
@@ -96,11 +93,8 @@ import com.sheep.gamegroup.util.viewHelper.LayoutParamsUtil;
|
|
|
import com.sheep.gamegroup.view.activity.ActMsg;
|
|
|
import com.sheep.gamegroup.view.activity.NotificationsUtils;
|
|
|
import com.sheep.gamegroup.view.adapter.AdbCommonRecycler;
|
|
|
-import com.sheep.gamegroup.view.adapter.AdpHomeListGrideview;
|
|
|
-import com.sheep.gamegroup.view.adapter.AdpHomeListListview;
|
|
|
import com.sheep.gamegroup.view.adapter.AdpTryMakemoney;
|
|
|
import com.sheep.gamegroup.view.adapter.TryMakeMoneyAdp;
|
|
|
-import com.sheep.gamegroup.view.dialog.DialogNewbieTaskList;
|
|
|
import com.sheep.gamegroup.view.dialog.DialogNotificationOfArrival;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
@@ -131,8 +125,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
|
|
|
import io.reactivex.schedulers.Schedulers;
|
|
|
import rx.functions.Action1;
|
|
|
|
|
|
-import static com.sheep.gamegroup.util.UMConfigUtils.Event.NEWBIE_TASK;
|
|
|
-
|
|
|
public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.View, TryMakeMoneyContract.View {
|
|
|
|
|
|
@BindView(R.id.upview1)
|
|
|
@@ -143,49 +135,18 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
LinearLayout homepageItemNoticeLayout;
|
|
|
@BindView(R.id.banner)
|
|
|
Banner banner;
|
|
|
-
|
|
|
- @BindView(R.id.icon_img_iv)
|
|
|
- ImageView iconImgIv;
|
|
|
- @BindView(R.id.name_tv)
|
|
|
- TextView nameTv;
|
|
|
- @BindView(R.id.sheep_num_tv)
|
|
|
- TextView sheepNumTv;
|
|
|
- @BindView(R.id.withdrawal)
|
|
|
- TextView withdrawal;
|
|
|
- @BindView(R.id.my_price)
|
|
|
- TextView myPrice;
|
|
|
- @BindView(R.id.try_play_layout)
|
|
|
- LinearLayout tryPlayLayout;
|
|
|
- @BindView(R.id.invitation_layout)
|
|
|
- LinearLayout invitationLayout;
|
|
|
- @BindView(R.id.lying_layout)
|
|
|
- LinearLayout lyingLayout;
|
|
|
- @BindView(R.id.card_layout)
|
|
|
- LinearLayout card_layout;
|
|
|
@BindView(R.id.scrollView)
|
|
|
NestedScrollView scrollView;
|
|
|
- @BindView(R.id.newbie_task)
|
|
|
- View newbie_task;
|
|
|
@BindView(R.id.refresh)
|
|
|
SmartRefreshLayout refresh;
|
|
|
@BindView(R.id.recyclerview)
|
|
|
RecyclerView recyclerview;
|
|
|
- @BindView(R.id.recharge)
|
|
|
- TextView recharge;
|
|
|
- @BindView(R.id.home_list_gridview_gv)
|
|
|
- MyGridview home_list_gridview_gv;
|
|
|
- @BindView(R.id.home_list_gridview_listview)
|
|
|
- MyListview home_list_gridview_listview;
|
|
|
- @BindView(R.id.home_list_gridview_layout)
|
|
|
- LinearLayout home_list_gridview_layout;
|
|
|
+ @BindView(R.id.home_list_rv)
|
|
|
+ RecyclerView home_list_rv;
|
|
|
+ @BindView(R.id.home_notice_ll)
|
|
|
+ View home_notice_ll;
|
|
|
@BindView(R.id.check_net_ll)
|
|
|
View check_net_ll;
|
|
|
- @BindView(R.id.bg_newbie_task)
|
|
|
- ImageView bg_newbie_task;
|
|
|
- @BindView(R.id.view_rob_duty)
|
|
|
- View viewRobDuty;
|
|
|
- @BindView(R.id.iv_rob_duty)
|
|
|
- ImageView ivDuty;
|
|
|
@BindView(R.id.viewpager_act_game_details)
|
|
|
ViewPager mViewPager;
|
|
|
@BindView(R.id.tabLayout)
|
|
|
@@ -233,16 +194,12 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
|
|
|
private List<HomeListEntity> homeListEntitys = new ArrayList<>();
|
|
|
private List<HomeListEntity> fullHomeList = new ArrayList<>();
|
|
|
- private List<HomeListEntity> homeListEntitysGridview = new ArrayList<>();
|
|
|
- private List<HomeListEntity> homeListEntitysListview = new ArrayList<>();
|
|
|
- private AdpHomeListGrideview adpHomeListGrideview;
|
|
|
- private AdpHomeListListview adpHomeListListview;
|
|
|
- private Release_task taskEty;
|
|
|
+ private List<HomeListEntity> homeListList = new ArrayList<>();
|
|
|
+ private AdpHomeList<HomeListEntity> adpHomeList;
|
|
|
private AdpTryMakemoney mAdapter;
|
|
|
|
|
|
private static final int LIST_COUNT = 2;//tryMakeMoneyAdp 总共有2条数据
|
|
|
private static final RecyleObj NULL = RecyleObj.make(RecyleType.NONE, null);//空数据
|
|
|
- public static final int WHAT_LOAD_USER_INFO = 0;//加载用户信息
|
|
|
public static final int WHAT_LOAD_RUN_TASK = 1;//加载正在进行的任务列表
|
|
|
public static final int WHAT_TRY_SHOW_HB = 7;//尝试显示红包
|
|
|
|
|
|
@@ -251,9 +208,6 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
public void handleMessage(Message msg) {
|
|
|
super.handleMessage(msg);
|
|
|
switch (msg.what) {
|
|
|
- case WHAT_LOAD_USER_INFO:
|
|
|
- loadUserInfo();
|
|
|
- break;
|
|
|
case WHAT_LOAD_RUN_TASK:
|
|
|
tryMakeMoneyAdp.clear();
|
|
|
//正在进行中的任务列表
|
|
|
@@ -735,22 +689,6 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void loadUserInfo() {
|
|
|
-
|
|
|
- if (myPrice == null || userEntity == null) {
|
|
|
- return;
|
|
|
- }
|
|
|
- ViewUtil.setText(nameTv, userEntity.getNickname());
|
|
|
- ViewUtil.setText(sheepNumTv, String.format(Locale.CHINA, "绵羊号:%s", userEntity.getInvitation_code()));
|
|
|
- if (ConfigUtil.isSmallDebug()) {
|
|
|
- sheepNumTv.append("\n邀请人:");
|
|
|
- sheepNumTv.append(userEntity.getParent_code());
|
|
|
- }
|
|
|
- ViewUtil.setText(myPrice, String.format(Locale.CHINA, "%s\u0020元", userEntity.getBalance()));
|
|
|
- GlideImageLoader.setAvatar(iconImgIv, userEntity.getAvatar(), Color.argb(128, 255, 255, 255));
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
@SuppressLint("ClickableViewAccessibility")
|
|
|
public void initListener() {
|
|
|
scrollView.setOnScrollChangeListener(new NestedScrollView.OnScrollChangeListener() {
|
|
|
@@ -847,9 +785,6 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
public void initData() {
|
|
|
//用户信息
|
|
|
userEntity = DataUtil.getInstance().getUserEntity();
|
|
|
- if (userEntity != null) {
|
|
|
- loadUserInfo();
|
|
|
- }
|
|
|
//任务
|
|
|
// List<TaskReleaseEty> cacheTaskReleaseEtyList = DataUtil.getInstance().getCacheList(ApiKey.release_task, TaskReleaseEty.class);
|
|
|
// if (cacheTaskReleaseEtyList != null) {
|
|
|
@@ -886,23 +821,24 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
}
|
|
|
//首页list
|
|
|
List<HomeListEntity> cacheHomeListEtyList = DataUtil.getInstance().getCacheList(ApiKey.home_list, HomeListEntity.class);
|
|
|
+ addHomeList(cacheHomeListEtyList);
|
|
|
+ refreshData();
|
|
|
+ }
|
|
|
+
|
|
|
+ //添加homeList数据
|
|
|
+ private void addHomeList(List<HomeListEntity> cacheHomeListEtyList) {
|
|
|
if (ListUtil.isEmpty(cacheHomeListEtyList)) {
|
|
|
- ViewUtil.setVisibility(home_list_gridview_layout, false);
|
|
|
- ViewUtil.setVisibility(full_home_list_rv, false);
|
|
|
+ ViewUtil.setVisibility(home_list_rv, false);
|
|
|
} else {
|
|
|
- ViewUtil.setVisibility(home_list_gridview_layout, true);
|
|
|
+ ViewUtil.setVisibility(home_list_rv, true);
|
|
|
+ homeListEntitys.clear();
|
|
|
+ homeListList.clear();
|
|
|
fullHomeList.clear();
|
|
|
CommonUtil.getInstance().splitHomeList(cacheHomeListEtyList, homeListEntitys, fullHomeList);
|
|
|
- ViewUtil.setVisibility(full_home_list_rv, !fullHomeList.isEmpty());
|
|
|
boolean isShowQB = false;
|
|
|
boolean isShowMd = false;
|
|
|
for (int i = 0; i < homeListEntitys.size(); i++) {
|
|
|
- /*if (i < 4) {
|
|
|
- homeListEntitysGridview.add(homeListEntitys.get(i));
|
|
|
- } else {
|
|
|
- homeListEntitysListview.add(homeListEntitys.get(i));
|
|
|
- }*/
|
|
|
- homeListEntitysGridview.add(homeListEntitys.get(i));
|
|
|
+ homeListList.add(homeListEntitys.get(i));
|
|
|
if (homeListEntitys.get(i).getJump().equals("6")) {//6Q币充值
|
|
|
isShowQB = !isShowQB;
|
|
|
}
|
|
|
@@ -914,11 +850,20 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
SheepApp.getInstance().setShowQB(isShowQB);
|
|
|
SheepApp.getInstance().setShowMidong(isShowMd);
|
|
|
ViewUtil.notifyDataSetChanged(full_home_list_rv);
|
|
|
- adpHomeListGrideview.notifyDataSetChanged();
|
|
|
- adpHomeListListview.notifyDataSetChanged();
|
|
|
- ViewUtil.setVisibility(home_list_gridview_listview, !homeListEntitysListview.isEmpty());
|
|
|
+ adpHomeList.notifyDataSetChanged();
|
|
|
+ }
|
|
|
+ checkFullHomeList();
|
|
|
+ }
|
|
|
+
|
|
|
+ //fullHomeList有数据时,要让fullHomeList上下遮盖相邻组件
|
|
|
+ private void checkFullHomeList() {
|
|
|
+ if (/*SkinUtil.curPlugin == Plugin.skin_new_year && */!fullHomeList.isEmpty()) {
|
|
|
+ LayoutParamsUtil.resetLayoutParams(full_home_list_rv, new Lp(G.DENSITY).setTopMargin(-8).setBottomMargin(-4));
|
|
|
+ LayoutParamsUtil.resetLayoutParams(home_notice_ll, new Lp().setTopMargin(0));
|
|
|
+ } else {
|
|
|
+ LayoutParamsUtil.resetLayoutParams(full_home_list_rv, new Lp().setTopMargin(0).setBottomMargin(0));
|
|
|
+ LayoutParamsUtil.resetLayoutParams(home_notice_ll, new Lp(G.DENSITY).setTopMargin(12));
|
|
|
}
|
|
|
- refreshData();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1004,25 +949,23 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
tryMakeMoneyAdp.addPresenter(tryMakeMoneyPresenter);
|
|
|
recyclerview.setAdapter(tryMakeMoneyAdp);
|
|
|
|
|
|
- adpHomeListListview = new AdpHomeListListview(homeListEntitysListview, activity);
|
|
|
- adpHomeListGrideview = new AdpHomeListGrideview(homeListEntitysGridview, activity);
|
|
|
- home_list_gridview_listview.setAdapter(adpHomeListListview);
|
|
|
- home_list_gridview_gv.setAdapter(adpHomeListGrideview);
|
|
|
+ adpHomeList = new AdpHomeList<>(homeListList);
|
|
|
|
|
|
- home_list_gridview_gv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
|
- @Override
|
|
|
- public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
|
|
- HomeListEntity homeListEntity = ListUtil.getItem(homeListEntitysGridview, position);
|
|
|
- if (homeListEntity == null) {
|
|
|
- return;
|
|
|
- }
|
|
|
- UMConfigUtils.IdEvent.HOME_LIST.commit(homeListEntity.getId());
|
|
|
- if ("-2".equals(homeListEntity.getJump())) {
|
|
|
- setValueList(!homeListEntity.isSelect());
|
|
|
- } else {
|
|
|
- CommonUtil.getInstance()
|
|
|
- .goWhere(activity, homeListEntity, "首页");
|
|
|
- }
|
|
|
+ GridLayoutManager manager = new GridLayoutManager(SheepApp.getInstance(), 4);
|
|
|
+ home_list_rv.setHasFixedSize(true);
|
|
|
+ home_list_rv.setNestedScrollingEnabled(false);
|
|
|
+ home_list_rv.setLayoutManager(manager);
|
|
|
+ adpHomeList.bindToRecyclerView(home_list_rv);
|
|
|
+ adpHomeList.setOnItemClickListener((adapter, view, position) -> {
|
|
|
+ HomeListEntity item = ListUtil.getItem(homeListList, position);
|
|
|
+ if (item == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ UMConfigUtils.IdEvent.HOME_LIST.commit(item.getId());
|
|
|
+ if ("-2".equals(item.getJump())) {
|
|
|
+ setValueList(!item.isSelect());
|
|
|
+ } else {
|
|
|
+ CommonUtil.getInstance().goWhere(activity, item, "首页");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -1044,49 +987,25 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
}
|
|
|
|
|
|
|
|
|
- @OnClick({R.id.recharge, R.id.withdrawal, R.id.view_rob_duty,
|
|
|
- R.id.newbie_task, R.id.icon_img_iv, R.id.user_layout,
|
|
|
- R.id.homepage_item_money_tv
|
|
|
+ @OnClick({R.id.view_rob_duty, R.id.homepage_item_money_tv
|
|
|
})
|
|
|
public void onViewClicked(View view) {
|
|
|
switch (view.getId()) {
|
|
|
case R.id.homepage_item_money_tv:
|
|
|
Jump2View.getInstance().goTryplayView(activity, null);
|
|
|
break;
|
|
|
- case R.id.withdrawal://提现
|
|
|
- Jump2View.getInstance().tryGoWithdrawal(activity, userEntity);
|
|
|
- break;
|
|
|
- case R.id.newbie_task://新手任务
|
|
|
- DialogNewbieTaskList.tryShowDialog(activity);
|
|
|
- NEWBIE_TASK.onEvent();
|
|
|
- break;
|
|
|
- case R.id.icon_img_iv://头像
|
|
|
- if (TestUtil.isTest()) {
|
|
|
- TestUtil.test(activity);
|
|
|
- } else
|
|
|
- Jump2View.getInstance().goPersonnalCenterView(activity, null);
|
|
|
- break;
|
|
|
- case R.id.user_layout://个人信息
|
|
|
- Jump2View.getInstance().goPersonnalCenterView(activity, null);
|
|
|
- break;
|
|
|
- case R.id.recharge://充值
|
|
|
- Jump2View.getInstance().goRechargeAct(activity, "首页");
|
|
|
- break;
|
|
|
case R.id.view_rob_duty://抢任务弹框
|
|
|
- CommonUtil.getInstance().robTask(new Action1<RobTask>() {
|
|
|
- @Override
|
|
|
- public void call(RobTask robTask) {
|
|
|
- if (robTask != null) {
|
|
|
- DataUtil.putAsInt(DataKey.KEY_ORDER, robTask.getOrder());
|
|
|
- try {
|
|
|
- ViewUtil.newInstance().showRobDutyDialog(activity, robTask);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- G.showToast(e.getMessage());
|
|
|
- }
|
|
|
- } else {
|
|
|
- G.showToast(R.string.task_sold_out_focus_publish);
|
|
|
+ CommonUtil.getInstance().robTask(robTask -> {
|
|
|
+ if (robTask != null) {
|
|
|
+ DataUtil.putAsInt(DataKey.KEY_ORDER, robTask.getOrder());
|
|
|
+ try {
|
|
|
+ ViewUtil.newInstance().showRobDutyDialog(activity, robTask);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ G.showToast(e.getMessage());
|
|
|
}
|
|
|
+ } else {
|
|
|
+ G.showToast(R.string.task_sold_out_focus_publish);
|
|
|
}
|
|
|
});
|
|
|
break;
|
|
|
@@ -1104,7 +1023,6 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
return;
|
|
|
}
|
|
|
DataUtil.getInstance().setUserEntity(userEntity);
|
|
|
- mHandler.sendEmptyMessage(WHAT_LOAD_USER_INFO);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -1256,49 +1174,14 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
boolean isNewData = DataUtil.getInstance().isNewData(ApiKey.home_list);
|
|
|
if (isNewData) {
|
|
|
List<HomeListEntity> homeListEntityList = baseMessage.getDataList(HomeListEntity.class);
|
|
|
- if (ListUtil.isEmpty(homeListEntityList)) {
|
|
|
- ViewUtil.setVisibility(home_list_gridview_layout, false);
|
|
|
- ViewUtil.setVisibility(full_home_list_rv, false);
|
|
|
- } else {
|
|
|
- ViewUtil.setVisibility(home_list_gridview_layout, true);
|
|
|
- homeListEntitys.clear();
|
|
|
- homeListEntitysGridview.clear();
|
|
|
- homeListEntitysListview.clear();
|
|
|
- fullHomeList.clear();
|
|
|
- CommonUtil.getInstance().splitHomeList(homeListEntityList, homeListEntitys, fullHomeList);
|
|
|
- ViewUtil.setVisibility(full_home_list_rv, !fullHomeList.isEmpty());
|
|
|
- boolean isShowQB = false;
|
|
|
- boolean isShowMd = false;
|
|
|
- for (int i = 0; i < homeListEntitys.size(); i++) {
|
|
|
-// if (i < 4) {
|
|
|
-// homeListEntitysGridview.add(homeListEntitys.get(i));
|
|
|
-// } else {
|
|
|
-// homeListEntitysListview.add(homeListEntitys.get(i));
|
|
|
-// }
|
|
|
- homeListEntitysGridview.add(homeListEntitys.get(i));
|
|
|
- if (homeListEntitys.get(i).getJump().equals("6")) {//6Q币充值
|
|
|
- isShowQB = !isShowQB;
|
|
|
- }
|
|
|
- if (homeListEntitys.get(i).getJump().equals("14")) {//幂动科技
|
|
|
- isShowMd = !isShowMd;
|
|
|
- }
|
|
|
- }
|
|
|
- addNewTask();
|
|
|
- SheepApp.getInstance().setShowQB(isShowQB);
|
|
|
- SheepApp.getInstance().setShowMidong(isShowMd);
|
|
|
- ViewUtil.notifyDataSetChanged(full_home_list_rv);
|
|
|
- adpHomeListGrideview.notifyDataSetChanged();
|
|
|
- adpHomeListListview.notifyDataSetChanged();
|
|
|
- ViewUtil.setVisibility(home_list_gridview_listview, !homeListEntitysListview.isEmpty());
|
|
|
- }
|
|
|
+ addHomeList(homeListEntityList);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void failhomeList(BaseMessage baseMessage) {
|
|
|
- if (homeListEntitys.isEmpty() && fullHomeList.isEmpty())
|
|
|
- ViewUtil.setVisibility(home_list_gridview_layout, false);
|
|
|
-
|
|
|
+ ViewUtil.setVisibility(home_list_rv, !homeListList.isEmpty());
|
|
|
+ ViewUtil.setVisibility(full_home_list_rv, !fullHomeList.isEmpty());
|
|
|
}
|
|
|
|
|
|
private int onResumeCount = 0;
|
|
|
@@ -1306,21 +1189,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
@Override
|
|
|
public void onResume() {
|
|
|
super.onResume();
|
|
|
- UserEntity result = DataUtil.getInstance().getUserEntity();
|
|
|
- if (result == null) {
|
|
|
- CommonUtil.getInstance().updateUserInfo(new Action1<UserEntity>() {
|
|
|
- @Override
|
|
|
- public void call(UserEntity item) {
|
|
|
- if (item != null) {
|
|
|
- userEntity = item;
|
|
|
- loadUserInfo();
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- userEntity = result;
|
|
|
- loadUserInfo();
|
|
|
- }
|
|
|
+ CommonUtil.getInstance().callActionWithUserInfo(item -> userEntity = item);
|
|
|
if (onResumeCount > 0)
|
|
|
refreshTaskList();
|
|
|
onResumeCount++;
|
|
|
@@ -1661,7 +1530,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (CommonUtil.getInstance().addNewTask(activity, userEntity) && homeListEntitysGridview != null) {
|
|
|
+ if (CommonUtil.getInstance().addNewTask(activity, userEntity) && homeListList != null) {
|
|
|
HomeListEntity homeListEntityNewTask = new HomeListEntity();
|
|
|
homeListEntityNewTask.setTitle(getString(R.string.fresh_task));
|
|
|
homeListEntityNewTask.setDesc(getString(R.string.fresh_task));
|
|
|
@@ -1682,17 +1551,17 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
|
|
|
private void setValueList(boolean flag) {
|
|
|
boolean isNewYear = SkinUtil.getSkinByTime() == Plugin.skin_new_year;
|
|
|
- homeListEntitysGridview.clear();
|
|
|
+ homeListList.clear();
|
|
|
for (int i = 0; i < homeListEntitys.size(); i++) {
|
|
|
if (flag) {
|
|
|
- homeListEntitysGridview.add(homeListEntitys.get(i));
|
|
|
+ homeListList.add(homeListEntitys.get(i));
|
|
|
} else {
|
|
|
if (i < 8) {
|
|
|
- homeListEntitysGridview.add(homeListEntitys.get(i));
|
|
|
+ homeListList.add(homeListEntitys.get(i));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (homeListEntitysGridview.size() > 8) {
|
|
|
+ if (homeListList.size() > 8) {
|
|
|
HomeListEntity homeListEntity = new HomeListEntity();
|
|
|
homeListEntity.setJump("-2");
|
|
|
homeListEntity.setSelect(flag);
|
|
|
@@ -1705,13 +1574,13 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
homeListEntity.setDesc("查看更多");
|
|
|
homeListEntity.setIcon(ViewUtil.getNetImgByName((isNewYear ? "ic_new_year_" : "") + "homepage_chakangd"));
|
|
|
}
|
|
|
- homeListEntitysGridview.set(7, homeListEntity);
|
|
|
+ homeListList.set(7, homeListEntity);
|
|
|
}
|
|
|
/* 为了避免第一次点击时网络图片未加载到本地导致UI混乱,第一次点击不执行此动画,转而使用View自带的变换动画 */
|
|
|
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && clickCount > 1) {
|
|
|
// TransitionManager.beginDelayedTransition(home_list_gridview_gv, new ChangeBounds());
|
|
|
// }
|
|
|
- adpHomeListGrideview.notifyDataSetChanged();
|
|
|
+ adpHomeList.notifyDataSetChanged();
|
|
|
}
|
|
|
|
|
|
@BindView(R.id.home_search_msg_tv)
|