diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser
index 87556fe..7d4804f 100644
Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 7ac24c7..66e2f6f 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -9,6 +9,7 @@
+
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index 10ee414..af22f9d 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -23,10 +23,11 @@ android {
}
dependencies {
- implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
+ implementation fileTree(include: ['*.jar'], dir: 'libs')
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1'
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'
+ implementation project(':library')
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 1965adf..be9e7ab 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -8,7 +8,7 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
-
+
diff --git a/app/src/main/java/com/opencraft/android/gradienttextview/demo/MainActivity.kt b/app/src/main/java/com/opencraft/android/gradienttextview/sample/MainActivity.kt
similarity index 85%
rename from app/src/main/java/com/opencraft/android/gradienttextview/demo/MainActivity.kt
rename to app/src/main/java/com/opencraft/android/gradienttextview/sample/MainActivity.kt
index ccb4cb3..4840401 100644
--- a/app/src/main/java/com/opencraft/android/gradienttextview/demo/MainActivity.kt
+++ b/app/src/main/java/com/opencraft/android/gradienttextview/sample/MainActivity.kt
@@ -1,4 +1,4 @@
-package com.opencraft.android.gradienttextview.demo
+package com.opencraft.android.gradienttextview.sample
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 36461e3..ce71a6e 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -1,22 +1,34 @@
-
+ android:orientation="vertical"
+ tools:context=".sample.MainActivity">
-
+ app:gradient_end="BOTTOM_RIGHT"
+ app:gradient_start="TOP_LEFT" />
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/library/.gitignore b/library/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/library/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/library/build.gradle b/library/build.gradle
new file mode 100644
index 0000000..8e14a52
--- /dev/null
+++ b/library/build.gradle
@@ -0,0 +1,39 @@
+apply plugin: 'com.android.library'
+apply plugin: 'kotlin-android'
+
+android {
+ compileSdkVersion 27
+
+
+
+ defaultConfig {
+ minSdkVersion 15
+ targetSdkVersion 27
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'com.android.support:appcompat-v7:27.1.1'
+ 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'
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
+}
+repositories {
+ mavenCentral()
+}
diff --git a/library/proguard-rules.pro b/library/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/library/proguard-rules.pro
@@ -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
diff --git a/library/src/androidTest/java/com/opencraft/library/ExampleInstrumentedTest.java b/library/src/androidTest/java/com/opencraft/library/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..9e4d8f7
--- /dev/null
+++ b/library/src/androidTest/java/com/opencraft/library/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.opencraft.library;
+
+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 Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getTargetContext();
+
+ assertEquals("com.opencraft.library.test", appContext.getPackageName());
+ }
+}
diff --git a/library/src/main/AndroidManifest.xml b/library/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..1f8d8f3
--- /dev/null
+++ b/library/src/main/AndroidManifest.xml
@@ -0,0 +1,2 @@
+
diff --git a/app/src/main/java/com/opencraft/android/gradienttextview/control/GradientTextView.kt b/library/src/main/java/com/opencraft/library/GradientTextView.kt
similarity index 98%
rename from app/src/main/java/com/opencraft/android/gradienttextview/control/GradientTextView.kt
rename to library/src/main/java/com/opencraft/library/GradientTextView.kt
index 47d2639..4cb310e 100644
--- a/app/src/main/java/com/opencraft/android/gradienttextview/control/GradientTextView.kt
+++ b/library/src/main/java/com/opencraft/library/GradientTextView.kt
@@ -1,4 +1,4 @@
-package com.opencraft.android.gradienttextview.control
+package com.opencraft.library
import android.annotation.SuppressLint
import android.content.Context
@@ -9,7 +9,6 @@ import android.graphics.Point
import android.graphics.Shader
import android.util.AttributeSet
import android.widget.TextView
-import com.opencraft.android.gradienttextview.R
class GradientTextView constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : TextView(context, attrs, defStyleAttr) {
diff --git a/library/src/main/res/values/arrays.xml b/library/src/main/res/values/arrays.xml
new file mode 100644
index 0000000..79434f1
--- /dev/null
+++ b/library/src/main/res/values/arrays.xml
@@ -0,0 +1,12 @@
+
+
+
+ - #000000
+ - #FFFFFF
+
+
+
+ - 1
+ - 1
+
+
\ No newline at end of file
diff --git a/library/src/main/res/values/attrs.xml b/library/src/main/res/values/attrs.xml
new file mode 100644
index 0000000..4fba493
--- /dev/null
+++ b/library/src/main/res/values/attrs.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/library/src/main/res/values/colors.xml b/library/src/main/res/values/colors.xml
new file mode 100644
index 0000000..3ab3e9c
--- /dev/null
+++ b/library/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #3F51B5
+ #303F9F
+ #FF4081
+
diff --git a/library/src/main/res/values/integers.xml b/library/src/main/res/values/integers.xml
new file mode 100644
index 0000000..75733ce
--- /dev/null
+++ b/library/src/main/res/values/integers.xml
@@ -0,0 +1,4 @@
+
+
+ 90
+
\ No newline at end of file
diff --git a/library/src/main/res/values/strings.xml b/library/src/main/res/values/strings.xml
new file mode 100644
index 0000000..7c9e449
--- /dev/null
+++ b/library/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ GradientTextView
+
diff --git a/library/src/main/res/values/styles.xml b/library/src/main/res/values/styles.xml
new file mode 100644
index 0000000..5885930
--- /dev/null
+++ b/library/src/main/res/values/styles.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
diff --git a/library/src/test/java/com/opencraft/library/ExampleUnitTest.java b/library/src/test/java/com/opencraft/library/ExampleUnitTest.java
new file mode 100644
index 0000000..720b3bd
--- /dev/null
+++ b/library/src/test/java/com/opencraft/library/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.opencraft.library;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/settings.gradle b/settings.gradle
index e7b4def..3306997 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1 +1 @@
-include ':app'
+include ':app', ':library'