diff options
author | Thomas <tschneider.ac@gmail.com> | 2022-04-27 15:20:42 +0200 |
---|---|---|
committer | Thomas <tschneider.ac@gmail.com> | 2022-04-27 15:20:42 +0200 |
commit | 0f855c5ac2dccbc1c1df99b9d5ee17d6293d82df (patch) | |
tree | 157224e6752e2facae194034e2e709d23a04fc7d /autoimageslider |
first commit
Diffstat (limited to 'autoimageslider')
84 files changed, 9594 insertions, 0 deletions
diff --git a/autoimageslider/.gitignore b/autoimageslider/.gitignore new file mode 100644 index 000000000..796b96d1c --- /dev/null +++ b/autoimageslider/.gitignore @@ -0,0 +1 @@ +/build diff --git a/autoimageslider/build.gradle b/autoimageslider/build.gradle new file mode 100644 index 000000000..3acabfb77 --- /dev/null +++ b/autoimageslider/build.gradle @@ -0,0 +1,39 @@ +apply plugin: 'com.android.library' + + +android { + compileSdkVersion 31 + + defaultConfig { + minSdkVersion 15 + targetSdkVersion 31 + versionCode 5 + versionName "1.4.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + +} + +// Add a new configuration to hold your dependencies +configurations { + libConfig +} + +dependencies { + implementation fileTree(include: ['*.jar'], dir: 'libs') + //noinspection GradleCompatible + implementation 'androidx.appcompat:appcompat:1.4.1' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test:runner:1.4.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + +} diff --git a/autoimageslider/proguard-rules.pro b/autoimageslider/proguard-rules.pro new file mode 100644 index 000000000..f1b424510 --- /dev/null +++ b/autoimageslider/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/autoimageslider/src/androidTest/java/com/smarteist/autoimageslider/ExampleInstrumentedTest.java b/autoimageslider/src/androidTest/java/com/smarteist/autoimageslider/ExampleInstrumentedTest.java new file mode 100644 index 000000000..72b6b6bf8 --- /dev/null +++ b/autoimageslider/src/androidTest/java/com/smarteist/autoimageslider/ExampleInstrumentedTest.java @@ -0,0 +1,27 @@ +package com.smarteist.autoimageslider; + +import static org.junit.Assert.assertEquals; + +import android.content.Context; + +import androidx.test.InstrumentationRegistry; +import androidx.test.runner.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getTargetContext(); + + assertEquals("com.smarteist.autoimageslider.test", appContext.getPackageName()); + } +} diff --git a/autoimageslider/src/main/AndroidManifest.xml b/autoimageslider/src/main/AndroidManifest.xml new file mode 100644 index 000000000..058ee0393 --- /dev/null +++ b/autoimageslider/src/main/AndroidManifest.xml @@ -0,0 +1,12 @@ +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + + package="com.smarteist.autoimageslider"> + + <application + android:allowBackup="true" + android:label="@string/app_name" + android:supportsRtl="true"> + + </application> + +</manifest> diff --git a/autoimageslider/src/main/java/com/smarteist/autoimageslider/IndicatorView/IndicatorManager.java b/autoimageslider/src/main/java/com/smarteist/autoimageslider/IndicatorView/IndicatorManager.java new file mode 100644 index 000000000..bf1a8d0bb --- /dev/null +++ b/autoimageslider/src/main/java/com/smarteist/autoimageslider/IndicatorView/IndicatorManager.java @@ -0,0 +1,46 @@ +package com.smarteist.autoimageslider.IndicatorView; + +import androidx.annotation.Nullable; + +import com.smarteist.autoimageslider.IndicatorView.animation.AnimationManager; +import com.smarteist.autoimageslider.IndicatorView.animation.controller.ValueController; +import com.smarteist.autoimageslider.IndicatorView.animation.data.Value; +import com.smarteist.autoimageslider.IndicatorView.draw.DrawManager; +import com.smarteist.autoimageslider.IndicatorView.draw.data.Indicator; + +public class IndicatorManager implements ValueController.UpdateListener { + + private final DrawManager drawManager; + private final AnimationManager animationManager; + private final Listener listener; + + IndicatorManager(@Nullable Listener listener) { + this.listener = listener; + this.drawManager = new DrawManager(); + this.animationManager = new AnimationManager(drawManager.indicator(), this); + } + + public AnimationManager animate() { + return animationManager; + } + + public Indicator indicator() { + return drawManager.indicator(); + } + + public DrawManager drawer() { + return drawManager; + } + + @Override + public void onValueUpdated(@Nullable Value value) { + drawManager.updateValue(value); + if (listener != null) { + listener.onIndicatorUpdated(); + } + } + + interface Listener { + void onIndicatorUpdated(); + } +} diff --git a/autoimageslider/src/main/java/com/smarteist/autoimageslider/IndicatorView/PageIndicatorView.java b/autoimageslider/src/main/java/com/smarteist/autoimageslider/IndicatorView/PageIndicatorView.java new file mode 100644 index 000000000..ce3c06dbe --- /dev/null +++ b/autoimageslider/src/main/java/com/smarteist/autoimageslider/IndicatorView/PageIndicatorView.java @@ -0,0 +1,648 @@ +package com.smarteist.autoimageslider.IndicatorView; + +import android.annotation.SuppressLint; +import android.annotation.TargetApi; +import android.content.Context; +import android.database.DataSetObserver; +import android.graphics.Canvas; +import android.os.Build; +import android.os.Parcelable; +import android.util.AttributeSet; +import android.util.Pair; +import android.view.MotionEvent; +import android.view.View; +import android.view.ViewGr |