|
|
@@ -56,6 +56,7 @@ import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.entity.BulletinEnty;
|
|
|
import com.sheep.gamegroup.model.entity.CashAwarsEntity;
|
|
|
import com.sheep.gamegroup.model.entity.HomeListEntity;
|
|
|
+import com.sheep.gamegroup.model.entity.Keyword;
|
|
|
import com.sheep.gamegroup.model.entity.Lp;
|
|
|
import com.sheep.gamegroup.model.entity.MessageUnReadEntity;
|
|
|
import com.sheep.gamegroup.model.entity.MoreDataEntity;
|
|
|
@@ -121,6 +122,7 @@ import org.greenrobot.eventbus.Subscribe;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
+import java.util.Iterator;
|
|
|
import java.util.List;
|
|
|
import java.util.Locale;
|
|
|
|
|
|
@@ -182,6 +184,8 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
LinearLayout titleCardLayout;
|
|
|
@BindView(R.id.home_award_container)
|
|
|
View home_award_container;
|
|
|
+ @BindView(R.id.search_text_view)
|
|
|
+ TextView search_text_view;
|
|
|
/* 记录滑动坐标的数组 */
|
|
|
int[] locate = new int[2];
|
|
|
|
|
|
@@ -305,7 +309,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
});
|
|
|
edInvitationCode.setOnLongClickListener(view1 -> {
|
|
|
CharSequence text = StringUtils.getCopyText();
|
|
|
- if(!TextUtils.isEmpty(text)){
|
|
|
+ if (!TextUtils.isEmpty(text)) {
|
|
|
edInvitationCode.setText(text);
|
|
|
}
|
|
|
return false;
|
|
|
@@ -322,6 +326,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
public void toActWebX5Sbd() {
|
|
|
Jump2View.getInstance().goWeb(activity, new WebParams(Config.getUrlByPath(Config.PATH_SBD_HOME), Config.SBD_NAME));
|
|
|
}
|
|
|
+
|
|
|
@OnClick(R.id.home_search_msg_iv)
|
|
|
public void toActMsg() {
|
|
|
startActivity(new Intent(activity, ActMsg.class));
|
|
|
@@ -544,6 +549,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
}
|
|
|
setTitleCardLayout(doIt.getText().toString(), 3, curPosition);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 点击限时抢购
|
|
|
*/
|
|
|
@@ -597,14 +603,15 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
//banner的高度
|
|
|
private int bannerHeight;
|
|
|
|
|
|
- private void initBannerHeight(){
|
|
|
- bannerHeight = G.WIDTH * 17 / 40;
|
|
|
+ private void initBannerHeight() {
|
|
|
+ bannerHeight = G.WIDTH * 17 / 40;
|
|
|
}
|
|
|
|
|
|
//游戏福利专区入口与刷新福利
|
|
|
@BindView(R.id.hp_refresh_welfare_box)
|
|
|
View hp_refresh_welfare_box;
|
|
|
private HpRefreshWelfareHelper mHpRefreshWelfareHelper;//刷新福利的帮助类
|
|
|
+
|
|
|
public void initView() {
|
|
|
try {
|
|
|
EventBus.getDefault().register(this);
|
|
|
@@ -788,7 +795,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
notifyDataSetChanged();
|
|
|
return;
|
|
|
}
|
|
|
- if(item instanceof ILoadMore)
|
|
|
+ if (item instanceof ILoadMore)
|
|
|
((ILoadMore) item).loadMoreData();
|
|
|
notifyDataSetChanged();
|
|
|
}
|
|
|
@@ -822,7 +829,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
// }
|
|
|
|
|
|
|
|
|
- if(ViewUtil.isVisible(home_award_container)) {
|
|
|
+ if (ViewUtil.isVisible(home_award_container)) {
|
|
|
//实时动态
|
|
|
List<MoreDataEntity> cacheMoreDataEtyList = DataUtil.getInstance().getCacheList(ApiKey.award_detail, MoreDataEntity.class);
|
|
|
if (!ListUtil.isEmpty(cacheMoreDataEtyList)) {
|
|
|
@@ -914,6 +921,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
}
|
|
|
});
|
|
|
getUnReadMessageCounts();
|
|
|
+ getSearchHotKeyword();
|
|
|
if (upview1 != null) {
|
|
|
//停止滚动
|
|
|
upview1.stopFlipping();
|
|
|
@@ -935,7 +943,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
pagePresenter.slideshow(null);//轮播
|
|
|
pagePresenter.homeList();//首页list
|
|
|
|
|
|
- if(ViewUtil.isVisible(home_award_container)) {
|
|
|
+ if (ViewUtil.isVisible(home_award_container)) {
|
|
|
CommonUtil.getInstance().getUserNoDoingTaskMoney(o -> {
|
|
|
|
|
|
if (o != null) {
|
|
|
@@ -956,13 +964,39 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
if (!isFirst) {
|
|
|
for (int i = 0; i < mAdapter.getCount(); i++) {
|
|
|
Fragment item = mAdapter.getItem(i);
|
|
|
- if(item instanceof IRefresh)
|
|
|
+ if (item instanceof IRefresh)
|
|
|
((IRefresh) item).refreshData();
|
|
|
}
|
|
|
}
|
|
|
isFirst = false;
|
|
|
}
|
|
|
|
|
|
+ private void getSearchHotKeyword() {
|
|
|
+ SheepApp.getInstance().getNetComponent().getApiService().keywords()
|
|
|
+ .subscribeOn(Schedulers.io())
|
|
|
+ .observeOn(AndroidSchedulers.mainThread())
|
|
|
+ .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
+ @Override
|
|
|
+ public void onNext(BaseMessage baseMessage) {
|
|
|
+ List<Keyword> hotKeywords = baseMessage.getDatas(Keyword.class);
|
|
|
+ Iterator<Keyword> it = hotKeywords.iterator();
|
|
|
+ while (it.hasNext()) {
|
|
|
+ Keyword keyword = it.next();
|
|
|
+ if (keyword.getPosition() == 2) {
|
|
|
+ search_text_view.setText(keyword.getKeyword());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onError(BaseMessage baseMessage) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
private boolean isFirst = true;
|
|
|
|
|
|
/**
|
|
|
@@ -995,7 +1029,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
return;
|
|
|
}
|
|
|
UMConfigUtils.IdEvent.HOME_LIST.commit(item.getId());
|
|
|
- if(item.hasChild()){
|
|
|
+ if (item.hasChild()) {
|
|
|
CommonUtil.getInstance().showHomeList(activity, item.getChild_list(), view);
|
|
|
} else {
|
|
|
CommonUtil.getInstance().goWhere(activity, item, "首页");
|
|
|
@@ -1095,10 +1129,10 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
public void returnTaskTaskUpdateView(Object object) {
|
|
|
// boolean isNewData = DataUtil.getInstance().isNewData(ApiKey.new_run_task(is_succession, show_game_task));
|
|
|
// if (isNewData) {
|
|
|
- BaseMessage baseMessage = (BaseMessage) object;
|
|
|
- allTaskAcceptedTaskList = baseMessage.getDataList(TaskAcceptedEty.class);
|
|
|
- CommonUtil.getInstance().reloadAutoTaskList(allTaskAcceptedTaskList);
|
|
|
- EventBus.getDefault().post(new ShowRedDot(ShowRedDot.WHERE_PERSONAL_CENTER).setShow(DataUtil.getInstance().checkAppointList(allTaskAcceptedTaskList)));
|
|
|
+ BaseMessage baseMessage = (BaseMessage) object;
|
|
|
+ allTaskAcceptedTaskList = baseMessage.getDataList(TaskAcceptedEty.class);
|
|
|
+ CommonUtil.getInstance().reloadAutoTaskList(allTaskAcceptedTaskList);
|
|
|
+ EventBus.getDefault().post(new ShowRedDot(ShowRedDot.WHERE_PERSONAL_CENTER).setShow(DataUtil.getInstance().checkAppointList(allTaskAcceptedTaskList)));
|
|
|
// } else {
|
|
|
// allTaskAcceptedTaskList.clear();
|
|
|
// }
|
|
|
@@ -1221,13 +1255,14 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
private int onResumeCount = 0;
|
|
|
|
|
|
private boolean hasShowSbd = false;
|
|
|
+
|
|
|
@Override
|
|
|
public void onResume() {
|
|
|
super.onResume();
|
|
|
CommonUtil.getInstance().callActionWithUserInfo(item -> userEntity = item);
|
|
|
if (onResumeCount > 0)
|
|
|
refreshTaskList();
|
|
|
- if(!hasShowSbd && activity instanceof ActMain && ((ActMain) activity).getLastPosition() == MainTab.FgtSmallSheep.ordinal()){
|
|
|
+ if (!hasShowSbd && activity instanceof ActMain && ((ActMain) activity).getLastPosition() == MainTab.FgtSmallSheep.ordinal()) {
|
|
|
hasShowSbd = true;
|
|
|
//延时显示随便打弹出框提示
|
|
|
PopupWindowUtil.delayShowLayout(activity, new PopupWindowUtil.PopupWindowParams(R.layout.pop_show_sbd_tip).setAnchor(to_search_but_rl)
|
|
|
@@ -1313,13 +1348,13 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
@Override
|
|
|
public void onStop() {
|
|
|
//结束轮播
|
|
|
- if(banner != null)
|
|
|
+ if (banner != null)
|
|
|
banner.stopAutoPlay();
|
|
|
super.onStop();
|
|
|
}
|
|
|
|
|
|
private void bindBanner() {
|
|
|
- if(banner == null){
|
|
|
+ if (banner == null) {
|
|
|
return;
|
|
|
}
|
|
|
//结束轮播
|
|
|
@@ -1377,6 +1412,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
}
|
|
|
|
|
|
private List<BulletinEnty> bulletinEntyList;
|
|
|
+
|
|
|
/**
|
|
|
* 公共
|
|
|
*/
|
|
|
@@ -1520,7 +1556,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
}
|
|
|
SpUtils.saveFirst("first_invitation" + userEntity.getId(), true);//第一次登录成功后保存起来,下次进来就不再弹新人红包
|
|
|
if (((userEntity.getNewbie_task_status() & 16) == 0) && userEntity.getIs_new() == 1) {
|
|
|
- if(TestUtil.isLTVersion3_4_5()) {//新版本中不显示填写邀请码的界面
|
|
|
+ if (TestUtil.isLTVersion3_4_5()) {//新版本中不显示填写邀请码的界面
|
|
|
isShowRedPackageWithCode();//邀请红包
|
|
|
}
|
|
|
}
|
|
|
@@ -1565,12 +1601,13 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
|
|
|
@BindView(R.id.home_list_more_iv)
|
|
|
ImageView home_list_more_iv;
|
|
|
+
|
|
|
@OnClick(R.id.home_list_more_iv)
|
|
|
public void toggleHomeList() {//homeList展开或者收缩
|
|
|
boolean isHomeListExtend = homeListList.size() > 8;
|
|
|
isHomeListExtend = !isHomeListExtend;
|
|
|
ViewUtil.setImage(home_list_more_iv, isHomeListExtend ? R.drawable.bg_to_top : R.drawable.bg_to_bottom);
|
|
|
- if(isHomeListExtend){
|
|
|
+ if (isHomeListExtend) {
|
|
|
homeListList.clear();
|
|
|
homeListList.addAll(homeListEntitys);
|
|
|
} else {
|
|
|
@@ -1578,6 +1615,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
}
|
|
|
adpHomeList.notifyDataSetChanged();
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 新手任务
|
|
|
*/
|
|
|
@@ -1594,6 +1632,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
getHomeList();
|
|
|
adpHomeList.notifyDataSetChanged();
|
|
|
}
|
|
|
+
|
|
|
private void getHomeList() {
|
|
|
homeListList.clear();
|
|
|
for (int i = 0; i < homeListEntitys.size(); i++) {
|