Skip to content

Commit

Permalink
commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
郑晓勇 committed Apr 23, 2017
1 parent bd434cd commit 57ab135
Show file tree
Hide file tree
Showing 123 changed files with 6,853 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ captures/

# Intellij
*.iml
.idea/workspace.xml
.idea/

# Keystore files
*.jks

1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
36 changes: 36 additions & 0 deletions app/build.gradle
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'
}
17 changes: 17 additions & 0 deletions app/proguard-rules.pro
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 *;
#}
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());
}
}
56 changes: 56 additions & 0 deletions app/src/main/AndroidManifest.xml
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>
Binary file added app/src/main/assets/enjoy.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/test-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/test-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/test-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/test-4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/test-5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/test-6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/test-7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/test_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/test_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/test_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/test_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions app/src/main/java/com/zxy/tiny/test/App.java
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);
}
}
31 changes: 31 additions & 0 deletions app/src/main/java/com/zxy/tiny/test/BaseActivity.java
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();
}
}
Loading

0 comments on commit 57ab135

Please sign in to comment.