1、fix splashscreen test

2、fix multidex lib
3、add stetho
This commit is contained in:
CsHeng
2017-05-03 16:14:49 +08:00
parent b00b791107
commit c8e01182f4
10 changed files with 43 additions and 87 deletions

View File

@ -11,10 +11,12 @@ import android.support.v4.util.ArrayMap;
import android.util.Log;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.stetho.Stetho;
import com.gh.common.util.DataUtils;
import com.gh.common.util.HttpsUtils;
import com.gh.common.util.TokenUtils;
import com.gh.common.util.Utils;
import com.gh.gamecenter.BuildConfig;
import com.umeng.message.IUmengRegisterCallback;
import com.umeng.message.PushAgent;
import com.umeng.message.UTrack;
@ -109,6 +111,10 @@ public class AppController extends Application {
Thread.setDefaultUncaughtExceptionHandler(uncaHandler);
mInstance = this;
if (BuildConfig.DEBUG) {
Stetho.initializeWithDefaults(this);
}
// 注册push服务注册成功后会向GHPushMessageReceiver发送广播
// 可以从GHPushMessageReceiver的onCommandResult方法中MiPushCommandMessage对象参数中获取注册信息
if (shouldInit()) {

View File

@ -270,7 +270,7 @@ public class SplashScreenActivity extends BaseActivity {
@Override
public Object instantiateItem(ViewGroup container, int position) {
View view = View.inflate(container.getContext(), R.layout.splash_guide_item, container);
View view = View.inflate(container.getContext(), R.layout.splash_guide_item, null);
ImageView ivImage = (ImageView) view.findViewById(R.id.splsh_guide_iv_image);
ivImage.setImageResource(pics[position]);
if (position == pics.length - 1) {
@ -283,6 +283,7 @@ public class SplashScreenActivity extends BaseActivity {
});
}
container.addView(view);
return view;
}

View File

@ -1,83 +1,44 @@
package com.gh.gamecenter;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.*;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.*;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.*;
import android.provider.MediaStore;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewTreeObserver;
import android.view.Window;
import android.view.*;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.*;
import butterknife.BindView;
import butterknife.OnClick;
import com.gh.base.BaseActivity;
import com.gh.common.constant.Config;
import com.gh.common.util.DialogUtils;
import com.gh.common.util.DisplayUtils;
import com.gh.common.util.FileUtils;
import com.gh.common.util.PackageUtils;
import com.gh.common.util.TokenUtils;
import com.gh.common.util.Utils;
import com.gh.common.util.*;
import com.gh.gamecenter.entity.InstallGameEntity;
import com.gh.gamecenter.retrofit.JSONObjectResponse;
import com.gh.gamecenter.retrofit.RetrofitManager;
import com.gh.gamecenter.suggest.SuggestPicAdapter;
import com.gh.gamecenter.suggest.SuggestSelectGameAdapter;
import com.gh.gamecenter.suggest.SuggestTypeAdapter;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import butterknife.BindView;
import butterknife.OnClick;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import com.gh.gamecenter.suggest.*;
import okhttp3.*;
import org.json.*;
import retrofit2.HttpException;
import rx.Observable;
import rx.Observer;
import rx.Subscriber;
import rx.*;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Func1;
import rx.schedulers.Schedulers;
import java.io.*;
import java.net.HttpURLConnection;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Created by khy on 2017/3/31.
*/
@ -501,7 +462,6 @@ public class SuggestionActivity extends BaseActivity implements SuggestTypeAdapt
if (postDialog != null) {
postDialog.dismiss();
}
Utils.log("======onResponse" + response.toString());
if (response.length() != 0) {
try {
if ("ok".equals(response.getString("status"))) {

View File

@ -67,7 +67,6 @@ public class CommentFragmentAdapter extends BaseRecyclerAdapter<ViewHolder> {
@Override
public void onResponse(List<MessageCommentEntity> response) {
super.onResponse(response);
Utils.log("======onResponse" + response.size());
if (response.size() > 0) {
for (MessageCommentEntity commentEntity : response) {
if (!commentEntity.isReceive()) {

View File

@ -5,19 +5,9 @@ import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerView.ViewHolder;
import android.text.Html;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.gh.common.util.CommentUtils;
import com.gh.common.util.QQUtils;
import com.gh.common.util.TokenUtils;
import com.gh.common.util.Utils;
import com.gh.gamecenter.GameDetailActivity;
import com.gh.gamecenter.NewsDetailActivity;
import com.gh.gamecenter.R;
import com.gh.gamecenter.SubjectActivity;
import com.gh.gamecenter.WebActivity;
import android.view.*;
import com.gh.common.util.*;
import com.gh.gamecenter.*;
import com.gh.gamecenter.adapter.BaseRecyclerAdapter;
import com.gh.gamecenter.adapter.viewholder.FooterViewHolder;
import com.gh.gamecenter.db.KeFuMarkReadDao;
@ -30,21 +20,16 @@ import com.gh.gamecenter.listener.OnCallBackListener;
import com.gh.gamecenter.retrofit.Response;
import com.gh.gamecenter.retrofit.RetrofitManager;
import com.google.gson.Gson;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import de.greenrobot.event.EventBus;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import okhttp3.*;
import retrofit2.HttpException;
import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Func1;
import rx.schedulers.Schedulers;
import java.util.*;
/**
* Created by khy on 2017/4/10.
* 消息-客服适配器
@ -97,7 +82,6 @@ public class KeFuFragmentAdapter extends BaseRecyclerAdapter<ViewHolder> {
@Override
public void onResponse(List<MessageKeFuEntity> response) {
super.onResponse(response);
Utils.log("======onResponse" + response.size());
if (response.size() > 0) {
for (MessageKeFuEntity keFuEntity : response) {
if (!keFuEntity.isReceive()) {

View File

@ -81,7 +81,6 @@ public class NoticeFragmentAdapter extends BaseRecyclerAdapter<ViewHolder> {
@Override
public void onResponse(List<MessageNoticeEntity> response) {
super.onResponse(response);
Utils.log("======onResponse" + response.size());
if (response.size() > 0) {
for (MessageNoticeEntity noticeEntity : response) {
if (!noticeEntity.isReceive()) {

View File

@ -1,5 +1,6 @@
package com.gh.gamecenter.retrofit;
import com.facebook.stetho.okhttp3.StethoInterceptor;
import com.gh.common.constant.Config;
import com.gh.gamecenter.BuildConfig;
import okhttp3.Cache;
@ -36,6 +37,7 @@ public class RetrofitManager {
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
interceptor.setLevel(Level.BASIC);
builder.addNetworkInterceptor(interceptor);
builder.addNetworkInterceptor(new StethoInterceptor());
}
final OkHttpClient okHttpClient = builder