Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Bter committed Feb 19, 2017
1 parent 6e37fae commit 95ada9a
Show file tree
Hide file tree
Showing 16 changed files with 166 additions and 4 deletions.
1 change: 1 addition & 0 deletions .idea/gradle.xml

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

1 change: 1 addition & 0 deletions .idea/modules.xml

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

6 changes: 6 additions & 0 deletions .idea/vcs.xml

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

2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ dependencies {
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
testCompile 'junit:junit:4.12'
compile 'com.github.traex.rippleeffect:library:1.3'
compile project(':mylibrary')
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.example.qiqian.myapplication2;

/**
* Created by qiqian on 2017/2/18.
*/

public interface BaseInterface {
public static String TAG = BaseInterface.class.getSimpleName();

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.example.qiqian.myapplication2;

import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
Expand All @@ -10,10 +11,11 @@
import android.view.Menu;
import android.view.MenuItem;

import org.xmlpull.v1.XmlPullParser;
import com.example.qiqian.mylibrary.TestJava;

public class MainActivity extends AppCompatActivity {
private View view;
public class MainActivity extends AppCompatActivity implements BaseInterface{
private View mView;
private String name;

// Used to load the 'native-lib' library on application startup.
static {
Expand All @@ -39,6 +41,20 @@ public void onClick(View view) {
// Example of a call to a native method
TextView tv = (TextView) findViewById(R.id.sample_text);
tv.setText(stringFromJNI());

initView();
}

private void initView() {
mView = null;

MyTestCalss testCalss = new MyTestCalss();
testCalss.getValues();

for (int step = 0; step < 10; step++) {
Log.i(TAG, "initView: "+step);
}
TestJava testJava = new TestJava();
}

@Override
Expand Down
14 changes: 14 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'

classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}

apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
}

allprojects {
Expand All @@ -21,3 +25,13 @@ allprojects {
task clean(type: Delete) {
delete rootProject.buildDir
}

/*
task hollow << {
println "Hollow Word"
ext.myName = true;
}
task task2(dependsOn : hollow) << {
println "I'm gradle "+hollow.myName
}*/
1 change: 1 addition & 0 deletions mylibrary/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
31 changes: 31 additions & 0 deletions mylibrary/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 24
buildToolsVersion "25.0.2"

defaultConfig {
minSdkVersion 9
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'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
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.2.1'
testCompile 'junit:junit:4.12'
}
17 changes: 17 additions & 0 deletions mylibrary/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 D:\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.example.qiqian.mylibrary;

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.example.qiqian.mylibrary.test", appContext.getPackageName());
}
}
9 changes: 9 additions & 0 deletions mylibrary/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.qiqian.mylibrary">

<application android:allowBackup="true" android:label="@string/app_name"
android:supportsRtl="true">

</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.example.qiqian.mylibrary;

/**
* Created by qiqian on 2017/2/19.
*/

public class TestJava {
}
3 changes: 3 additions & 0 deletions mylibrary/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">My Library</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.example.qiqian.mylibrary;

import org.junit.Test;

import static org.junit.Assert.*;

/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include ':app'
include ':app', ':mylibrary'

0 comments on commit 95ada9a

Please sign in to comment.