根据issues整理项目

This commit is contained in:
huangzhuanghua
2016-09-06 18:15:41 +08:00
parent 6cbb033326
commit 4e392eeb14
65 changed files with 1224 additions and 2610 deletions

View File

@ -37,6 +37,7 @@ import com.gh.download.DownloadManager;
import com.gh.download.DownloadStatus;
import com.gh.gamecenter.entity.AppEntity;
import com.gh.gamecenter.entity.GameUpdateEntity;
import com.gh.gamecenter.eventbus.EBRefresh;
import com.gh.gamecenter.manager.PackageManager;
import com.gh.gamecenter.volley.extended.JsonObjectExtendedRequest;
import com.google.gson.Gson;
@ -48,6 +49,8 @@ import java.io.File;
import java.util.HashMap;
import java.util.Map.Entry;
import de.greenrobot.event.EventBus;
/**
* 游戏设置页面
*
@ -122,7 +125,6 @@ public class SettingActivity extends BaseActivity implements OnClickListener {
init(contentView, "设置");
findViewById(R.id.setting_cv_fix_download).setOnClickListener(this);
findViewById(R.id.setting_rl_autoinstall).setOnClickListener(this);
findViewById(R.id.setting_rl_autodelete).setOnClickListener(this);
findViewById(R.id.setting_rl_deletedata).setOnClickListener(this);
@ -139,6 +141,12 @@ public class SettingActivity extends BaseActivity implements OnClickListener {
sp = getSharedPreferences(Config.PREFERENCE, Activity.MODE_PRIVATE);
// 未打开下载按钮,显示修复下载按钮
if (!sp.getBoolean("isShow", false)) {
findViewById(R.id.setting_cv_fix_download).setVisibility(View.VISIBLE);
findViewById(R.id.setting_cv_fix_download).setOnClickListener(this);
}
setting_sb_autoinstall.setChecked(sp.getBoolean("autoinstall", true));
setting_sb_autodelete.setChecked(sp.getBoolean("autodelete", true));
setting_sb_deletedata.setChecked(sp.getBoolean("deletedata", true));
@ -208,7 +216,10 @@ public class SettingActivity extends BaseActivity implements OnClickListener {
finish();
break;
case R.id.setting_cv_fix_download:
sp.edit().putBoolean("isShow", true).apply();
Config.getInstance().setShow(true);
toast("修复成功,快去首页看看吧");
EventBus.getDefault().post(new EBRefresh());
break;
case R.id.setting_rl_autoinstall:
setting_sb_autoinstall.performClick();
@ -230,31 +241,14 @@ public class SettingActivity extends BaseActivity implements OnClickListener {
checkUpdate();
break;
case R.id.setting_rl_cache:
final Dialog dialog_hint = new Dialog(this);
View view = View.inflate(this, R.layout.common_alertdialog, null);
TextView dialog_title = (TextView) view.findViewById(R.id.alertdialog_title);
TextView dialog_content = (TextView) view.findViewById(R.id.alertdialog_content);
dialog_content.setText("清空缓存后未安装的游戏可能需要重新下载,确定清空?");
dialog_title.setText("清除缓存");
view.findViewById(R.id.alertdialog_cannel)
.setOnClickListener(new OnClickListener() {
DialogUtils.showWarningDialog(this, "清除缓存", "清空缓存后未安装的游戏可能需要重新下载,确定清空?",
new DialogUtils.ConfiremListener() {
@Override
public void onClick(View v) {
dialog_hint.dismiss();
}
});
view.findViewById(R.id.alertdialog_confirm)
.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog_hint.dismiss();
public void onConfirem() {
dialog = DialogUtils.showWaitDialog(context, "清除缓存中...");
claerCache();
}
});
dialog_hint.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog_hint.setContentView(view);
dialog_hint.show();
break;
case R.id.setting_rl_feedback:
startActivity(new Intent(SettingActivity.this,