Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 4597e65

Browse files
committed
Split library
1 parent 9b1272a commit 4597e65

File tree

57 files changed

+406
-131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+406
-131
lines changed

example/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ apply plugin: 'android'
22

33
dependencies {
44
compile 'com.android.support:appcompat-v7:19.1.+'
5-
compile project(":library")
5+
compile project(':lib-core')
6+
compile project(':lib-manipulation')
67
}
78

89
android {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

library/src/main/java/com/nhaarman/listviewanimations/ArrayAdapter.java renamed to lib-core/src/main/java/com/nhaarman/listviewanimations/ArrayAdapter.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
import android.widget.BaseAdapter;
1919

20-
import com.nhaarman.listviewanimations.itemmanipulation.AnimateAdditionAdapter;
2120
import com.nhaarman.listviewanimations.widget.DynamicListView;
2221

2322
import android.support.annotation.NonNull;
@@ -33,10 +32,10 @@
3332

3433
/**
3534
* A {@code true} {@link ArrayList} adapter providing access to all ArrayList methods. Also implements {@link DynamicListView.Swappable} for easy object swapping, and {@link
36-
* AnimateAdditionAdapter.Insertable} for inserting objects.
35+
* Insertable} for inserting objects.
3736
*/
3837
@SuppressWarnings("UnusedDeclaration")
39-
public abstract class ArrayAdapter<T> extends BaseAdapter implements List<T>, DynamicListView.Swappable, AnimateAdditionAdapter.Insertable<T> {
38+
public abstract class ArrayAdapter<T> extends BaseAdapter implements List<T>, DynamicListView.Swappable, Insertable<T> {
4039

4140
@NonNull
4241
private final List<T> mItems;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.nhaarman.listviewanimations;
2+
3+
import android.support.annotation.NonNull;
4+
5+
/**
6+
* An interface for inserting items at a certain index.
7+
*/
8+
public interface Insertable<T> {
9+
10+
/**
11+
* Will be called to insert given {@code item} at given {@code index} in the list.
12+
*
13+
* @param index the index the new item should be inserted at
14+
* @param item the item to insert
15+
*/
16+
void add(int index, @NonNull T item);
17+
}

lib-manipulation/build.gradle

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
apply plugin: 'android-library'
2+
apply plugin: 'github-pages'
3+
4+
dependencies {
5+
compile project(':lib-core')
6+
7+
compile 'com.nineoldandroids:library:2.4.0'
8+
compile 'com.android.support:support-annotations:+'
9+
10+
/* Test libraries */
11+
androidTestCompile ('org.mockito:mockito-core:1.9.5') { exclude group: 'org.hamcrest' }
12+
// androidTestCompile ('com.google.dexmaker:dexmaker-mockito:1.0') { exclude group: 'org.hamcrest' }
13+
androidTestCompile ('junit:junit:4.11') { exclude group: 'org.hamcrest' }
14+
androidTestCompile 'org.hamcrest:hamcrest-all:1.3'
15+
16+
/* Custom compiled dexmaker. Switch back to the original one once fix https://code.google.com/p/dexmaker/issues/detail?id=28 has been applied */
17+
androidTestCompile files('libs/dexmaker-1.1.jar')
18+
androidTestCompile files('libs/dexmaker-mockito-1.1-custom.jar')
19+
}
20+
21+
android {
22+
compileSdkVersion 19
23+
buildToolsVersion '19.1.0'
24+
25+
defaultConfig {
26+
minSdkVersion 8
27+
targetSdkVersion 19
28+
versionName project.VERSION_NAME
29+
versionCode Integer.parseInt(new Date().format('yyyyMMddHH'))
30+
}
31+
32+
compileOptions {
33+
sourceCompatibility JavaVersion.VERSION_1_7
34+
targetCompatibility JavaVersion.VERSION_1_7
35+
}
36+
37+
packagingOptions {
38+
exclude 'LICENSE.txt'
39+
}
40+
41+
lintOptions {
42+
textReport true
43+
textOutput 'stdout'
44+
warningsAsErrors true
45+
}
46+
}
47+
48+
import org.ajoberstar.grgit.*
49+
def repo = Grgit.open(".")
50+
51+
def branch = repo.branch.current.name
52+
if(project.hasProperty('BRANCH')) {
53+
branch = BRANCH
54+
}
55+
56+
githubPages {
57+
58+
repoUri = 'https://github.com/nhaarman/ListViewAnimations.git'
59+
commitMessage = 'Updated docs for branch ' + branch
60+
pages {
61+
from './build/docs/'
62+
}
63+
credentials {
64+
username = System.getenv('GH_TOKEN_LVA')
65+
password = '\n'
66+
}
67+
}
68+
69+
apply from: '../maven_push.gradle'
70+
apply from: '../generateJavadoc.gradle'

lib-manipulation/gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
POM_NAME=ListViewAnimations Library
2+
POM_ARTIFACT_ID=lib-manipulation
3+
POM_PACKAGING=aar

lib-manipulation/lint.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<lint>
3+
</lint>

lib-manipulation/pom.xml

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<parent>
6+
<groupId>com.nhaarman.listviewanimations</groupId>
7+
<artifactId>parent</artifactId>
8+
<version>3.0.0-SNAPSHOT</version>
9+
</parent>
10+
11+
<artifactId>lib-manipulation</artifactId>
12+
<packaging>apklib</packaging>
13+
14+
<name>ListViewAnimations (Library)</name>
15+
16+
<dependencies>
17+
<!-- Android -->
18+
<dependency>
19+
<groupId>com.google.android</groupId>
20+
<artifactId>android</artifactId>
21+
<scope>provided</scope>
22+
</dependency>
23+
24+
<!-- NineOldAndroids -->
25+
<dependency>
26+
<groupId>com.nineoldandroids</groupId>
27+
<artifactId>library</artifactId>
28+
</dependency>
29+
30+
<!-- Testing -->
31+
<dependency>
32+
<groupId>junit</groupId>
33+
<artifactId>junit</artifactId>
34+
<scope>test</scope>
35+
</dependency>
36+
<dependency>
37+
<groupId>org.hamcrest</groupId>
38+
<artifactId>hamcrest-all</artifactId>
39+
<scope>test</scope>
40+
</dependency>
41+
<dependency>
42+
<groupId>org.mockito</groupId>
43+
<artifactId>mockito-core</artifactId>
44+
<scope>test</scope>
45+
</dependency>
46+
</dependencies>
47+
48+
<build>
49+
<testSourceDirectory>src/androidTest/java</testSourceDirectory>
50+
<plugins>
51+
<plugin>
52+
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
53+
<artifactId>android-maven-plugin</artifactId>
54+
<extensions>true</extensions>
55+
<configuration>
56+
<androidManifestFile>${project.basedir}/src/main/AndroidManifest.xml</androidManifestFile>
57+
</configuration>
58+
</plugin>
59+
60+
<plugin>
61+
<groupId>org.codehaus.mojo</groupId>
62+
<artifactId>build-helper-maven-plugin</artifactId>
63+
<executions>
64+
<execution>
65+
<phase>package</phase>
66+
<goals>
67+
<goal>attach-artifact</goal>
68+
</goals>
69+
<configuration>
70+
<artifacts>
71+
<artifact>
72+
<type>jar</type>
73+
<file>${project.build.directory}/${project.build.finalName}.jar</file>
74+
</artifact>
75+
</artifacts>
76+
</configuration>
77+
</execution>
78+
</executions>
79+
</plugin>
80+
81+
<plugin>
82+
<groupId>org.apache.maven.plugins</groupId>
83+
<artifactId>maven-source-plugin</artifactId>
84+
<executions>
85+
<execution>
86+
<id>attach-sources</id>
87+
<goals>
88+
<goal>jar</goal>
89+
</goals>
90+
</execution>
91+
</executions>
92+
</plugin>
93+
94+
<plugin>
95+
<groupId>org.apache.maven.plugins</groupId>
96+
<artifactId>maven-javadoc-plugin</artifactId>
97+
<executions>
98+
<execution>
99+
<id>attach-javadocs</id>
100+
<goals>
101+
<goal>jar</goal>
102+
</goals>
103+
</execution>
104+
</executions>
105+
</plugin>
106+
107+
<plugin>
108+
<groupId>org.apache.maven.plugins</groupId>
109+
<artifactId>maven-release-plugin</artifactId>
110+
</plugin>
111+
</plugins>
112+
<pluginManagement>
113+
<plugins>
114+
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on
115+
the Maven build itself. -->
116+
<plugin>
117+
<groupId>org.eclipse.m2e</groupId>
118+
<artifactId>lifecycle-mapping</artifactId>
119+
<version>1.0.0</version>
120+
<configuration>
121+
<lifecycleMappingMetadata>
122+
<pluginExecutions>
123+
<pluginExecution>
124+
<pluginExecutionFilter>
125+
<groupId>
126+
com.jayway.maven.plugins.android.generation2
127+
</groupId>
128+
<artifactId>android-maven-plugin</artifactId>
129+
<versionRange>[3.8.2,)</versionRange>
130+
<goals>
131+
<goal>consume-aar</goal>
132+
</goals>
133+
</pluginExecutionFilter>
134+
<action>
135+
<ignore></ignore>
136+
</action>
137+
</pluginExecution>
138+
</pluginExecutions>
139+
</lifecycleMappingMetadata>
140+
</configuration>
141+
</plugin>
142+
</plugins>
143+
</pluginManagement>
144+
</build>
145+
146+
147+
<profiles>
148+
<profile>
149+
<id>release</id>
150+
<activation>
151+
<property>
152+
<name>performRelease</name>
153+
<value>true</value>
154+
</property>
155+
</activation>
156+
<build>
157+
<plugins>
158+
<plugin>
159+
<groupId>org.apache.maven.plugins</groupId>
160+
<artifactId>maven-jarsigner-plugin</artifactId>
161+
<executions>
162+
<execution>
163+
<id>signing</id>
164+
<goals>
165+
<goal>sign</goal>
166+
<goal>verify</goal>
167+
</goals>
168+
<phase>package</phase>
169+
<inherited>true</inherited>
170+
<configuration>
171+
<includes>
172+
<include>${project.build.directory}/${project.artifactId}.apklib</include>
173+
</includes>
174+
</configuration>
175+
</execution>
176+
</executions>
177+
</plugin>
178+
</plugins>
179+
</build>
180+
</profile>
181+
</profiles>
182+
</project>

lib-manipulation/proguard-project.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# To enable ProGuard in your project, edit project.properties
2+
# to define the proguard.config property as described in that file.
3+
#
4+
# Add project specific ProGuard rules here.
5+
# By default, the flags in this file are appended to flags specified
6+
# in ${sdk.dir}/tools/proguard/proguard-android.txt
7+
# You can edit the include path and order by changing the ProGuard
8+
# include property in project.properties.
9+
#
10+
# For more details, see
11+
# http://developer.android.com/guide/developing/tools/proguard.html
12+
13+
# Add any project specific keep options here:
14+
15+
# If your project uses WebView with JS, uncomment the following
16+
# and specify the fully qualified class name to the JavaScript interface
17+
# class:
18+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19+
# public *;
20+
#}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<manifest package="com.nhaarman.listviewanimations.itemmanipulation" xmlns:android="http://schemas.android.com/apk/res/android">
2+
3+
<application android:allowBackup="true">
4+
</application>
5+
6+
</manifest>

0 commit comments

Comments
 (0)