diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index 7d5db07..6a209c5 100644 Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ diff --git a/app/build.gradle b/app/build.gradle index cd3edbb..e5c5b1d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -24,7 +24,6 @@ android { // 设置MultiDex可用 multiDexEnabled true flavorDimensions "gank" - javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } } } signingConfigs {//签名信息 diff --git a/app/src/main/java/com/maning/gankmm/http/callback/CommonHttpCallback.java b/app/src/main/java/com/maning/gankmm/http/callback/CommonHttpCallback.java index 8a21cac..280e800 100644 --- a/app/src/main/java/com/maning/gankmm/http/callback/CommonHttpCallback.java +++ b/app/src/main/java/com/maning/gankmm/http/callback/CommonHttpCallback.java @@ -25,45 +25,49 @@ public abstract class CommonHttpCallback implements Callback { @Override public void onResponse(Call call, Response response) { onFinish(); - if (200 == response.code()) { - T body = response.body(); - if (body instanceof Gank2BaseBean) { - //gankio - Gank2BaseBean baseBean = (Gank2BaseBean) response.body(); - if (baseBean.getStatus() == 100) { - onSuccess(response.body()); + try { + if (200 == response.code()) { + T body = response.body(); + if (body instanceof Gank2BaseBean) { + //gankio + Gank2BaseBean baseBean = (Gank2BaseBean) response.body(); + if (baseBean.getStatus() == 100) { + onSuccess(response.body()); + } else { + onFail(baseBean.getStatus(), baseBean.getMsg()); + } + } else if (body instanceof CaiyunWeatherBaseBean) { + //彩云天气 + CaiyunWeatherBaseBean baseBean = (CaiyunWeatherBaseBean) response.body(); + String status = baseBean.getStatus(); + String api_status = baseBean.getApi_status(); + if ("ok".equals(status) && "active".equals(api_status)) { + onSuccess(response.body()); + } else { + onFail(1000, "彩云天气接口出错啦~~~"); + } + } else if (body instanceof ZhixinBaseBean) { + ZhixinBaseBean baseBean = (ZhixinBaseBean) response.body(); + if (TextUtils.isEmpty(baseBean.getStatus())) { + onSuccess(response.body()); + } else { + onFail(1000, baseBean.getStatus()); + } + } else if (body instanceof RollToolsBaseBean) { + RollToolsBaseBean baseBean = (RollToolsBaseBean) response.body(); + if (baseBean.getCode() == 1) { + onSuccess(response.body()); + } else { + onFail(baseBean.getCode(), baseBean.getMsg()); + } } else { - onFail(baseBean.getStatus(), baseBean.getMsg()); - } - } else if (body instanceof CaiyunWeatherBaseBean) { - //彩云天气 - CaiyunWeatherBaseBean baseBean = (CaiyunWeatherBaseBean) response.body(); - String status = baseBean.getStatus(); - String api_status = baseBean.getApi_status(); - if ("ok".equals(status) && "active".equals(api_status)) { - onSuccess(response.body()); - } else { - onFail(1000, "彩云天气接口出错啦~~~"); - } - } else if (body instanceof ZhixinBaseBean) { - ZhixinBaseBean baseBean = (ZhixinBaseBean) response.body(); - if (TextUtils.isEmpty(baseBean.getStatus())) { - onSuccess(response.body()); - } else { - onFail(1000, baseBean.getStatus()); - } - } else if (body instanceof RollToolsBaseBean) { - RollToolsBaseBean baseBean = (RollToolsBaseBean) response.body(); - if (baseBean.getCode() == 1) { - onSuccess(response.body()); - } else { - onFail(baseBean.getCode(), baseBean.getMsg()); + onSuccess(body); } } else { - onSuccess(body); + onFail(response.code(), HttpErrorConstants.ERR_NETEXCEPTION_ERROR); } - } else { - onFail(response.code(), HttpErrorConstants.ERR_NETEXCEPTION_ERROR); + } catch (Exception e) { + onFail(HttpErrorConstants.ERR_HTTPRESPONSE_JSONPARSE_ERROR_CODE, HttpErrorConstants.ERR_HTTPRESPONSE_JSONPARSE_ERROR); } } diff --git a/app/src/main/java/com/maning/gankmm/http/callback/MyCallBack.java b/app/src/main/java/com/maning/gankmm/http/callback/MyCallBack.java deleted file mode 100644 index e296c40..0000000 --- a/app/src/main/java/com/maning/gankmm/http/callback/MyCallBack.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.maning.gankmm.http.callback; - -import java.util.List; - -/** - * Created by maning on 16/1/13. - *

- * 网络回调 - */ -public interface MyCallBack { - - /** - * 成功的回调对象 - * - * @param what - * @param result - */ - void onSuccess(int what, Object result) ; - - /** - * 成功的回调集合 - * - * @param what - * @param results - */ - void onSuccessList(int what, List results); - - /** - * 失败的回调 - * - * @param what - * @param result - */ - void onFail(int what, String result); - -} diff --git a/app/src/main/java/com/maning/gankmm/ui/activity/login/EditUserInfoActivity.java b/app/src/main/java/com/maning/gankmm/ui/activity/login/EditUserInfoActivity.java index b957db9..2ed803f 100644 --- a/app/src/main/java/com/maning/gankmm/ui/activity/login/EditUserInfoActivity.java +++ b/app/src/main/java/com/maning/gankmm/ui/activity/login/EditUserInfoActivity.java @@ -2,12 +2,13 @@ import android.content.Intent; import android.os.Bundle; -import androidx.appcompat.widget.Toolbar; import android.text.TextUtils; import android.view.MenuItem; import android.view.View; import android.widget.TextView; +import androidx.appcompat.widget.Toolbar; + import com.afollestad.materialdialogs.MaterialDialog; import com.bigkoo.pickerview.TimePickerView; import com.bumptech.glide.Glide; @@ -19,7 +20,6 @@ import com.luck.picture.lib.entity.LocalMedia; import com.maning.gankmm.R; import com.maning.gankmm.bean.mob.MobUserInfo; -import com.maning.gankmm.http.callback.MyCallBack; import com.maning.gankmm.skin.SkinManager; import com.maning.gankmm.ui.base.BaseActivity; import com.maning.gankmm.utils.AppDateMgr; @@ -261,54 +261,6 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) { } } - private MyCallBack httpCallBack = new MyCallBack() { - @Override - public void onSuccess(int what, Object result) { - dissmissProgressDialog(); - if (what == 0x001) { - //保存成功 - MySnackbar.makeSnackBarGreen(mToolbar, "数据更新成功"); - - } else if (what == 0x002) { - String userBaseInfo = (String) result; - if (TextUtils.isEmpty(userBaseInfo)) { - return; - } - KLog.i("userBaseInfo:" + userBaseInfo); - String[] values = userBaseInfo.split("&"); - if (values.length > 2) { - String sex = values[0]; - String birth = values[1]; - String signature = values[2]; - - //本地数据更新 -// MobUserInfo userCache = UserUtils.getUserCache(); -// userCache.setSex(sex); -// userCache.setBirth(birth); -// userCache.setSignature(signature); -// //保存用户信息 -// UserUtils.saveUserCache(userCache); - //刷新界面 - initDatas(); - } - - } - } - - @Override - public void onSuccessList(int what, List results) { - - } - - @Override - public void onFail(int what, String result) { - dissmissProgressDialog(); - if (what == 0x001) { - MySnackbar.makeSnackBarRed(mToolbar, result); - } - } - }; - private void updateUserInfo() { showProgressDialog("正在更新..."); //信息拼接: 性别&出生年月&个性签名 diff --git a/app/src/main/java/com/maning/gankmm/ui/activity/login/ForgetPsdActivity.java b/app/src/main/java/com/maning/gankmm/ui/activity/login/ForgetPsdActivity.java index 656deb5..03a104e 100644 --- a/app/src/main/java/com/maning/gankmm/ui/activity/login/ForgetPsdActivity.java +++ b/app/src/main/java/com/maning/gankmm/ui/activity/login/ForgetPsdActivity.java @@ -2,7 +2,6 @@ import android.os.Bundle; import android.os.CountDownTimer; -import androidx.appcompat.widget.Toolbar; import android.text.TextUtils; import android.view.MenuItem; import android.view.View; @@ -10,16 +9,14 @@ import android.widget.EditText; import android.widget.ImageView; +import androidx.appcompat.widget.Toolbar; + import com.maning.gankmm.R; -import com.maning.gankmm.app.MyApplication; -import com.maning.gankmm.http.callback.MyCallBack; import com.maning.gankmm.skin.SkinManager; import com.maning.gankmm.ui.base.BaseActivity; import com.maning.gankmm.utils.KeyboardUtils; import com.maning.gankmm.utils.MySnackbar; -import java.util.List; - import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; @@ -183,40 +180,4 @@ private void resetBtn() { mBtnGetCode.setBackgroundColor(mContext.getResources().getColor(R.color.main_color)); } - - private MyCallBack httpCallBack = new MyCallBack() { - @Override - public void onSuccess(int what, Object result) { - dissmissProgressDialog(); - if (what == 0x001) { - MySnackbar.makeSnackBarGreen(mToolbar, "密码追回的验证码已发送到您的邮箱,请到邮箱查看!"); - } else { - showProgressSuccess("密码修改成功,请返回重新登录!"); - - MyApplication.getHandler().postDelayed(new Runnable() { - @Override - public void run() { - onBackPressed(); - } - }, 500); - } - } - - @Override - public void onSuccessList(int what, List results) { - - } - - @Override - public void onFail(int what, String result) { - dissmissProgressDialog(); - MySnackbar.makeSnackBarRed(mToolbar, result); - if (what == 0x001) { - //重置按钮 - mMyCountDownTimer.cancel(); - mMyCountDownTimer.onFinish(); - } - } - }; - } diff --git a/app/src/main/java/com/maning/gankmm/ui/activity/login/RegisterActivity.java b/app/src/main/java/com/maning/gankmm/ui/activity/login/RegisterActivity.java index 4c39f6a..111d6fe 100644 --- a/app/src/main/java/com/maning/gankmm/ui/activity/login/RegisterActivity.java +++ b/app/src/main/java/com/maning/gankmm/ui/activity/login/RegisterActivity.java @@ -1,22 +1,19 @@ package com.maning.gankmm.ui.activity.login; import android.os.Bundle; -import androidx.appcompat.widget.Toolbar; import android.text.TextUtils; import android.view.MenuItem; import android.widget.EditText; +import androidx.appcompat.widget.Toolbar; + import com.maning.gankmm.R; -import com.maning.gankmm.app.MyApplication; -import com.maning.gankmm.http.callback.MyCallBack; import com.maning.gankmm.skin.SkinManager; import com.maning.gankmm.ui.base.BaseActivity; import com.maning.gankmm.utils.AppValidationMgr; import com.maning.gankmm.utils.KeyboardUtils; import com.maning.gankmm.utils.MySnackbar; -import java.util.List; - import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; @@ -104,33 +101,6 @@ public void btn_register() { } - private MyCallBack mMyCallBack = new MyCallBack() { - @Override - public void onSuccess(int what, Object result) { - dissmissProgressDialog(); - showProgressSuccess("注册成功,即将关闭页面!"); - - //关闭页面 - MyApplication.getHandler().postDelayed(new Runnable() { - @Override - public void run() { - closeActivity(); - } - }, 1000); - } - - @Override - public void onSuccessList(int what, List results) { - - } - - @Override - public void onFail(int what, String result) { - dissmissProgressDialog(); - MySnackbar.makeSnackBarRed(mToolbar, result); - } - }; - private void closeActivity() { this.finish(); } diff --git a/app/src/main/java/com/maning/gankmm/ui/activity/tools/CookListActivity.java b/app/src/main/java/com/maning/gankmm/ui/activity/tools/CookListActivity.java index 34b565f..a4235e3 100644 --- a/app/src/main/java/com/maning/gankmm/ui/activity/tools/CookListActivity.java +++ b/app/src/main/java/com/maning/gankmm/ui/activity/tools/CookListActivity.java @@ -2,25 +2,23 @@ import android.content.Intent; import android.os.Bundle; +import android.view.MenuItem; +import android.view.View; + +import androidx.appcompat.widget.Toolbar; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.MenuItem; -import android.view.View; import com.aspsine.swipetoloadlayout.OnLoadMoreListener; import com.aspsine.swipetoloadlayout.OnRefreshListener; import com.aspsine.swipetoloadlayout.SwipeToLoadLayout; import com.maning.gankmm.R; -import com.maning.gankmm.app.MyApplication; import com.maning.gankmm.bean.mob.MobCookCategoryEntity; import com.maning.gankmm.bean.mob.MobCookDetailEntity; -import com.maning.gankmm.http.callback.MyCallBack; import com.maning.gankmm.listeners.OnItemClickListener; import com.maning.gankmm.ui.adapter.RecycleCookDetailItemAdapter; import com.maning.gankmm.ui.base.BaseActivity; -import com.maning.gankmm.utils.MySnackbar; import java.util.ArrayList; import java.util.List; @@ -111,56 +109,6 @@ public boolean onOptionsItemSelected(MenuItem item) { return super.onOptionsItemSelected(item); } - private MyCallBack httpCallBack = new MyCallBack() { - @Override - public void onSuccess(int what, Object result) { - MobCookDetailEntity mobCookDetailEntity = (MobCookDetailEntity) result; - pageIndex++; - if (what == 0x001) { - mDatas.clear(); - mDatas = mobCookDetailEntity.getList(); - //延时展示刷新动画 - MyApplication.getHandler().postDelayed(new Runnable() { - @Override - public void run() { - mSwipeToLoadLayout.setRefreshing(false); - } - }, 1000); - } else { - List moreDatas = mobCookDetailEntity.getList(); - mDatas.addAll(moreDatas); - mSwipeToLoadLayout.setLoadingMore(false); - } - - //判断是不是还能加载更多 - if (mDatas.size() >= mobCookDetailEntity.getTotal()) { - mSwipeToLoadLayout.setLoadMoreEnabled(false); - } else { - mSwipeToLoadLayout.setLoadMoreEnabled(true); - } - - //刷新页面 - initAdapter(); - - } - - @Override - public void onSuccessList(int what, List results) { - - } - - @Override - public void onFail(int what, String result) { - if (what == 0x001) { - mSwipeToLoadLayout.setRefreshing(false); - } else { - mSwipeToLoadLayout.setLoadingMore(false); - } - MySnackbar.makeSnackBarBlack(mToolbar, result); - - } - }; - private void initAdapter() { if (mRecycleCookDetailItemAdapter == null) { mRecycleCookDetailItemAdapter = new RecycleCookDetailItemAdapter(mContext, mDatas); diff --git a/app/src/main/jniLibs/armeabi/libjcore112.so b/app/src/main/jniLibs/armeabi/libjcore112.so deleted file mode 100644 index b91b5e7..0000000 Binary files a/app/src/main/jniLibs/armeabi/libjcore112.so and /dev/null differ diff --git a/app/src/main/jniLibs/armeabi/libsecuritysdk-3.1.27.so b/app/src/main/jniLibs/armeabi/libsecuritysdk-3.1.27.so deleted file mode 100755 index 115c7da..0000000 Binary files a/app/src/main/jniLibs/armeabi/libsecuritysdk-3.1.27.so and /dev/null differ diff --git a/app/src/main/res/layout/activity_welcome.xml b/app/src/main/res/layout/activity_welcome.xml index 5959f97..1648bf2 100644 --- a/app/src/main/res/layout/activity_welcome.xml +++ b/app/src/main/res/layout/activity_welcome.xml @@ -18,7 +18,7 @@ android:layout_centerHorizontal="true" android:layout_marginBottom="24dp" android:gravity="center" - android:text="©2019 干货营 github.com/maning0303" + android:text="©2021 干货营 github.com/maning0303" android:textColor="@color/white" android:textSize="14sp" />