|
|
@@ -36,6 +36,7 @@ import com.kfzs.duanduan.utils.net.APIRequest;
|
|
|
import com.kfzs.duanduan.utils.net.APIRequestInstance;
|
|
|
import com.kfzs.duanduan.utils.net.ResponseNetworkTask;
|
|
|
import com.kfzs.duanduan.view.AppHomepageAdvertisementDialog;
|
|
|
+import com.kfzs.duanduan.view.DialogStorageLow;
|
|
|
import com.sheep.gamegroup.absBase.BaseActivity;
|
|
|
import com.sheep.gamegroup.util.UMConfigUtils;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
@@ -44,6 +45,7 @@ import com.zhy.http.okhttp.OkHttpUtils;
|
|
|
import com.zhy.http.okhttp.callback.StringCallback;
|
|
|
|
|
|
import org.greenrobot.eventbus.EventBus;
|
|
|
+import org.greenrobot.eventbus.Subscribe;
|
|
|
import org.json.JSONException;
|
|
|
import org.json.JSONObject;
|
|
|
|
|
|
@@ -65,13 +67,14 @@ public class ActMainGame extends BaseActivity {
|
|
|
View download_layout;
|
|
|
@BindView(R.id.edt_main_search_enter)
|
|
|
EditText edt_main_search_enter;
|
|
|
+ @BindView(R.id.img_download_manager_dot)
|
|
|
+ ImageView mImgDot;//下载按钮的小红点
|
|
|
Activity activity;
|
|
|
|
|
|
|
|
|
private static final String TAG = "ActMainGame";
|
|
|
private DownloadTaskService mDownloadTaskService;
|
|
|
|
|
|
- private ImageView mImgDot;//下载按钮的小红点
|
|
|
private AppHomepageAdvertisementDialog gameDialog;//预约窗口
|
|
|
private boolean isGetAdvertisementDialogData = false;
|
|
|
|
|
|
@@ -85,6 +88,8 @@ public class ActMainGame extends BaseActivity {
|
|
|
|
|
|
activity = this;
|
|
|
|
|
|
+ EventBus.getDefault().register(this);
|
|
|
+ mDownloadTaskService = new DownloadTaskService(this);
|
|
|
TitleBarUtils
|
|
|
.getInstance()
|
|
|
.setTitle(this, "玩转游戏")
|
|
|
@@ -93,6 +98,7 @@ public class ActMainGame extends BaseActivity {
|
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
|
startActivity(new Intent(activity, ActDownloadMgr.class));
|
|
|
+ mImgDot.setVisibility(View.GONE);
|
|
|
UMConfigUtils.onEvent(UMConfigUtils.Event.GAME_DOWNLOAD_MANAGER);
|
|
|
}
|
|
|
});
|
|
|
@@ -299,4 +305,26 @@ public class ActMainGame extends BaseActivity {
|
|
|
}
|
|
|
return backStr;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 主要的事件广播接收更新处理
|
|
|
+ *
|
|
|
+ * @param event
|
|
|
+ */
|
|
|
+ @Subscribe
|
|
|
+ public void onEventMainThread(BigEvent event) {
|
|
|
+ switch (event.getEventTypes()) {
|
|
|
+ case TIPS_DOWN_ICON:
|
|
|
+ mImgDot.setVisibility(View.VISIBLE);
|
|
|
+ break;
|
|
|
+ case STORAGE_LOW:
|
|
|
+ DialogStorageLow.showDialog(this);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void onDestroy() {
|
|
|
+ super.onDestroy();
|
|
|
+ EventBus.getDefault().unregister(this);
|
|
|
+ }
|
|
|
}
|