forked from Sunzxyong/Tiny
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
郑晓勇
committed
Apr 23, 2017
1 parent
bd434cd
commit 57ab135
Showing
123 changed files
with
6,853 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,8 @@ captures/ | |
|
||
# Intellij | ||
*.iml | ||
.idea/workspace.xml | ||
.idea/ | ||
|
||
# Keystore files | ||
*.jks | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 24 | ||
buildToolsVersion "24.0.0" | ||
defaultConfig { | ||
applicationId "com.zxy.tiny.test" | ||
minSdkVersion 14 | ||
targetSdkVersion 24 | ||
versionCode 1 | ||
versionName "1.0" | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
|
||
aaptOptions { | ||
cruncherEnabled false | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(include: ['*.jar'], dir: 'libs') | ||
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { | ||
exclude group: 'com.android.support', module: 'support-annotations' | ||
}) | ||
compile 'com.android.support:appcompat-v7:24.0.0' | ||
testCompile 'junit:junit:4.12' | ||
compile project(':tiny') | ||
compile 'com.zxy.android:recovery:0.1.4' | ||
compile 'com.android.support:design:24.0.0' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in /Users/Sunzxyong/Library/Android/sdk/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} |
26 changes: 26 additions & 0 deletions
26
app/src/androidTest/java/com/zxy/tiny/test/ExampleInstrumentedTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.zxy.tiny.test; | ||
|
||
import android.content.Context; | ||
import android.support.test.InstrumentationRegistry; | ||
import android.support.test.runner.AndroidJUnit4; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* Instrumentation test, which will execute on an Android device. | ||
* | ||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
*/ | ||
@RunWith(AndroidJUnit4.class) | ||
public class ExampleInstrumentedTest { | ||
@Test | ||
public void useAppContext() throws Exception { | ||
// Context of the app under test. | ||
Context appContext = InstrumentationRegistry.getTargetContext(); | ||
|
||
assertEquals("com.zxy.tiny.test", appContext.getPackageName()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.zxy.tiny.test"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET"/> | ||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> | ||
|
||
<application | ||
android:name=".App" | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<activity android:name=".MainActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
|
||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
</activity> | ||
|
||
<activity | ||
android:name=".BitmapCompressTestActivity" | ||
android:label="BitmapCompress" | ||
android:screenOrientation="portrait"> | ||
</activity> | ||
<activity | ||
android:name=".FileCompressTestActivity" | ||
android:label="FileCompress" | ||
android:screenOrientation="portrait"> | ||
</activity> | ||
<activity | ||
android:name=".FileWithReturnBitmapCompressTestActivity" | ||
android:label="FileCompressReturnBitmap" | ||
android:screenOrientation="portrait"> | ||
</activity> | ||
<activity | ||
android:name=".BatchBitmapCompressTestActivity" | ||
android:label="BatchBitmapCompress" | ||
android:screenOrientation="portrait"> | ||
</activity> | ||
<activity | ||
android:name=".BatchFileCompressTestActivity" | ||
android:label="BatchFileCompress" | ||
android:screenOrientation="portrait"> | ||
</activity> | ||
<activity | ||
android:name=".BatchFileWithReturnBitmapCompressTestActivity" | ||
android:label="BatchFileCompressReturnBitmap" | ||
android:screenOrientation="portrait"> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.zxy.tiny.test; | ||
|
||
import android.app.Application; | ||
import android.util.Log; | ||
|
||
import com.zxy.recovery.callback.RecoveryCallback; | ||
import com.zxy.recovery.core.Recovery; | ||
import com.zxy.tiny.Tiny; | ||
|
||
/** | ||
* Created by zhengxiaoyong on 2017/3/14. | ||
*/ | ||
public class App extends Application { | ||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
Tiny.getInstance().debug(true).init(this); | ||
|
||
Recovery.getInstance().debug(true).callback(new RecoveryCallback() { | ||
@Override | ||
public void stackTrace(String stackTrace) { | ||
Log.e("zxy", "stackTrace:" + stackTrace); | ||
} | ||
|
||
@Override | ||
public void cause(String cause) { | ||
Log.e("zxy", "cause:" + cause); | ||
} | ||
|
||
@Override | ||
public void exception(String throwExceptionType, String throwClassName, String throwMethodName, int throwLineNumber) { | ||
|
||
} | ||
|
||
@Override | ||
public void throwable(Throwable throwable) { | ||
|
||
} | ||
}).init(this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.zxy.tiny.test; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.os.PersistableBundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
|
||
/** | ||
* Created by zhengxiaoyong on 2017/4/2. | ||
*/ | ||
public class BaseActivity extends AppCompatActivity { | ||
|
||
//take the initiative to invoke gc to release the memory to avoid oom when load big origin bitmap. | ||
|
||
@Override | ||
public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) { | ||
super.onCreate(savedInstanceState, persistentState); | ||
Runtime.getRuntime().gc(); | ||
|
||
} | ||
|
||
void startActivity(Class clazz) { | ||
startActivity(new Intent(this, clazz)); | ||
} | ||
|
||
@Override | ||
protected void onDestroy() { | ||
super.onDestroy(); | ||
Runtime.getRuntime().gc(); | ||
} | ||
} |
Oops, something went wrong.