Skip to content

Commit

Permalink
library
Browse files Browse the repository at this point in the history
  • Loading branch information
mengxn committed Mar 27, 2019
1 parent 67abcac commit 47c4cd6
Show file tree
Hide file tree
Showing 17 changed files with 131 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ slideView.addOption(deleteOption);
#### 方式二

``` xml
<me.codego.example.SlideView
<me.codego.slideview.SlideView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
Expand Down Expand Up @@ -61,7 +61,7 @@ slideView.addOption(deleteOption);

</RelativeLayout>

</me.codego.example.SlideView>
</me.codego.slideview.SlideView>
```

### TODO
Expand Down
2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ dependencies {
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'

implementation project(':slideview')
}
2 changes: 2 additions & 0 deletions app/src/main/java/me/codego/example/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import java.util.ArrayList;
import java.util.List;

import me.codego.slideview.SlideView;

public class MainActivity extends AppCompatActivity {

private RecyclerView mRecyclerView;
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/item_main_custom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<me.codego.example.SlideView
<me.codego.slideview.SlideView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
Expand Down Expand Up @@ -54,4 +54,4 @@

</RelativeLayout>

</me.codego.example.SlideView>
</me.codego.slideview.SlideView>
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'

// 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 @@
#Thu Jan 10 15:03:39 CST 2019
#Wed Mar 27 09:44:54 CST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include ':app'
include ':app', ':slideview'
1 change: 1 addition & 0 deletions slideview/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
36 changes: 36 additions & 0 deletions slideview/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 28



defaultConfig {
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.android.support:appcompat-v7:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

apply from: "https://raw.githubusercontent.com/mengxn/android-library-publish-to-jcenter/master/bintrayUpload.gradle"
21 changes: 21 additions & 0 deletions slideview/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# 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 *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
10 changes: 10 additions & 0 deletions slideview/project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#project
project.name=SlideView
project.groupId=me.codego
project.artifactId=slideview
project.packaging=aar
project.siteUrl=https://github.com/mengxn/SlideView
project.gitUrl=https://github.com/mengxn/SlideView.git

#javadoc
javadoc.name=SlideView
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package me.codego.slideview;

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.*;

/**
* Instrumented 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() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("me.codego.slideview.test", appContext.getPackageName());
}
}
2 changes: 2 additions & 0 deletions slideview/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="me.codego.slideview" />
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.codego.example;
package me.codego.slideview;

import android.content.Context;
import android.graphics.Color;
Expand Down
3 changes: 3 additions & 0 deletions slideview/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">slideview</string>
</resources>
17 changes: 17 additions & 0 deletions slideview/src/test/java/me/codego/slideview/ExampleUnitTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package me.codego.slideview;

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() {
assertEquals(4, 2 + 2);
}
}

0 comments on commit 47c4cd6

Please sign in to comment.