diff --git a/build.gradle b/build.gradle
index aad39a7..2d0799b 100644
--- a/build.gradle
+++ b/build.gradle
@@ -4,7 +4,7 @@ buildscript {
}
dependencies {
- classpath 'com.android.tools.build:gradle:1.1.3'
+ classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.github.townsfolk:gradle-release:1.2'
}
}
diff --git a/gradle.properties b/gradle.properties
index 4eb3fd8..d282a1c 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1 +1 @@
-version=1.1.5
\ No newline at end of file
+version=1.1.6
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index eeafc18..e55143b 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Sat Apr 11 12:33:15 CST 2015
+#Mon Dec 26 08:37:51 CET 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
diff --git a/library/build.gradle b/library/build.gradle
index 4d379cf..01b747a 100644
--- a/library/build.gradle
+++ b/library/build.gradle
@@ -6,12 +6,13 @@ archivesBaseName = 'marqueeview'
group = 'asia.ivity.android'
dependencies {
-/* compile 'com.google.android.gms:play-services:3.1.36+'*/
+ /* compile 'com.google.android.gms:play-services:3.1.36+'*/
+ compile 'com.android.support:appcompat-v7:25.1.0'
}
android {
- compileSdkVersion 19
- buildToolsVersion "21.1.2"
+ compileSdkVersion 25
+ buildToolsVersion '25.0.2'
}
// TODO: Add a task that prints the test results.
diff --git a/library/src/main/AndroidManifest.xml b/library/src/main/AndroidManifest.xml
index ab53553..5b42023 100644
--- a/library/src/main/AndroidManifest.xml
+++ b/library/src/main/AndroidManifest.xml
@@ -5,6 +5,6 @@
android:versionName="1.0">
+ android:minSdkVersion="9"
+ android:targetSdkVersion="25"/>
diff --git a/library/src/main/java/asia/ivity/android/marqueeview/MarqueeView.java b/library/src/main/java/asia/ivity/android/marqueeview/MarqueeView.java
index 9b1a0e5..94633c6 100644
--- a/library/src/main/java/asia/ivity/android/marqueeview/MarqueeView.java
+++ b/library/src/main/java/asia/ivity/android/marqueeview/MarqueeView.java
@@ -5,6 +5,7 @@
import android.content.res.TypedArray;
import android.graphics.Paint;
import android.os.Build;
+import android.support.v7.widget.AppCompatTextView;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.AttributeSet;
@@ -32,7 +33,7 @@ public class MarqueeView extends LinearLayout {
private static final int TEXTVIEW_VIRTUAL_WIDTH = 2000;
private Animation mMoveTextOut = null;
- private Animation mMoveTextIn = null;
+ private Animation mMoveTextIn = null;
private Paint mPaint;
@@ -152,8 +153,25 @@ protected void onLayout(boolean changed, int l, int t, int r, int b) {
}
if (changed && mScrollView == null) {
- if (!(getChildAt(0) instanceof TextView)) {
- throw new RuntimeException("The child view of this MarqueeView must be a TextView instance.");
+ boolean exception = true;
+
+ if (exception) {
+ if (getChildAt(0) instanceof TextView) {
+ exception = false;
+ }
+ }
+
+ /**
+ * when building your app autoconvert TextView to AppCompatTextView
+ */
+ if (exception) {
+ if (getChildAt(0) instanceof AppCompatTextView) {
+ exception = false;
+ }
+ }
+
+ if (exception) {
+ throw new RuntimeException("The child view of this MarqueeView must be a TextView || AppCompatTextView instance.");
}
initView(getContext());
diff --git a/sample/build.gradle b/sample/build.gradle
index 46fded9..699f734 100644
--- a/sample/build.gradle
+++ b/sample/build.gradle
@@ -5,6 +5,6 @@ dependencies {
}
android {
- compileSdkVersion 19
- buildToolsVersion "21.1.2"
+ compileSdkVersion 25
+ buildToolsVersion '25.0.2'
}
diff --git a/sample/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml
index aaff819..8b01564 100644
--- a/sample/src/main/AndroidManifest.xml
+++ b/sample/src/main/AndroidManifest.xml
@@ -5,8 +5,8 @@
android:versionName="1.1">
+ android:minSdkVersion="9"
+ android:targetSdkVersion="25"/>