Skip to content

Commit d3ad78e

Browse files
author
Joao Rutkoski
committed
Componente extraído para modulo
1 parent 045e4b8 commit d3ad78e

File tree

21 files changed

+203
-14
lines changed

21 files changed

+203
-14
lines changed
49 Bytes
Binary file not shown.

.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/vcs.xml

Lines changed: 6 additions & 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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ android {
2323
}
2424

2525
dependencies {
26-
implementation fileTree(dir: 'libs', include: ['*.jar'])
27-
implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
26+
implementation fileTree(include: ['*.jar'], dir: 'libs')
27+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
2828
implementation 'com.android.support:appcompat-v7:27.1.1'
2929
testImplementation 'junit:junit:4.12'
3030
androidTestImplementation 'com.android.support.test:runner:1.0.2'
3131
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
32+
implementation project(':library')
3233
}

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
android:roundIcon="@mipmap/ic_launcher_round"
99
android:supportsRtl="true"
1010
android:theme="@style/AppTheme">
11-
<activity android:name=".demo.MainActivity">
11+
<activity android:name=".sample.MainActivity">
1212
<intent-filter>
1313
<action android:name="android.intent.action.MAIN" />
1414

app/src/main/java/com/opencraft/android/gradienttextview/demo/MainActivity.kt renamed to app/src/main/java/com/opencraft/android/gradienttextview/sample/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.opencraft.android.gradienttextview.demo
1+
package com.opencraft.android.gradienttextview.sample
22

33
import android.os.Bundle
44
import android.support.v7.app.AppCompatActivity
Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,34 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
66
android:layout_height="match_parent"
77
android:background="#f9f9f9"
8-
tools:context=".demo.MainActivity">
8+
android:orientation="vertical"
9+
tools:context=".sample.MainActivity">
910

10-
<com.opencraft.android.gradienttextview.control.GradientTextView
11+
<com.opencraft.library.GradientTextView
1112
android:layout_width="wrap_content"
1213
android:layout_height="wrap_content"
1314
android:layout_margin="32dp"
14-
android:text="aaaaaaaaaaaaa\naaaaaaaaaaaaa\naaaaaaaaaaaaa"
15+
android:text="aaaaaaaaaaaaa\naaaaaaaaaaaaa\naaaaaaaaaaaaa\naaaaaaaaaaaaaa"
1516
android:textSize="22sp"
1617
android:textStyle="bold"
1718
app:color_array="@array/gradient_default"
1819
app:color_span_array="@array/gradient_color_span_default"
19-
app:gradient_end="BOTTOM_CENTER"
20-
app:gradient_start="TOP_CENTER" />
20+
app:gradient_end="BOTTOM_RIGHT"
21+
app:gradient_start="TOP_LEFT" />
2122

22-
</RelativeLayout>
23+
<com.opencraft.library.GradientTextView
24+
android:layout_width="wrap_content"
25+
android:layout_height="wrap_content"
26+
android:layout_margin="32dp"
27+
android:text="aaaaaaaaaaaaa\naaaaaaaaaaaaa\naaaaaaaaaaaaa\naaaaaaaaaaaaaa"
28+
android:textSize="22sp"
29+
android:textStyle="bold"
30+
app:angle="-45"
31+
app:color_array="@array/gradient_default"
32+
app:color_span_array="@array/gradient_color_span_default" />
33+
34+
</LinearLayout>

library/.gitignore

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

library/build.gradle

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
apply plugin: 'com.android.library'
2+
apply plugin: 'kotlin-android'
3+
4+
android {
5+
compileSdkVersion 27
6+
7+
8+
9+
defaultConfig {
10+
minSdkVersion 15
11+
targetSdkVersion 27
12+
versionCode 1
13+
versionName "1.0"
14+
15+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
16+
17+
}
18+
19+
buildTypes {
20+
release {
21+
minifyEnabled false
22+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
23+
}
24+
}
25+
26+
}
27+
28+
dependencies {
29+
implementation fileTree(dir: 'libs', include: ['*.jar'])
30+
31+
implementation 'com.android.support:appcompat-v7:27.1.1'
32+
testImplementation 'junit:junit:4.12'
33+
androidTestImplementation 'com.android.support.test:runner:1.0.2'
34+
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
35+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
36+
}
37+
repositories {
38+
mavenCentral()
39+
}

library/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile

0 commit comments

Comments
 (0)