优化
This commit is contained in:
parent
dfca615735
commit
c00afb1db0
@ -633,11 +633,17 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
((TextView) floatRedPacket.findViewById(R.id.progressText)).setText(data.getRedPacketNum() + "/" + data.getRedPacketTotal());
|
||||
}
|
||||
if (data.getShowWarOrder() == 0) {
|
||||
|
||||
floatWarOrder.setVisibility(View.GONE);
|
||||
floatBanner.setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.banner_click).setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
floatWarOrder.setVisibility(View.VISIBLE);
|
||||
if (mainHomeViewHolder!=null&&mainHomeViewHolder.isFloatWarOrder()){
|
||||
floatWarOrder.setVisibility(View.GONE);
|
||||
}else {
|
||||
floatWarOrder.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
floatBanner.setVisibility(View.GONE);
|
||||
findViewById(R.id.banner_click).setVisibility(View.GONE);
|
||||
}
|
||||
@ -645,6 +651,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
ToastUtil.show(mContext.getString(R.string.net_error));
|
||||
}
|
||||
});
|
||||
|
@ -25,6 +25,11 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
|
||||
private MainHomeGameViewHolder mainHomeGameLiveViewHolder;
|
||||
private final String mPageName = "home_page";
|
||||
private ImageView img_trophy;
|
||||
private boolean floatWarOrder;
|
||||
|
||||
public boolean isFloatWarOrder() {
|
||||
return floatWarOrder;
|
||||
}
|
||||
|
||||
public MainHomeViewHolder(Context context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
@ -60,18 +65,22 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
|
||||
protected void loadPageData(int position) {
|
||||
switch (position) {
|
||||
case 0:
|
||||
floatWarOrder = false;
|
||||
MobclickAgent.onEvent(mContext, "home_page_follow", "首页关注列表按钮");
|
||||
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(false));
|
||||
break;
|
||||
case 1:
|
||||
floatWarOrder = false;
|
||||
MobclickAgent.onEvent(mContext, "home_page_hot", "首页热门列表按钮");
|
||||
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(false));
|
||||
break;
|
||||
case 2:
|
||||
floatWarOrder = false;
|
||||
MobclickAgent.onEvent(mContext, "home_page_recommend", "首页推荐列表按钮");
|
||||
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(false));
|
||||
break;
|
||||
case 3:
|
||||
floatWarOrder = true;
|
||||
MobclickAgent.onEvent(mContext, "home_page_redpk", "首页红包列表按钮");
|
||||
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(true));
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user