Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion MyDaoGenerator/MyDaoGenerator.iml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/classes/main" />
<output-test url="file://$MODULE_DIR$/build/classes/test" />
<exclude-output />
Expand Down
Binary file not shown.
28 changes: 15 additions & 13 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.2.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.2.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/23.2.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.github.zhaokaiqiang.klog/library/1.5.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.makeramen/roundedimageview/2.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.squareup.leakcanary/leakcanary-android/1.4-beta1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/de.hdodenhof/circleimageview/1.3.0/jars" />
Expand All @@ -89,24 +90,25 @@
</content>
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="support-v4-23.2.0" level="project" />
<orderEntry type="library" exported="" name="greendao-1.3.7" level="project" />
<orderEntry type="library" exported="" name="leakcanary-analyzer-1.4-beta1" level="project" />
<orderEntry type="library" exported="" name="butterknife-7.0.1" level="project" />
<orderEntry type="library" exported="" name="circleimageview-1.3.0" level="project" />
<orderEntry type="library" exported="" name="android-async-http-1.4.9" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.4.0" level="project" />
<orderEntry type="library" exported="" name="okio-1.6.0" level="project" />
<orderEntry type="library" exported="" name="gson-2.4" level="project" />
<orderEntry type="library" exported="" name="leakcanary-analyzer-1.4-beta1" level="project" />
<orderEntry type="library" exported="" name="haha-2.0.2" level="project" />
<orderEntry type="library" exported="" name="greendao-1.3.7" level="project" />
<orderEntry type="library" exported="" name="okhttp-2.5.0" level="project" />
<orderEntry type="library" exported="" name="universal-image-loader-1.9.3" level="project" />
<orderEntry type="library" exported="" name="roundedimageview-2.0.1" level="project" />
<orderEntry type="library" exported="" name="circleimageview-1.3.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.2.0" level="project" />
<orderEntry type="library" exported="" name="library-1.5.0" level="project" />
<orderEntry type="library" exported="" name="leakcanary-android-1.4-beta1" level="project" />
<orderEntry type="library" exported="" name="animated-vector-drawable-23.2.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.2.0" level="project" />
<orderEntry type="library" exported="" name="haha-2.0.2" level="project" />
<orderEntry type="library" exported="" name="httpclient-4.3.6" level="project" />
<orderEntry type="library" exported="" name="okhttp-2.5.0" level="project" />
<orderEntry type="library" exported="" name="support-vector-drawable-23.2.0" level="project" />
<orderEntry type="library" exported="" name="leakcanary-watcher-1.4-beta1" level="project" />
<orderEntry type="library" exported="" name="okio-1.6.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.2.0" level="project" />
<orderEntry type="library" exported="" name="gson-2.4" level="project" />
<orderEntry type="library" exported="" name="universal-image-loader-1.9.3" level="project" />
<orderEntry type="library" exported="" name="animated-vector-drawable-23.2.0" level="project" />
<orderEntry type="library" exported="" name="support-vector-drawable-23.2.0" level="project" />
<orderEntry type="library" exported="" name="android-async-http-1.4.9" level="project" />
</component>
</module>
3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ android {
minSdkVersion 19
targetSdkVersion 23
versionCode 3
versionName "1.3"
versionName "1.4"
}
buildTypes {
release {
Expand All @@ -37,6 +37,7 @@ dependencies {
compile 'com.google.code.gson:gson:2.4'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:support-v4:23.2.0'
compile 'com.github.zhaokaiqiang.klog:library:1.5.0'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.util.DisplayMetrics;

import com.hunter.fastandroid.BuildConfig;
import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiscCache;
import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator;
import com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache;
Expand All @@ -13,6 +15,7 @@
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.core.assist.QueueProcessingType;
import com.nostra13.universalimageloader.utils.StorageUtils;
import com.socks.library.KLog;
import com.squareup.leakcanary.LeakCanary;

import java.io.File;
Expand Down Expand Up @@ -49,6 +52,9 @@ public void onCreate() {

initImageLoader();
initScreenSize();

//BUG调试信息
KLog.init(BuildConfig.DEBUG);
}

/**
Expand Down
18 changes: 12 additions & 6 deletions app/src/main/java/com/hunter/fastandroid/base/BaseActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

public abstract class BaseActivity extends FragmentActivity implements IBaseView {
private ProgressDialog mProgressDialog;
FragmentManager fragmentManager;
private FragmentManager mFragmentManager;
private Toast mToast;

/**
* 初始化布局
Expand Down Expand Up @@ -141,9 +142,14 @@ public void showToast(int resId) {

@Override
public void showToast(String msg) {
if (!isFinishing()) {
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
if (mToast == null) {
mToast = Toast.makeText(this,
msg,
Toast.LENGTH_SHORT);
} else {
mToast.setText(msg);
}
mToast.show();
}

@Override
Expand All @@ -163,10 +169,10 @@ public void close() {
* @return
*/
public FragmentManager getBaseFragmentManager() {
if (fragmentManager == null) {
fragmentManager = getSupportFragmentManager();
if (mFragmentManager == null) {
mFragmentManager = getSupportFragmentManager();
}
return fragmentManager;
return mFragmentManager;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import android.content.Context;

import com.hunter.fastandroid.utils.Logger;
import com.hunter.fastandroid.utils.NetUtils;
import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.AsyncHttpResponseHandler;
import com.loopj.android.http.RequestParams;
import com.socks.library.KLog;

import cz.msebera.android.httpclient.HttpEntity;
import java.nio.charset.StandardCharsets;
Expand Down Expand Up @@ -192,11 +192,11 @@ void sendRequest(Context context, int type,
}

if (requestParams != null) {
Logger.i(context, "HTTP-Request,tools:Async-Http");
Logger.i(context, "HTTP-Request,url:" + url);
Logger.i(context, "HTTP-Request,mothed:" + (type == GET ? "GET" : "POST"));
Logger.i(context, "HTTP-Request,header:" + baseHeader.toString());
Logger.i(context, "HTTP-Request,params:" + requestParams.toString());
KLog.i("HTTP-Request,tools:Async-Http");
KLog.i("HTTP-Request,url:" + url);
KLog.i("HTTP-Request,mothed:" + (type == GET ? "GET" : "POST"));
KLog.i("HTTP-Request,header:" + baseHeader.toString());
KLog.i("HTTP-Request,params:" + requestParams.toString());

// 根据传入类型调用不同请求方法,可自行扩展
// 传入Context以便与生命周期联动
Expand All @@ -215,12 +215,12 @@ void sendRequest(Context context, int type,
break;
}
} else if (entity != null) {
Logger.i(context, "HTTP-Request,tools:Async-Http");
Logger.i(context, "HTTP-Request,url:" + url);
Logger.i(context, "HTTP-Request,mothed:" + (type == GET ? "GET" : "POST"));
Logger.i(context, "HTTP-Request,header:" + baseHeader.toString());
Logger.i(context, "HTTP-Request,params:" + entity.toString());
Logger.i(context, "HTTP-Request,content-Type:" + contentType);
KLog.i( "HTTP-Request,tools:Async-Http");
KLog.i( "HTTP-Request,url:" + url);
KLog.i( "HTTP-Request,mothed:" + (type == GET ? "GET" : "POST"));
KLog.i( "HTTP-Request,header:" + baseHeader.toString());
KLog.i( "HTTP-Request,params:" + entity.toString());
KLog.i( "HTTP-Request,content-Type:" + contentType);

// 根据传入类型调用不同请求方法,可自行扩展
// 传入Context以便与生命周期联动
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.hunter.fastandroid.net;

import com.hunter.fastandroid.utils.Logger;
import com.loopj.android.http.TextHttpResponseHandler;
import com.socks.library.KLog;

import cz.msebera.android.httpclient.Header;

Expand All @@ -25,7 +25,7 @@ public void onFailure(int statusCode, Header[] headers, String responseString, T

@Override
public void onSuccess(int statusCode, Header[] headers, String responseString) {
Logger.e("HTTP-Response,data:" + responseString);
KLog.e("HTTP-Response,data:" + responseString);

mTransactionListener.onSuccess(responseString);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.hunter.fastandroid.vo.response.QueryResult;
import com.hunter.fastandroid.vo.response.ResultInfo;
import com.hunter.fastandroid.vo.response.UserInfo;
import com.socks.library.KLog;

import butterknife.Bind;

Expand All @@ -44,6 +45,13 @@ public void initContentView() {
public void initView() {
titleBar.setTitle("测试页面");

KLog.v("KLog测试");
KLog.w("KLog测试");
KLog.i("KLog测试");
KLog.d("KLog测试");
KLog.e("KLog测试");
KLog.a("KLog测试");

btnSubmit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.android.tools.build:gradle:1.5.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Sep 21 18:45:04 CST 2015
#Wed Jul 27 16:46:03 CST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip