From af069504ef6c62eeb06d271d72e3228166ac65c2 Mon Sep 17 00:00:00 2001 From: Cliff Ophalvens Date: Sun, 21 Feb 2016 17:08:04 +0100 Subject: [PATCH 01/33] convert to library module + add bintray gradle config --- CHANGELOG.md | 0 app/app.iml | 4 +- app/build.gradle | 5 +- app/src/main/res/layout/activity_main.xml | 1 - build.gradle | 8 +- ...extView.iml => expandabletextview-root.iml | 2 +- expandabletextview/.gitignore | 1 + expandabletextview/build.gradle | 96 ++++++++++++++++ expandabletextview/expandabletextview.iml | 106 ++++++++++++++++++ expandabletextview/gradle.properties | 3 + expandabletextview/proguard-rules.pro | 17 +++ .../at/android/views/ApplicationTest.java | 15 +++ .../src/main/AndroidManifest.xml | 11 ++ .../at/android/animator/AnimatorListener.java | 0 .../at/android/views/ExpandableTextView.java | 1 + .../src/main/res/values/attrs.xml | 0 .../src/main/res/values/strings.xml | 3 + .../at/android/views/ExampleUnitTest.java | 17 +++ gradle.properties | 18 --- settings.gradle | 4 +- 20 files changed, 287 insertions(+), 25 deletions(-) create mode 100644 CHANGELOG.md rename Android-ExpandableTextView.iml => expandabletextview-root.iml (70%) create mode 100644 expandabletextview/.gitignore create mode 100644 expandabletextview/build.gradle create mode 100644 expandabletextview/expandabletextview.iml create mode 100644 expandabletextview/gradle.properties create mode 100644 expandabletextview/proguard-rules.pro create mode 100644 expandabletextview/src/androidTest/java/blogc/at/android/views/ApplicationTest.java create mode 100644 expandabletextview/src/main/AndroidManifest.xml rename {app => expandabletextview}/src/main/java/blogc/at/android/animator/AnimatorListener.java (100%) rename {app => expandabletextview}/src/main/java/blogc/at/android/views/ExpandableTextView.java (99%) rename {app => expandabletextview}/src/main/res/values/attrs.xml (100%) create mode 100644 expandabletextview/src/main/res/values/strings.xml create mode 100644 expandabletextview/src/test/java/blogc/at/android/views/ExampleUnitTest.java diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/app/app.iml b/app/app.iml index 956846c..517f443 100644 --- a/app/app.iml +++ b/app/app.iml @@ -1,5 +1,5 @@ - + @@ -88,6 +88,7 @@ + @@ -104,5 +105,6 @@ + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 27dde40..5434219 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -21,6 +21,9 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) - testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.1' + compile project(':expandabletextview') + + + testCompile 'junit:junit:4.12' } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 8e19904..ada4a7d 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -12,7 +12,6 @@ android:paddingTop="@dimen/activity_vertical_margin" tools:context="blogc.at.android.activities.MainActivity"> - - + diff --git a/expandabletextview/.gitignore b/expandabletextview/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/expandabletextview/.gitignore @@ -0,0 +1 @@ +/build diff --git a/expandabletextview/build.gradle b/expandabletextview/build.gradle new file mode 100644 index 0000000..98d98c2 --- /dev/null +++ b/expandabletextview/build.gradle @@ -0,0 +1,96 @@ +apply plugin: 'com.android.library' +apply plugin: 'com.github.dcendents.android-maven' + +def fullVersion = '1.0.0-SNAPSHOT' +group = 'blogc.at.android' +version = fullVersion + +android { + compileSdkVersion 23 + buildToolsVersion "23.0.2" + + defaultConfig { + minSdkVersion 14 + targetSdkVersion 23 + versionCode 1 + versionName fullVersion + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +repositories { + mavenCentral() +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + testCompile 'junit:junit:4.12' + compile 'com.android.support:appcompat-v7:23.1.1' +} + +install { + repositories.mavenInstaller { + pom.project { + name 'ExpandableTextView' + description 'An expandable TextView for Android.' + url 'https://github.com/Blogcat/Android-ExpandableTextView' + inceptionYear '2016' + + packaging 'aar' + groupId group + artifactId 'expandabletextview' + version fullVersion + + licenses { + license { + name 'The Apache Software License, Version 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' + distribution 'repo' + } + } + scm { + connection 'https://github.com/Blogcat/Android-ExpandableTextView.git' + url 'https://github.com/Blogcat/Android-ExpandableTextView' + + } + developers { + developer { + id 'cliffus' + name 'Cliff Ophalvens' + email 'cliff.ophalvens@gmail.com' + } + } + } + } +} + +bintray { + user = bintray_user + key = bintray_apikey + configurations = ['archives'] + + dryRun = true + + pkg { + repo = 'maven' + name = 'expandabletextview' + userOrg = bintray_user + licenses = ['Apache-2.0'] + websiteUrl = 'https://github.com/Blogcat/Android-ExpandableTextView' + issueTrackerUrl = 'https://github.com/Blogcat/Android-ExpandableTextView/issues' + vcsUrl = 'https://github.com/Blogcat/Android-ExpandableTextView.git' + githubRepo = 'Blogcat/Android-ExpandableTextView' + githubReleaseNotesFile = 'CHANGELOG.md' + + version { + name = fullVersion + released = new Date() + vcsTag = fullVersion + } + } +} \ No newline at end of file diff --git a/expandabletextview/expandabletextview.iml b/expandabletextview/expandabletextview.iml new file mode 100644 index 0000000..7b5feca --- /dev/null +++ b/expandabletextview/expandabletextview.iml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/expandabletextview/gradle.properties b/expandabletextview/gradle.properties new file mode 100644 index 0000000..f6c0bc1 --- /dev/null +++ b/expandabletextview/gradle.properties @@ -0,0 +1,3 @@ +POM_NAME=Expandable TextView +POM_ARTIFACT_ID=expandabletextview +POM_PACKAGING=aar diff --git a/expandabletextview/proguard-rules.pro b/expandabletextview/proguard-rules.pro new file mode 100644 index 0000000..7f645b4 --- /dev/null +++ b/expandabletextview/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /Library/android-sdk-mac_x86/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 *; +#} diff --git a/expandabletextview/src/androidTest/java/blogc/at/android/views/ApplicationTest.java b/expandabletextview/src/androidTest/java/blogc/at/android/views/ApplicationTest.java new file mode 100644 index 0000000..7e5a8f5 --- /dev/null +++ b/expandabletextview/src/androidTest/java/blogc/at/android/views/ApplicationTest.java @@ -0,0 +1,15 @@ +package blogc.at.android.views; + +import android.app.Application; +import android.test.ApplicationTestCase; + +/** + * Testing Fundamentals + */ +public class ApplicationTest extends ApplicationTestCase +{ + public ApplicationTest() + { + super(Application.class); + } +} \ No newline at end of file diff --git a/expandabletextview/src/main/AndroidManifest.xml b/expandabletextview/src/main/AndroidManifest.xml new file mode 100644 index 0000000..247c854 --- /dev/null +++ b/expandabletextview/src/main/AndroidManifest.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/app/src/main/java/blogc/at/android/animator/AnimatorListener.java b/expandabletextview/src/main/java/blogc/at/android/animator/AnimatorListener.java similarity index 100% rename from app/src/main/java/blogc/at/android/animator/AnimatorListener.java rename to expandabletextview/src/main/java/blogc/at/android/animator/AnimatorListener.java diff --git a/app/src/main/java/blogc/at/android/views/ExpandableTextView.java b/expandabletextview/src/main/java/blogc/at/android/views/ExpandableTextView.java similarity index 99% rename from app/src/main/java/blogc/at/android/views/ExpandableTextView.java rename to expandabletextview/src/main/java/blogc/at/android/views/ExpandableTextView.java index 43122db..084cf7a 100644 --- a/app/src/main/java/blogc/at/android/views/ExpandableTextView.java +++ b/expandabletextview/src/main/java/blogc/at/android/views/ExpandableTextView.java @@ -12,6 +12,7 @@ import java.lang.reflect.Field; import blogc.at.android.animator.AnimatorListener; +import blogc.at.expandabletextview.R; /** * Created by cliff on 18/02/16. diff --git a/app/src/main/res/values/attrs.xml b/expandabletextview/src/main/res/values/attrs.xml similarity index 100% rename from app/src/main/res/values/attrs.xml rename to expandabletextview/src/main/res/values/attrs.xml diff --git a/expandabletextview/src/main/res/values/strings.xml b/expandabletextview/src/main/res/values/strings.xml new file mode 100644 index 0000000..0d367a8 --- /dev/null +++ b/expandabletextview/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + ExpandableTextView + diff --git a/expandabletextview/src/test/java/blogc/at/android/views/ExampleUnitTest.java b/expandabletextview/src/test/java/blogc/at/android/views/ExampleUnitTest.java new file mode 100644 index 0000000..4147ff4 --- /dev/null +++ b/expandabletextview/src/test/java/blogc/at/android/views/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package blogc.at.android.views; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * To work on unit tests, switch the Test Artifact in the Build Variants view. + */ +public class ExampleUnitTest +{ + @Test + public void addition_isCorrect() throws Exception + { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 1d3591c..e69de29 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,18 +0,0 @@ -# Project-wide Gradle settings. - -# IDE (e.g. Android Studio) users: -# Gradle settings configured through the IDE *will override* -# any settings specified in this file. - -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html - -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -# Default value: -Xmx10248m -XX:MaxPermSize=256m -# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 - -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index e7b4def..cf1165a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,3 @@ -include ':app' +rootProject.name='expandabletextview-root' + +include ':app', ':expandabletextview' From 1c6adb4669e5093d38650bca8b512a5c533df0d9 Mon Sep 17 00:00:00 2001 From: Cliff Ophalvens Date: Sun, 21 Feb 2016 17:12:34 +0100 Subject: [PATCH 02/33] remove gradle maven config --- expandabletextview/build.gradle | 38 +-------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/expandabletextview/build.gradle b/expandabletextview/build.gradle index 98d98c2..7f6eeb2 100644 --- a/expandabletextview/build.gradle +++ b/expandabletextview/build.gradle @@ -33,42 +33,6 @@ dependencies { compile 'com.android.support:appcompat-v7:23.1.1' } -install { - repositories.mavenInstaller { - pom.project { - name 'ExpandableTextView' - description 'An expandable TextView for Android.' - url 'https://github.com/Blogcat/Android-ExpandableTextView' - inceptionYear '2016' - - packaging 'aar' - groupId group - artifactId 'expandabletextview' - version fullVersion - - licenses { - license { - name 'The Apache Software License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - distribution 'repo' - } - } - scm { - connection 'https://github.com/Blogcat/Android-ExpandableTextView.git' - url 'https://github.com/Blogcat/Android-ExpandableTextView' - - } - developers { - developer { - id 'cliffus' - name 'Cliff Ophalvens' - email 'cliff.ophalvens@gmail.com' - } - } - } - } -} - bintray { user = bintray_user key = bintray_apikey @@ -78,7 +42,7 @@ bintray { pkg { repo = 'maven' - name = 'expandabletextview' + name = 'android-expandabletextview' userOrg = bintray_user licenses = ['Apache-2.0'] websiteUrl = 'https://github.com/Blogcat/Android-ExpandableTextView' From eccb98520e6850114516012eb44e1b32ac7d3f7b Mon Sep 17 00:00:00 2001 From: Cliff Ophalvens Date: Sun, 21 Feb 2016 17:29:18 +0100 Subject: [PATCH 03/33] go back to old gradle syntax for plugins --- build.gradle | 5 +---- expandabletextview/build.gradle | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 1ceeed0..f4e0fd0 100644 --- a/build.gradle +++ b/build.gradle @@ -7,15 +7,12 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.0.0-beta5' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' + classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } -plugins { - id "com.jfrog.bintray" version "1.6" -} - allprojects { repositories { jcenter() diff --git a/expandabletextview/build.gradle b/expandabletextview/build.gradle index 7f6eeb2..3eacf2a 100644 --- a/expandabletextview/build.gradle +++ b/expandabletextview/build.gradle @@ -1,5 +1,6 @@ apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' +apply plugin: 'com.jfrog.bintray' def fullVersion = '1.0.0-SNAPSHOT' group = 'blogc.at.android' From 5acc8bdd1fc7ef5715b27204969813c82ef4fabb Mon Sep 17 00:00:00 2001 From: Cliff Ophalvens Date: Sun, 21 Feb 2016 18:12:00 +0100 Subject: [PATCH 04/33] prepare bintray gradle config for version 1.0.0 --- app/app.iml | 14 ++++----- expandabletextview/build.gradle | 35 +++++++++++++++++++---- expandabletextview/expandabletextview.iml | 16 +++++------ 3 files changed, 45 insertions(+), 20 deletions(-) diff --git a/app/app.iml b/app/app.iml index 517f443..77ea45a 100644 --- a/app/app.iml +++ b/app/app.iml @@ -61,13 +61,6 @@ - - - - - - - @@ -75,6 +68,13 @@ + + + + + + + diff --git a/expandabletextview/build.gradle b/expandabletextview/build.gradle index 3eacf2a..ef313b9 100644 --- a/expandabletextview/build.gradle +++ b/expandabletextview/build.gradle @@ -2,7 +2,8 @@ apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' apply plugin: 'com.jfrog.bintray' -def fullVersion = '1.0.0-SNAPSHOT' +def fullVersion = '1.0.0' + group = 'blogc.at.android' version = fullVersion @@ -34,17 +35,36 @@ dependencies { compile 'com.android.support:appcompat-v7:23.1.1' } +task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' +} + +task javadoc(type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} +artifacts { + archives javadocJar + archives sourcesJar +} + bintray { - user = bintray_user - key = bintray_apikey + user = "${bintray_user}" + key = "${bintray_apikey}" configurations = ['archives'] - dryRun = true + dryRun = false pkg { repo = 'maven' name = 'android-expandabletextview' - userOrg = bintray_user + userOrg = "${bintray_user}" licenses = ['Apache-2.0'] websiteUrl = 'https://github.com/Blogcat/Android-ExpandableTextView' issueTrackerUrl = 'https://github.com/Blogcat/Android-ExpandableTextView/issues' @@ -56,6 +76,11 @@ bintray { name = fullVersion released = new Date() vcsTag = fullVersion + + gpg { + sign = true + passphrase = "${bintray_gpg_password}" + } } } } \ No newline at end of file diff --git a/expandabletextview/expandabletextview.iml b/expandabletextview/expandabletextview.iml index 7b5feca..60c87b1 100644 --- a/expandabletextview/expandabletextview.iml +++ b/expandabletextview/expandabletextview.iml @@ -1,5 +1,5 @@ - + @@ -62,13 +62,6 @@ - - - - - - - @@ -76,6 +69,13 @@ + + + + + + + From 5f7db5915d5472adc7e9deb620f99b97981edce2 Mon Sep 17 00:00:00 2001 From: Cliff Ophalvens Date: Sun, 21 Feb 2016 18:18:03 +0100 Subject: [PATCH 05/33] update git ignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index c9c2248..76be0fa 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,5 @@ proguard/ # Android Studio captures folder captures/ + +*.iml From 6a2ad3e0280a87b741692a26190c478c1a68cf48 Mon Sep 17 00:00:00 2001 From: Cliff Ophalvens Date: Sun, 21 Feb 2016 18:18:41 +0100 Subject: [PATCH 06/33] Delete expandabletextview-root.iml --- expandabletextview-root.iml | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 expandabletextview-root.iml diff --git a/expandabletextview-root.iml b/expandabletextview-root.iml deleted file mode 100644 index 67716ad..0000000 --- a/expandabletextview-root.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file From 2713f51d1c3ca15dd3d10cdfacde75df025c9478 Mon Sep 17 00:00:00 2001 From: Cliff Ophalvens Date: Sun, 21 Feb 2016 18:18:55 +0100 Subject: [PATCH 07/33] Delete ExpandableTextView.iml --- ExpandableTextView.iml | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 ExpandableTextView.iml diff --git a/ExpandableTextView.iml b/ExpandableTextView.iml deleted file mode 100644 index 488df12..0000000 --- a/ExpandableTextView.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file From c09cbe0c9d8d448587399bd51cb8fcb6f06d5014 Mon Sep 17 00:00:00 2001 From: Cliff Ophalvens Date: Sun, 21 Feb 2016 18:19:08 +0100 Subject: [PATCH 08/33] Delete expandabletextview.iml --- expandabletextview/expandabletextview.iml | 106 ---------------------- 1 file changed, 106 deletions(-) delete mode 100644 expandabletextview/expandabletextview.iml diff --git a/expandabletextview/expandabletextview.iml b/expandabletextview/expandabletextview.iml deleted file mode 100644 index 60c87b1..0000000 --- a/expandabletextview/expandabletextview.iml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 78283dbbf61f6901bf185f0cafaf6b494bfe6e0b Mon Sep 17 00:00:00 2001 From: Cliff Ophalvens Date: Sun, 21 Feb 2016 18:19:20 +0100 Subject: [PATCH 09/33] Delete app.iml --- app/app.iml | 110 ---------------------------------------------------- 1 file changed, 110 deletions(-) delete mode 100644 app/app.iml diff --git a/app/app.iml b/app/app.iml deleted file mode 100644 index 77ea45a..0000000 --- a/app/app.iml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 89766c781bea46fccad9a29b430cb91706333335 Mon Sep 17 00:00:00 2001 From: Cliff Ophalvens Date: Mon, 22 Feb 2016 13:06:45 +0100 Subject: [PATCH 10/33] add copyright notice to all files --- app/src/main/AndroidManifest.xml | 14 ++++++++++++++ .../blogc/at/android/activities/MainActivity.java | 15 +++++++++++++++ app/src/main/res/layout/activity_main.xml | 14 ++++++++++++++ app/src/main/res/values-w820dp/dimens.xml | 15 +++++++++++++++ app/src/main/res/values/colors.xml | 14 ++++++++++++++ app/src/main/res/values/dimens.xml | 15 +++++++++++++++ app/src/main/res/values/lorem_ipsum.xml | 14 ++++++++++++++ app/src/main/res/values/strings.xml | 15 +++++++++++++++ app/src/main/res/values/styles.xml | 15 +++++++++++++++ expandabletextview/src/main/AndroidManifest.xml | 15 +++++++++++++++ .../at/android/animator/AnimatorListener.java | 14 +++++++++++++- .../at/android/views/ExpandableTextView.java | 14 +++++++++++++- expandabletextview/src/main/res/values/attrs.xml | 14 ++++++++++++++ .../src/main/res/values/strings.xml | 15 +++++++++++++++ 14 files changed, 201 insertions(+), 2 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d38e9cc..23fbb4d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,4 +1,18 @@ + diff --git a/app/src/main/java/blogc/at/android/activities/MainActivity.java b/app/src/main/java/blogc/at/android/activities/MainActivity.java index 0842c46..43744bd 100644 --- a/app/src/main/java/blogc/at/android/activities/MainActivity.java +++ b/app/src/main/java/blogc/at/android/activities/MainActivity.java @@ -7,6 +7,21 @@ import blogc.at.android.views.ExpandableTextView; import blogc.at.android.views.R; +/** + * Copyright (C) 2016 Cliff Ophalvens (Blogc.at) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ public class MainActivity extends AppCompatActivity { @Override diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index ada4a7d..c390699 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,4 +1,18 @@ + + #3F51B5 #303F9F diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 47c8224..bd551d9 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -1,3 +1,18 @@ + + 16dp diff --git a/app/src/main/res/values/lorem_ipsum.xml b/app/src/main/res/values/lorem_ipsum.xml index 618ce94..b7f0026 100644 --- a/app/src/main/res/values/lorem_ipsum.xml +++ b/app/src/main/res/values/lorem_ipsum.xml @@ -1,4 +1,18 @@ + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse a risus sed nulla faucibus commodo. Donec iaculis pretium facilisis. Praesent rutrum varius arcu, sed viverra ipsum malesuada id. Suspendisse nec mauris eleifend, maximus elit et, venenatis quam. Duis at maximus nisi, a congue sapien. Curabitur facilisis at nisi vitae vulputate. Phasellus vel orci et massa scelerisque ultrices. Morbi eget ipsum porttitor arcu volutpat convallis. Pellentesque velit libero, interdum sed consequat at, eleifend et nisi. Interdum et malesuada fames ac ante ipsum primis in faucibus. Sed convallis massa imperdiet, consectetur lectus sodales, finibus velit. Donec quis tortor vel quam porta hendrerit. Vivamus vitae consectetur orci, sed feugiat turpis. diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0d367a8..e0c953a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,3 +1,18 @@ + + ExpandableTextView diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 5885930..5d882c1 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,3 +1,18 @@ + + diff --git a/expandabletextview/src/main/AndroidManifest.xml b/expandabletextview/src/main/AndroidManifest.xml index 247c854..38fb579 100644 --- a/expandabletextview/src/main/AndroidManifest.xml +++ b/expandabletextview/src/main/AndroidManifest.xml @@ -1,3 +1,18 @@ + + diff --git a/expandabletextview/src/main/java/blogc/at/android/animator/AnimatorListener.java b/expandabletextview/src/main/java/blogc/at/android/animator/AnimatorListener.java index 58a5d30..d25f27f 100644 --- a/expandabletextview/src/main/java/blogc/at/android/animator/AnimatorListener.java +++ b/expandabletextview/src/main/java/blogc/at/android/animator/AnimatorListener.java @@ -3,7 +3,19 @@ import android.animation.Animator; /** - * Created by cliff on 18/02/16. + * Copyright (C) 2016 Cliff Ophalvens (Blogc.at) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ public class AnimatorListener implements Animator.AnimatorListener { diff --git a/expandabletextview/src/main/java/blogc/at/android/views/ExpandableTextView.java b/expandabletextview/src/main/java/blogc/at/android/views/ExpandableTextView.java index 084cf7a..d8cbcdf 100644 --- a/expandabletextview/src/main/java/blogc/at/android/views/ExpandableTextView.java +++ b/expandabletextview/src/main/java/blogc/at/android/views/ExpandableTextView.java @@ -15,7 +15,19 @@ import blogc.at.expandabletextview.R; /** - * Created by cliff on 18/02/16. + * Copyright (C) 2016 Cliff Ophalvens (Blogc.at) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ public class ExpandableTextView extends TextView { diff --git a/expandabletextview/src/main/res/values/attrs.xml b/expandabletextview/src/main/res/values/attrs.xml index 7e5c7da..6eb9089 100644 --- a/expandabletextview/src/main/res/values/attrs.xml +++ b/expandabletextview/src/main/res/values/attrs.xml @@ -1,4 +1,18 @@ + diff --git a/expandabletextview/src/main/res/values/strings.xml b/expandabletextview/src/main/res/values/strings.xml index 0d367a8..e0c953a 100644 --- a/expandabletextview/src/main/res/values/strings.xml +++ b/expandabletextview/src/main/res/values/strings.xml @@ -1,3 +1,18 @@ + + ExpandableTextView From 21109e147fba6efc177532cf5219818f7c15e46b Mon Sep 17 00:00:00 2001 From: Cliff Ophalvens Date: Mon, 22 Feb 2016 13:06:54 +0100 Subject: [PATCH 11/33] remove app compat dependency --- expandabletextview/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/expandabletextview/build.gradle b/expandabletextview/build.gradle index ef313b9..a1ffc81 100644 --- a/expandabletextview/build.gradle +++ b/expandabletextview/build.gradle @@ -32,7 +32,6 @@ repositories { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' - compile 'com.android.support:appcompat-v7:23.1.1' } task sourcesJar(type: Jar) { From e3adf111ac5af28a2963bceedab745e9f4fcc85e Mon Sep 17 00:00:00 2001 From: Cliff Ophalvens Date: Tue, 23 Feb 2016 12:57:29 +0100 Subject: [PATCH 12/33] change package name to at.blogc.android --- .../at => at/blogc}/android/views/ApplicationTest.java | 2 +- app/src/main/AndroidManifest.xml | 4 ++-- .../blogc}/android/activities/MainActivity.java | 6 +++--- app/src/main/res/layout/activity_main.xml | 10 ++-------- .../at => at/blogc}/android/views/ExampleUnitTest.java | 2 +- expandabletextview/build.gradle | 2 +- .../at => at/blogc}/android/views/ApplicationTest.java | 2 +- expandabletextview/src/main/AndroidManifest.xml | 2 +- .../blogc}/android/animator/AnimatorListener.java | 2 +- .../blogc}/android/views/ExpandableTextView.java | 6 +++--- .../at => at/blogc}/android/views/ExampleUnitTest.java | 2 +- 11 files changed, 17 insertions(+), 23 deletions(-) rename app/src/androidTest/java/{blogc/at => at/blogc}/android/views/ApplicationTest.java (91%) rename app/src/main/java/{blogc/at => at/blogc}/android/activities/MainActivity.java (91%) rename app/src/test/java/{blogc/at => at/blogc}/android/views/ExampleUnitTest.java (89%) rename expandabletextview/src/androidTest/java/{blogc/at => at/blogc}/android/views/ApplicationTest.java (91%) rename expandabletextview/src/main/java/{blogc/at => at/blogc}/android/animator/AnimatorListener.java (96%) rename expandabletextview/src/main/java/{blogc/at => at/blogc}/android/views/ExpandableTextView.java (98%) rename expandabletextview/src/test/java/{blogc/at => at/blogc}/android/views/ExampleUnitTest.java (89%) diff --git a/app/src/androidTest/java/blogc/at/android/views/ApplicationTest.java b/app/src/androidTest/java/at/blogc/android/views/ApplicationTest.java similarity index 91% rename from app/src/androidTest/java/blogc/at/android/views/ApplicationTest.java rename to app/src/androidTest/java/at/blogc/android/views/ApplicationTest.java index 7e5a8f5..a85d191 100644 --- a/app/src/androidTest/java/blogc/at/android/views/ApplicationTest.java +++ b/app/src/androidTest/java/at/blogc/android/views/ApplicationTest.java @@ -1,4 +1,4 @@ -package blogc.at.android.views; +package at.blogc.android.views; import android.app.Application; import android.test.ApplicationTestCase; diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 23fbb4d..509ac2a 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. --> - - + diff --git a/app/src/main/java/blogc/at/android/activities/MainActivity.java b/app/src/main/java/at/blogc/android/activities/MainActivity.java similarity index 91% rename from app/src/main/java/blogc/at/android/activities/MainActivity.java rename to app/src/main/java/at/blogc/android/activities/MainActivity.java index 43744bd..b0017ba 100644 --- a/app/src/main/java/blogc/at/android/activities/MainActivity.java +++ b/app/src/main/java/at/blogc/android/activities/MainActivity.java @@ -1,11 +1,11 @@ -package blogc.at.android.activities; +package at.blogc.android.activities; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; -import blogc.at.android.views.ExpandableTextView; -import blogc.at.android.views.R; +import at.blogc.android.views.ExpandableTextView; +import at.blogc.android.views.R; /** * Copyright (C) 2016 Cliff Ophalvens (Blogc.at) diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index c390699..ed8667c 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -24,9 +24,9 @@ android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" - tools:context="blogc.at.android.activities.MainActivity"> + tools:context="at.blogc.android.activities.MainActivity"> - - - diff --git a/app/src/test/java/blogc/at/android/views/ExampleUnitTest.java b/app/src/test/java/at/blogc/android/views/ExampleUnitTest.java similarity index 89% rename from app/src/test/java/blogc/at/android/views/ExampleUnitTest.java rename to app/src/test/java/at/blogc/android/views/ExampleUnitTest.java index 4147ff4..bd50ab8 100644 --- a/app/src/test/java/blogc/at/android/views/ExampleUnitTest.java +++ b/app/src/test/java/at/blogc/android/views/ExampleUnitTest.java @@ -1,4 +1,4 @@ -package blogc.at.android.views; +package at.blogc.android.views; import org.junit.Test; diff --git a/expandabletextview/build.gradle b/expandabletextview/build.gradle index a1ffc81..1805796 100644 --- a/expandabletextview/build.gradle +++ b/expandabletextview/build.gradle @@ -4,7 +4,7 @@ apply plugin: 'com.jfrog.bintray' def fullVersion = '1.0.0' -group = 'blogc.at.android' +group = 'at.blogc.android' version = fullVersion android { diff --git a/expandabletextview/src/androidTest/java/blogc/at/android/views/ApplicationTest.java b/expandabletextview/src/androidTest/java/at/blogc/android/views/ApplicationTest.java similarity index 91% rename from expandabletextview/src/androidTest/java/blogc/at/android/views/ApplicationTest.java rename to expandabletextview/src/androidTest/java/at/blogc/android/views/ApplicationTest.java index 7e5a8f5..a85d191 100644 --- a/expandabletextview/src/androidTest/java/blogc/at/android/views/ApplicationTest.java +++ b/expandabletextview/src/androidTest/java/at/blogc/android/views/ApplicationTest.java @@ -1,4 +1,4 @@ -package blogc.at.android.views; +package at.blogc.android.views; import android.app.Application; import android.test.ApplicationTestCase; diff --git a/expandabletextview/src/main/AndroidManifest.xml b/expandabletextview/src/main/AndroidManifest.xml index 38fb579..750b595 100644 --- a/expandabletextview/src/main/AndroidManifest.xml +++ b/expandabletextview/src/main/AndroidManifest.xml @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. --> - Date: Tue, 23 Feb 2016 13:08:55 +0100 Subject: [PATCH 13/33] Update README.md --- README.md | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 30d0d47..6973a0d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,42 @@ -# Android-ExpandableTextView -An expandable TextView for Android applications +Android-ExpandableTextView +========================== +An expandable TextView for Android applications (4.0+). + +Add dependency +-------- +This library is not yet released in Maven Central, but instead you can use [Bintray](https://www.bintray.com) + +```groovy + repositories { + maven { + url "https://dl.bintray.com/cliffus/maven" + } + } +``` + +library dependency + +```groovy + dependencies { + compile ('at.blogc.android:android-expandabletextview:1.0.0@aar') + } +``` + + + +License +======= + + Copyright 2016 Cliff Ophalvens (Blogc.at) + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. From 40a31dbabd9a3256fc3c428e11d5195d55049ffe Mon Sep 17 00:00:00 2001 From: Cliff Ophalvens Date: Tue, 23 Feb 2016 13:23:39 +0100 Subject: [PATCH 14/33] Update README.md --- README.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6973a0d..be8b54b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Android-ExpandableTextView An expandable TextView for Android applications (4.0+). Add dependency --------- +-------------- This library is not yet released in Maven Central, but instead you can use [Bintray](https://www.bintray.com) ```groovy @@ -22,7 +22,30 @@ library dependency } ``` +Usage +----- +```xml + + + + + + + +``` License ======= From 2304a37fbe63256bbb629993591ff8383ac375c5 Mon Sep 17 00:00:00 2001 From: Cliff Ophalvens Date: Wed, 24 Feb 2016 14:06:47 +0100 Subject: [PATCH 15/33] Update README.md --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/README.md b/README.md index be8b54b..b165e03 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ library dependency Usage ----- +Using the ExpandableTextView is very easy, it's just a regular TextView with some extra functionality added to it. By defining the android:maxLines attribute, you can set the default number of lines for the collapsed state. ```xml ``` +In your Activity or Fragment: + +```java +final ExpandableTextView expandableTextView = (ExpandableTextView) this.findViewById(R.id.expandableTextView); +final Button buttonReadMore = (Button) this.findViewById(R.id.button_read_more); + +// toggle +buttonReadMore.setOnClickListener(new View.OnClickListener() +{ + @Override + public void onClick(final View v) + { + expandableTextView.toggle(); + } +}); + +// you can also do the check yourself +buttonReadMore.setOnClickListener(new View.OnClickListener() +{ + @Override + public void onClick(final View v) + { + if (expandableTextView.isExpanded()) + { + expandableTextView.collapse(); + } + else + { + expandableTextView.expand(); + } + } +}); +``` + License ======= From 11cbdf455dbd1aa4a928ec1b30de9e6173f5080a Mon Sep 17 00:00:00 2001 From: Cliff Ophalvens Date: Wed, 24 Feb 2016 16:07:58 +0100 Subject: [PATCH 16/33] Update README.md --- README.md | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b165e03..31b3b67 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,13 @@ Using the ExpandableTextView is very easy, it's just a regular TextView with som android:ellipsize="end" app:animation_duration="1000"/> - + + +