Skip to content

Commit 6b6cacd

Browse files
committed
v1.2加入jitpack库
1 parent f5981e3 commit 6b6cacd

14 files changed

Lines changed: 116 additions & 10 deletions

File tree

.idea/gradle.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ dependencies {
2929
})
3030
compile 'com.android.support:appcompat-v7:23.1.1'
3131
testCompile 'junit:junit:4.12'
32+
compile project(path: ':randomtextviewlibrary')
3233
}

app/src/main/java/com/example/liangmutian/randomtextview/MainActivity.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
package com.example.liangmutian.randomtextview;
22

3-
import android.support.v7.app.AppCompatActivity;
3+
4+
import android.app.Activity;
45
import android.os.Bundle;
56
import android.view.View;
67

7-
import com.example.liangmutian.randomtextview.view.RandomTextView;
8-
9-
import java.util.ArrayList;
10-
import java.util.Random;
8+
import com.example.liangmutian.randomtextviewlibrary.RandomTextView;
119

12-
public class MainActivity extends AppCompatActivity {
10+
public class MainActivity extends Activity {
1311

1412
private RandomTextView mRandomTextView;
1513
private int[] pianyiliang = new int[6];

app/src/main/res/layout/activity_main.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
tools:context="com.example.liangmutian.randomtextview.MainActivity">
1010

11-
<com.example.liangmutian.randomtextview.view.RandomTextView
11+
<com.example.liangmutian.randomtextviewlibrary.RandomTextView
1212
android:id="@+id/rtv"
1313
android:layout_width="wrap_content"
1414
android:layout_height="wrap_content"

randomtextviewlibrary/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

randomtextviewlibrary/build.gradle

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
apply plugin: 'com.android.library'
2+
3+
android {
4+
compileSdkVersion 23
5+
buildToolsVersion "23.0.2"
6+
7+
defaultConfig {
8+
minSdkVersion 15
9+
targetSdkVersion 23
10+
versionCode 1
11+
versionName "1.0"
12+
13+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14+
15+
}
16+
buildTypes {
17+
release {
18+
minifyEnabled false
19+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20+
}
21+
}
22+
}
23+
24+
dependencies {
25+
compile fileTree(dir: 'libs', include: ['*.jar'])
26+
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
27+
exclude group: 'com.android.support', module: 'support-annotations'
28+
})
29+
compile 'com.android.support:appcompat-v7:23.4.0'
30+
testCompile 'junit:junit:4.12'
31+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /Users/ex-liyongqiang001/Desktop/andriodstudio/adt-bundle-mac-x86_64-20140702/sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.example.liangmutian.randomtextviewlibrary;
2+
3+
import android.content.Context;
4+
import android.support.test.InstrumentationRegistry;
5+
import android.support.test.runner.AndroidJUnit4;
6+
7+
import org.junit.Test;
8+
import org.junit.runner.RunWith;
9+
10+
import static org.junit.Assert.*;
11+
12+
/**
13+
* Instrumentation test, which will execute on an Android device.
14+
*
15+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
16+
*/
17+
@RunWith(AndroidJUnit4.class)
18+
public class ExampleInstrumentedTest {
19+
@Test
20+
public void useAppContext() throws Exception {
21+
// Context of the app under test.
22+
Context appContext = InstrumentationRegistry.getTargetContext();
23+
24+
assertEquals("com.example.liangmutian.randomtextviewlibrary.test", appContext.getPackageName());
25+
}
26+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<manifest package="com.example.liangmutian.randomtextviewlibrary"
2+
xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<application android:allowBackup="true"
5+
android:label="@string/app_name"
6+
android:supportsRtl="true"
7+
>
8+
9+
</application>
10+
11+
</manifest>

0 commit comments

Comments
 (0)