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