Merge remote-tracking branch 'origin/dev' into dev
# Conflicts: # app/src/main/java/com/gh/gamecenter/CleanApkActivity.java # app/src/main/java/com/gh/gamecenter/MessageDetailActivity.java # app/src/main/java/com/gh/gamecenter/VoteActivity.java # app/src/main/java/com/gh/gamecenter/adapter/LibaoDetailAdapter.java # app/src/main/java/com/gh/gamecenter/adapter/MessageDetailAdapter.java # app/src/main/java/com/gh/gamecenter/adapter/VoteAdapter.java # app/src/main/java/com/gh/gamecenter/libao/Libao1FragmentAdapter.java # app/src/main/java/com/gh/gamecenter/libao/Libao2FragmentAdapter.java # app/src/main/java/com/gh/gamecenter/libao/Libao3FragmentAdapter.java # app/src/main/java/com/gh/gamecenter/message/CommentFragmentAdapter.java # app/src/main/java/com/gh/gamecenter/news/News1FragmentAdapter.java
This commit is contained in:
@ -100,7 +100,7 @@ import de.greenrobot.event.EventBus;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.RequestBody;
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.adapter.rxjava.HttpException;
|
||||
import retrofit2.HttpException;
|
||||
import rx.Observable;
|
||||
import rx.android.schedulers.AndroidSchedulers;
|
||||
import rx.functions.Action1;
|
||||
@ -327,9 +327,9 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
}
|
||||
final String path = downloadEntity.getPath();
|
||||
DialogUtils.showWarningDialog(this, "提示", msg, "直接退出", "立即安装",
|
||||
new DialogUtils.ConfiremListener() {
|
||||
new DialogUtils.ConfirmListener() {
|
||||
@Override
|
||||
public void onConfirem() {
|
||||
public void onConfirm() {
|
||||
handler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -488,7 +488,7 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
Log.e("TD_CHANNEL_ID", (String) PackageUtils.getMetaData(this, getPackageName(), "TD_CHANNEL_ID"));
|
||||
|
||||
if (sp.getBoolean("changeDefaultIcon", false) && sp.getInt("default_user_icon", 0) != 0) {
|
||||
postDefaultIcon(true, sp.getInt("default_user_icon", 0));
|
||||
postDefaultIcon(true, sp.getInt("default_user_icon", 0), 1);
|
||||
}
|
||||
|
||||
getSuggestionType();
|
||||
@ -806,9 +806,9 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
"<font color='#ff0000'>读取应用列表</font>”选择为打开" +
|
||||
"“<font color='#ff0000'>允许</font>”,否则光环助手将无法帮您安装插件加速版的游戏");
|
||||
DialogUtils.showWarningDialog(this, "提示", content, "忽略", "去开启",
|
||||
new DialogUtils.ConfiremListener() {
|
||||
new DialogUtils.ConfirmListener() {
|
||||
@Override
|
||||
public void onConfirem() {
|
||||
public void onConfirm() {
|
||||
// 跳转应用信息界面
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||
@ -1546,14 +1546,14 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
DownloadManager.getInstance(this).removeObserver(dataWatcher);
|
||||
|
||||
if (sp.getBoolean("changeDefaultIcon", false) && sp.getInt("default_user_icon", 0) != 0) {
|
||||
postDefaultIcon(true, sp.getInt("default_user_icon", 0));
|
||||
postDefaultIcon(true, sp.getInt("default_user_icon", 0), 1);
|
||||
}
|
||||
|
||||
handler.removeCallbacksAndMessages(null);
|
||||
}
|
||||
|
||||
// 提交默认头像
|
||||
private void postDefaultIcon(boolean isCheck, final int i) {
|
||||
private void postDefaultIcon(boolean isCheck, final int i, final int count) {
|
||||
TokenUtils.getToken(this, isCheck)
|
||||
.flatMap(new Func1<String, Observable<ResponseBody>>() {
|
||||
@Override
|
||||
@ -1570,19 +1570,15 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
.subscribe(new JSONObjectResponse() {
|
||||
@Override
|
||||
public void onResponse(JSONObject response) {
|
||||
super.onResponse(response);
|
||||
sp.edit().putBoolean("changeDefaultIcon", false);
|
||||
sp.edit().putBoolean("changeDefaultIcon", false).apply();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(HttpException e) {
|
||||
super.onFailure(e);
|
||||
if (e != null) {
|
||||
if (e.code() == 401) {
|
||||
postDefaultIcon(true, i);
|
||||
return;
|
||||
postDefaultIcon(true, i, count - 1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user