├── .gitignore
├── README.md
├── build.gradle
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── sample
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── fujiyuu75
│ │ └── sequent
│ │ └── sample
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── kotlin
│ │ └── com
│ │ │ └── fujiyuu75
│ │ │ └── sequent
│ │ │ └── sample
│ │ │ ├── AnimActivity.kt
│ │ │ ├── SampleActivity.kt
│ │ │ ├── SampleFragment1.kt
│ │ │ ├── SampleFragment2.kt
│ │ │ ├── SampleFragment3.kt
│ │ │ └── SampleViewPagerAdapter.kt
│ └── res
│ │ ├── anim
│ │ └── overshoot.xml
│ │ ├── drawable
│ │ ├── t1_1.png
│ │ ├── t1_2.png
│ │ ├── t1_3.png
│ │ ├── t1_4.png
│ │ ├── t1_5.png
│ │ ├── t2_1.png
│ │ ├── t2_2.png
│ │ ├── t2_3.png
│ │ ├── t2_4.png
│ │ ├── t3_1.png
│ │ ├── t3_2.png
│ │ ├── t3_3.png
│ │ ├── tutorial_swipe_navi.xml
│ │ └── tutorial_swipe_navi_selected.xml
│ │ ├── layout
│ │ ├── activity_anim.xml
│ │ ├── activity_sample.xml
│ │ ├── fragment_sample_1.xml
│ │ ├── fragment_sample_2.xml
│ │ ├── fragment_sample_3.xml
│ │ └── view_sample_next_button.xml
│ │ ├── menu
│ │ └── animation.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── array.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── fujiyuu75
│ └── sequent
│ └── sample
│ └── ExampleUnitTest.java
├── sequent
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── fujiyuu75
│ │ └── sequent
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── fujiyuu75
│ │ │ └── sequent
│ │ │ ├── Animation.java
│ │ │ ├── Direction.java
│ │ │ └── Sequent.java
│ └── res
│ │ ├── anim
│ │ ├── bounce_in.xml
│ │ ├── fade_in.xml
│ │ ├── fade_in_down.xml
│ │ ├── fade_in_left.xml
│ │ ├── fade_in_right.xml
│ │ ├── fade_in_up.xml
│ │ └── rotate_in.xml
│ │ └── values
│ │ └── strings.xml
│ └── test
│ └── java
│ └── com
│ └── fujiyuu75
│ └── sequent
│ └── ExampleUnitTest.java
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
2 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
3 |
4 | # User-specific stuff:
5 | .idea/**/workspace.xml
6 | .idea/**/tasks.xml
7 | .idea/dictionaries
8 |
9 | # Sensitive or high-churn files:
10 | .idea/**/dataSources/
11 | .idea/**/dataSources.ids
12 | .idea/**/dataSources.xml
13 | .idea/**/dataSources.local.xml
14 | .idea/**/sqlDataSources.xml
15 | .idea/**/dynamic.xml
16 | .idea/**/uiDesigner.xml
17 |
18 | # Gradle:
19 | .idea/**/gradle.xml
20 | .idea/**/libraries
21 |
22 | # CMake
23 | cmake-build-debug/
24 |
25 | # Mongo Explorer plugin:
26 | .idea/**/mongoSettings.xml
27 |
28 | ## File-based project format:
29 | *.iws
30 |
31 | ## Plugin-specific files:
32 |
33 | # IntelliJ
34 | /out/
35 |
36 | # mpeltonen/sbt-idea plugin
37 | .idea_modules/
38 |
39 | # JIRA plugin
40 | atlassian-ide-plugin.xml
41 |
42 | # Cursive Clojure plugin
43 | .idea/replstate.xml
44 |
45 | # Crashlytics plugin (for Android Studio and IntelliJ)
46 | com_crashlytics_export_strings.xml
47 | crashlytics.properties
48 | crashlytics-build.properties
49 | fabric.properties
50 |
51 | # Android Studio Origin.
52 | *.iml
53 | .gradle
54 | /local.properties
55 | /.idea/workspace.xml
56 | /.idea/libraries
57 | .DS_Store
58 | /build
59 | /captures
60 | .externalNativeBuild
61 | .idea
62 | /resources
63 | /gradle.properties
64 | /local.properties
65 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Sequent
2 |
3 |
4 |
5 | Sequent is a library that starts animation continuously for multiple views at regular intervals.
6 |
7 | ```
8 | # Views inheriting ViewGroup are available.
9 | # e.g. LinearLayout, RelativiLayout, framelayout, etc
10 | LinearLayout layout = (LinearLayout) v.findViewById(R.id.layout);
11 |
12 | # Just write a line. Default animation is Fadein.
13 | Sequent.origin(layout).start()
14 | ```
15 |
16 | You can change the animation settings.
17 |
18 | ```
19 | Sequent
20 | .origin(viewGroup)
21 | .duration(int) // option.
22 | .delay(int) // option. StartOffSet time.
23 | .offset(int) // option. Interval time.
24 | .flow(Direction) // option. Flow of animations in (FORWARD/BACKWARD/RANDOM).
25 | .anim(Context, Animation) or .anim(Context, int) // option. implemented Animation or ObjectAnimator xml resource.
26 | .start()
27 | ```
28 |
29 | Please use the following implemented animation effects.
30 |
31 | ```bounceIn``` ```fadeIn``` ```fadeInDown``` ```fadeInLeft``` ```fadeInRight``` ```fadeInUp``` ```rotateIn```
32 |
33 | ## Download
34 |
35 | ```
36 | dependencies {
37 | compile 'com.fujiyuu75:sequent:0.2.1'
38 | }
39 | ```
40 |
41 | Continuous animation library like Sequent is also available for [iOS](https://github.com/fujiyuu75/Sequents).
42 |
43 | ## Bugs and Feedback
44 |
45 | For bugs, questions and discussions please use the github issues.
46 |
47 | ## License
48 |
49 | ```
50 | Licensed under the Apache License, Version 2.0 (the "License");
51 | you may not use this file except in compliance with the License.
52 | You may obtain a copy of the License at
53 |
54 | http://www.apache.org/licenses/LICENSE-2.0
55 |
56 | Unless required by applicable law or agreed to in writing, software
57 | distributed under the License is distributed on an "AS IS" BASIS,
58 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
59 | See the License for the specific language governing permissions and
60 | limitations under the License.
61 | ```
62 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext.kotlin_version = '1.2.21'
5 | repositories {
6 | jcenter()
7 | maven {
8 | url 'https://maven.google.com/'
9 | name 'Google'
10 | }
11 | }
12 | dependencies {
13 | classpath 'com.android.tools.build:gradle:3.0.1'
14 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
15 | classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
16 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
17 | }
18 | }
19 |
20 | allprojects {
21 | repositories {
22 | jcenter()
23 | maven {
24 | url 'https://maven.google.com/'
25 | name 'Google'
26 | }
27 | }
28 | }
29 |
30 | task clean(type: Delete) {
31 | delete rootProject.buildDir
32 | }
33 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Jan 24 00:50:47 JST 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/sample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/sample/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'kotlin-android'
3 |
4 | android {
5 | compileSdkVersion 27
6 | buildToolsVersion "27.0.3"
7 | defaultConfig {
8 | applicationId "com.fujiyuu75.sequent.sample"
9 | minSdkVersion 14
10 | targetSdkVersion 27
11 | versionCode 1
12 | versionName "1.0"
13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14 | }
15 | buildTypes {
16 | release {
17 | minifyEnabled false
18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
19 | }
20 | }
21 | sourceSets {
22 | main.java.srcDirs += 'src/main/kotlin'
23 | }
24 | }
25 |
26 | dependencies {
27 | compile fileTree(dir: 'libs', include: ['*.jar'])
28 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
29 | exclude group: 'com.android.support', module: 'support-annotations'
30 | })
31 | compile project(':sequent')
32 | compile 'com.android.support:appcompat-v7:27.0.2'
33 | compile 'com.android.support.constraint:constraint-layout:1.1.0-beta4'
34 | testCompile 'junit:junit:4.12'
35 | compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.21"
36 | }
37 | repositories {
38 | mavenCentral()
39 | }
40 |
--------------------------------------------------------------------------------
/sample/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Applications/android-sdk-r24.2-macosx/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/sample/src/androidTest/java/com/fujiyuu75/sequent/sample/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.fujiyuu75.sequent.sample;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.fujiyuu75.sequent.sample", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/sample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/sample/src/main/kotlin/com/fujiyuu75/sequent/sample/AnimActivity.kt:
--------------------------------------------------------------------------------
1 | package com.fujiyuu75.sequent.sample
2 |
3 | import android.content.Intent
4 | import android.os.Bundle
5 | import android.support.v4.view.MenuItemCompat
6 | import android.support.v7.app.AppCompatActivity
7 | import android.view.Menu
8 | import android.view.MenuItem
9 | import android.view.View
10 | import android.widget.AdapterView
11 | import android.widget.ArrayAdapter
12 | import android.widget.LinearLayout
13 | import android.widget.Spinner
14 |
15 | import com.fujiyuu75.sequent.Animation
16 | import com.fujiyuu75.sequent.Sequent
17 |
18 | class AnimActivity : AppCompatActivity() {
19 |
20 | private var layout: LinearLayout? = null
21 |
22 | override fun onCreate(savedInstanceState: Bundle?) {
23 | super.onCreate(savedInstanceState)
24 | setContentView(R.layout.activity_anim)
25 |
26 | layout = findViewById(R.id.layout)
27 |
28 | findViewById(R.id.button).setOnClickListener { startActivity(Intent(applicationContext, SampleActivity::class.java)) }
29 | }
30 |
31 | override fun onCreateOptionsMenu(menu: Menu): Boolean {
32 | menuInflater.inflate(R.menu.animation, menu)
33 |
34 | val item = menu.findItem(R.id.spinner)
35 | val spinner = item.actionView as Spinner
36 |
37 | val adapter = ArrayAdapter.createFromResource(this,
38 | R.array.anims, android.R.layout.simple_spinner_item)
39 | adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
40 |
41 | spinner.adapter = adapter
42 |
43 | spinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
44 | override fun onItemSelected(parent: AdapterView<*>, view: View, position: Int, id: Long) {
45 | when (position) {
46 | 0 -> Sequent.origin(layout).anim(applicationContext, Animation.BOUNCE_IN).start()
47 | 1 -> Sequent.origin(layout).anim(applicationContext, Animation.FADE_IN).start()
48 | 2 -> Sequent.origin(layout).anim(applicationContext, Animation.FADE_IN_DOWN).start()
49 | 3 -> Sequent.origin(layout).anim(applicationContext, Animation.FADE_IN_LEFT).start()
50 | 4 -> Sequent.origin(layout).anim(applicationContext, Animation.FADE_IN_RIGHT).start()
51 | 5 -> Sequent.origin(layout).anim(applicationContext, Animation.FADE_IN_UP).start()
52 | 6 -> Sequent.origin(layout).anim(applicationContext, Animation.ROTATE_IN).start()
53 | }
54 | }
55 |
56 | override fun onNothingSelected(parent: AdapterView<*>) {}
57 | }
58 |
59 | return true
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/sample/src/main/kotlin/com/fujiyuu75/sequent/sample/SampleActivity.kt:
--------------------------------------------------------------------------------
1 | package com.fujiyuu75.sequent.sample
2 |
3 | import android.os.Bundle
4 | import android.support.v4.view.ViewPager
5 | import android.support.v7.app.AppCompatActivity
6 | import android.widget.LinearLayout
7 |
8 | class SampleActivity : AppCompatActivity() {
9 |
10 | private lateinit var viewPager: ViewPager
11 | private lateinit var navi1: LinearLayout
12 | private lateinit var navi2: LinearLayout
13 | private lateinit var navi3: LinearLayout
14 |
15 | override fun onCreate(savedInstanceState: Bundle?) {
16 | super.onCreate(savedInstanceState)
17 | setContentView(R.layout.activity_sample)
18 |
19 | viewPager = findViewById(R.id.pager)
20 | navi1 = findViewById(R.id.navi1)
21 | navi2 = findViewById(R.id.navi2)
22 | navi3 = findViewById(R.id.navi3)
23 |
24 | viewPager.apply {
25 | adapter = SampleViewPagerAdapter(supportFragmentManager)
26 | offscreenPageLimit = 0
27 | addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
28 | override fun onPageSelected(position: Int) {}
29 |
30 | override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {}
31 |
32 | override fun onPageScrollStateChanged(state: Int) {
33 | if (state != ViewPager.SCROLL_STATE_SETTLING) {
34 | return
35 | }
36 | val page = viewPager.currentItem
37 | when (page) {
38 | 0 -> {
39 | navi1.setBackgroundResource(R.drawable.tutorial_swipe_navi_selected)
40 | navi2.setBackgroundResource(R.drawable.tutorial_swipe_navi)
41 | navi3.setBackgroundResource(R.drawable.tutorial_swipe_navi)
42 | }
43 | 1 -> {
44 | navi1.setBackgroundResource(R.drawable.tutorial_swipe_navi)
45 | navi2.setBackgroundResource(R.drawable.tutorial_swipe_navi_selected)
46 | navi3.setBackgroundResource(R.drawable.tutorial_swipe_navi)
47 | }
48 | 2 -> {
49 | navi1.setBackgroundResource(R.drawable.tutorial_swipe_navi)
50 | navi2.setBackgroundResource(R.drawable.tutorial_swipe_navi)
51 | navi3.setBackgroundResource(R.drawable.tutorial_swipe_navi_selected)
52 | }
53 | }
54 | }
55 | })
56 | }
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/sample/src/main/kotlin/com/fujiyuu75/sequent/sample/SampleFragment1.kt:
--------------------------------------------------------------------------------
1 | package com.fujiyuu75.sequent.sample
2 |
3 | import android.os.Bundle
4 | import android.support.v4.app.Fragment
5 | import android.view.LayoutInflater
6 | import android.view.View
7 | import android.view.ViewGroup
8 | import android.widget.LinearLayout
9 |
10 | import com.fujiyuu75.sequent.Sequent
11 |
12 | class SampleFragment1 : Fragment() {
13 |
14 | private var layout: LinearLayout? = null
15 |
16 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
17 | return inflater.inflate(R.layout.fragment_sample_1, null)
18 | }
19 |
20 | override fun onViewCreated(v: View, savedInstanceState: Bundle?) {
21 | super.onViewCreated(v, savedInstanceState)
22 |
23 | layout = v.findViewById(R.id.image_layout)
24 | Sequent.origin(layout).anim(activity, R.anim.overshoot).start()
25 | }
26 |
27 | override fun setUserVisibleHint(isVisibleToUser: Boolean) {
28 | super.setUserVisibleHint(isVisibleToUser)
29 |
30 | if (isVisibleToUser && layout != null) {
31 | Sequent.origin(layout).anim(activity, R.anim.overshoot).start()
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/sample/src/main/kotlin/com/fujiyuu75/sequent/sample/SampleFragment2.kt:
--------------------------------------------------------------------------------
1 | package com.fujiyuu75.sequent.sample
2 |
3 | import android.os.Bundle
4 | import android.support.v4.app.Fragment
5 | import android.view.LayoutInflater
6 | import android.view.View
7 | import android.view.ViewGroup
8 | import android.widget.LinearLayout
9 |
10 | import com.fujiyuu75.sequent.Animation
11 | import com.fujiyuu75.sequent.Sequent
12 |
13 | class SampleFragment2 : Fragment() {
14 |
15 | private var layout: LinearLayout? = null
16 |
17 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
18 |
19 | return inflater.inflate(R.layout.fragment_sample_2, null)
20 | }
21 |
22 | override fun onViewCreated(v: View, savedInstanceState: Bundle?) {
23 | super.onViewCreated(v, savedInstanceState)
24 |
25 | layout = v.findViewById(R.id.image_layout)
26 | }
27 |
28 | override fun setUserVisibleHint(isVisibleToUser: Boolean) {
29 | super.setUserVisibleHint(isVisibleToUser)
30 |
31 | if (isVisibleToUser && layout != null) {
32 | Sequent.origin(layout).anim(activity, Animation.FADE_IN_UP).start()
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/sample/src/main/kotlin/com/fujiyuu75/sequent/sample/SampleFragment3.kt:
--------------------------------------------------------------------------------
1 | package com.fujiyuu75.sequent.sample
2 |
3 | import android.os.Bundle
4 | import android.support.v4.app.Fragment
5 | import android.view.LayoutInflater
6 | import android.view.View
7 | import android.view.ViewGroup
8 | import android.widget.LinearLayout
9 |
10 | import com.fujiyuu75.sequent.Sequent
11 |
12 | class SampleFragment3 : Fragment() {
13 |
14 | private var layout: LinearLayout? = null
15 |
16 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
17 |
18 | return inflater.inflate(R.layout.fragment_sample_3, null)
19 | }
20 |
21 | override fun onViewCreated(v: View, savedInstanceState: Bundle?) {
22 | super.onViewCreated(v, savedInstanceState)
23 |
24 | layout = v.findViewById(R.id.image_layout)
25 | }
26 |
27 | override fun setUserVisibleHint(isVisibleToUser: Boolean) {
28 | super.setUserVisibleHint(isVisibleToUser)
29 |
30 | if (isVisibleToUser && layout != null) {
31 | Sequent.origin(layout).anim(activity, R.anim.overshoot).start()
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/sample/src/main/kotlin/com/fujiyuu75/sequent/sample/SampleViewPagerAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.fujiyuu75.sequent.sample
2 |
3 | import android.support.v4.app.Fragment
4 | import android.support.v4.app.FragmentManager
5 | import android.support.v4.app.FragmentPagerAdapter
6 |
7 | internal class SampleViewPagerAdapter(fm: FragmentManager) : FragmentPagerAdapter(fm) {
8 |
9 | private val pageTitle = arrayOf("page1", "page2", "page3")
10 |
11 | override fun getItem(i: Int): Fragment = when (i) {
12 | 0 -> SampleFragment1()
13 | 1 -> SampleFragment2()
14 | 2 -> SampleFragment3()
15 | else -> SampleFragment1()
16 | }
17 |
18 | override fun getCount(): Int {
19 | return 3
20 | }
21 |
22 | override fun getPageTitle(position: Int): CharSequence? {
23 | return pageTitle[position]
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/sample/src/main/res/anim/overshoot.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
17 |
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/t1_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/sample/src/main/res/drawable/t1_1.png
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/t1_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/sample/src/main/res/drawable/t1_2.png
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/t1_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/sample/src/main/res/drawable/t1_3.png
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/t1_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/sample/src/main/res/drawable/t1_4.png
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/t1_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/sample/src/main/res/drawable/t1_5.png
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/t2_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/sample/src/main/res/drawable/t2_1.png
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/t2_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/sample/src/main/res/drawable/t2_2.png
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/t2_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/sample/src/main/res/drawable/t2_3.png
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/t2_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/sample/src/main/res/drawable/t2_4.png
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/t3_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/sample/src/main/res/drawable/t3_1.png
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/t3_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/sample/src/main/res/drawable/t3_2.png
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/t3_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/sample/src/main/res/drawable/t3_3.png
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/tutorial_swipe_navi.xml:
--------------------------------------------------------------------------------
1 |
4 |
6 |
8 |
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/tutorial_swipe_navi_selected.xml:
--------------------------------------------------------------------------------
1 |
4 |
6 |
8 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_anim.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
18 |
19 |
30 |
31 |
39 |
40 |
48 |
49 |
57 |
58 |
66 |
67 |
68 |
76 |
77 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_sample.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
12 |
13 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/fragment_sample_1.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
15 |
16 |
22 |
23 |
28 |
29 |
30 |
37 |
38 |
44 |
45 |
51 |
52 |
58 |
59 |
65 |
66 |
67 |
68 |
69 |
76 |
77 |
88 |
89 |
98 |
99 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/fragment_sample_2.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
15 |
16 |
22 |
23 |
28 |
29 |
30 |
37 |
38 |
45 |
46 |
53 |
54 |
61 |
62 |
63 |
64 |
65 |
72 |
73 |
84 |
85 |
94 |
95 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/fragment_sample_3.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
20 |
21 |
25 |
26 |
31 |
32 |
37 |
38 |
39 |
45 |
46 |
47 |
54 |
55 |
66 |
67 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/view_sample_next_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
17 |
18 |
24 |
25 |
33 |
34 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/sample/src/main/res/menu/animation.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/sample/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/sample/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/sample/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/sample/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/sample/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fujiyuu75/Sequent/437f730fd20c4edf5e776dc2c1cb138259aeb444/sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/sample/src/main/res/values/array.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | - bounceIn
4 | - fadeIn
5 | - fadeInDown
6 | - fadeInLeft
7 | - fadeInRight
8 | - fadeInUp
9 | - rotateIn
10 |
11 |
12 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 | #000000
7 | #FFF
8 | #383838
9 | #CCC
10 | #5AAFEE
11 | #FCB64B
12 | #FFF
13 | #00000000
14 | #99000000
15 |
16 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 12.0sp
3 | 14.0sp
4 | 18.0sp
5 | 22.0sp
6 | 24.0sp
7 | 36.0sp
8 | 4.0sp
9 | 8.0sp
10 | 4.0dp
11 | 6.0dp
12 | 8.0dp
13 | 12.0dp
14 | 16.0dp
15 | 24.0dp
16 |
17 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Sequent-Demo
3 | Sequent
4 | This is Sequent Demo App.
5 | Sequent is so simple library.
6 | you just add one liner in your code.
7 | Please see the demo!!
8 | Offset/Duration Setting
9 | You could change offset and duration time.
10 | Custom Animation
11 | It is easy to customize the animation.
12 | Thank you for seeing!!
13 | Sequent welcomes contributions.
14 |
15 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/sample/src/test/java/com/fujiyuu75/sequent/sample/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.fujiyuu75.sequent.sample;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/sequent/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/sequent/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | // change all of these as necessary
4 | ext {
5 | bintrayRepo = 'maven' // this is the same as whatever you called your repository in Bintray
6 | bintrayName = 'sequent' // your bintray package name. I am calling it the same as my library name.
7 |
8 | publishedGroupId = 'com.fujiyuu75'
9 | libraryName = 'sequent'
10 | artifact = 'sequent' // I'm calling it the same as my library name
11 |
12 | libraryDescription = 'A simple continuous animation library for Android UI.'
13 |
14 | siteUrl = 'https://github.com/fujiyuu75/Sequent'
15 | gitUrl = 'https://github.com/fujiyuu75/Sequent.git'
16 |
17 | libraryVersion = '0.2.1'
18 |
19 | developerId = 'fujiyuu75' // Maven plugin uses this. I don't know if it needs to be anything special.
20 | developerName = 'Yuichi Fujikawa'
21 | developerEmail = 'fujiyuu75@gmail.com'
22 |
23 | licenseName = 'Apache License, Version 2.0 (Apache-2.0)'
24 | licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0'
25 | allLicenses = ["Apache-2.0"]
26 | }
27 |
28 | android {
29 | compileSdkVersion 25
30 | buildToolsVersion "25.0.2"
31 |
32 | lintOptions {
33 | abortOnError false
34 | disable 'TypographyFractions','TypographyQuotes'
35 | }
36 |
37 | defaultConfig {
38 | minSdkVersion 14
39 | targetSdkVersion 25
40 | versionCode 1
41 | versionName "1.0"
42 |
43 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
44 |
45 | }
46 | buildTypes {
47 | release {
48 | minifyEnabled false
49 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
50 | }
51 | }
52 | }
53 |
54 | dependencies {
55 | compile fileTree(dir: 'libs', include: ['*.jar'])
56 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
57 | exclude group: 'com.android.support', module: 'support-annotations'
58 | })
59 | compile 'com.android.support:appcompat-v7:25.3.1'
60 | testCompile 'junit:junit:4.12'
61 | }
62 |
63 | // Maven section
64 | // You shouldn't need to change anything. It just uses the
65 | // values you set above.
66 |
67 | apply plugin: 'com.github.dcendents.android-maven'
68 |
69 | group = publishedGroupId // Maven Group ID for the artifact
70 |
71 | install {
72 | repositories.mavenInstaller {
73 | pom {
74 | project {
75 | packaging 'aar'
76 | name publishedGroupId
77 | artifactId artifact
78 |
79 | // Add your description here
80 | name libraryName
81 | description libraryDescription
82 | url siteUrl
83 |
84 | // Set your license
85 | licenses {
86 | license {
87 | name licenseName
88 | url licenseUrl
89 | }
90 | }
91 | developers {
92 | developer {
93 | id developerId
94 | name developerName
95 | email developerEmail
96 | }
97 | }
98 | scm {
99 | connection gitUrl
100 | developerConnection gitUrl
101 | url siteUrl
102 | }
103 | }
104 | }
105 | }
106 | }
107 |
108 | // Bintray section
109 | // As long as you add bintray.user and bintray.apikey to the local.properties
110 | // file, you shouldn't have to change anything here. The reason you
111 | // don't just write them here is so that they won't be publicly visible
112 | // in GitHub or wherever your source control is.
113 |
114 | apply plugin: 'com.jfrog.bintray'
115 |
116 | version = libraryVersion
117 |
118 | if (project.hasProperty("android")) { // Android libraries
119 | task sourcesJar(type: Jar) {
120 | classifier = 'sources'
121 | from android.sourceSets.main.java.srcDirs
122 | }
123 |
124 | task javadoc(type: Javadoc) {
125 | source = android.sourceSets.main.java.srcDirs
126 | classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
127 | }
128 | } else { // Java libraries
129 | task sourcesJar(type: Jar, dependsOn: classes) {
130 | classifier = 'sources'
131 | from sourceSets.main.allSource
132 | }
133 | }
134 |
135 | task javadocJar(type: Jar, dependsOn: javadoc) {
136 | classifier = 'javadoc'
137 | from javadoc.destinationDir
138 | }
139 |
140 | artifacts {
141 | archives javadocJar
142 | archives sourcesJar
143 | }
144 |
145 | Properties properties = new Properties()
146 | properties.load(project.rootProject.file('local.properties').newDataInputStream())
147 |
148 | bintray {
149 | user = properties.getProperty("bintray.user")
150 | key = properties.getProperty("bintray.apikey")
151 |
152 | configurations = ['archives']
153 | pkg {
154 | repo = bintrayRepo
155 | name = bintrayName
156 | desc = libraryDescription
157 | websiteUrl = siteUrl
158 | vcsUrl = gitUrl
159 | licenses = allLicenses
160 | publish = true
161 | publicDownloadNumbers = true
162 | version {
163 | desc = libraryDescription
164 | gpg {
165 | // optional GPG encryption. Default is false.
166 | sign = false
167 | //passphrase = properties.getProperty("bintray.gpg.password")
168 | }
169 | }
170 | }
171 | }
172 |
--------------------------------------------------------------------------------
/sequent/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Applications/android-sdk-r24.2-macosx/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/sequent/src/androidTest/java/com/fujiyuu75/sequent/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.fujiyuu75.sequent;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.fujiyuu75.Sequent.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/sequent/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/sequent/src/main/java/com/fujiyuu75/sequent/Animation.java:
--------------------------------------------------------------------------------
1 | package com.fujiyuu75.sequent;
2 |
3 | /**
4 | * Created by y_fujikawa on 2017/05/26.
5 | */
6 |
7 | public enum Animation {
8 | BOUNCE_IN(R.anim.bounce_in),
9 | FADE_IN(R.anim.fade_in),
10 | FADE_IN_DOWN(R.anim.fade_in_down),
11 | FADE_IN_UP(R.anim.fade_in_up),
12 | FADE_IN_LEFT(R.anim.fade_in_left),
13 | FADE_IN_RIGHT(R.anim.fade_in_right),
14 | ROTATE_IN(R.anim.rotate_in),;
15 |
16 | private int animId;
17 |
18 | Animation(int animId) {
19 | this.animId = animId;
20 | }
21 |
22 | public int getAnimId() {
23 | return this.animId;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/sequent/src/main/java/com/fujiyuu75/sequent/Direction.java:
--------------------------------------------------------------------------------
1 | package com.fujiyuu75.sequent;
2 |
3 | /**
4 | * Created by y_fujikawa on 2017/05/26.
5 | */
6 |
7 | public enum Direction {
8 | FORWARD,
9 | BACKWARD,
10 | RANDOM
11 | }
12 |
--------------------------------------------------------------------------------
/sequent/src/main/java/com/fujiyuu75/sequent/Sequent.java:
--------------------------------------------------------------------------------
1 | package com.fujiyuu75.sequent;
2 |
3 | import android.animation.Animator;
4 | import android.animation.AnimatorInflater;
5 | import android.animation.AnimatorSet;
6 | import android.animation.ObjectAnimator;
7 | import android.content.Context;
8 | import android.support.v4.view.ViewCompat;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 |
12 | import java.util.ArrayList;
13 | import java.util.Collections;
14 | import java.util.List;
15 |
16 | public class Sequent {
17 | private List viewList = new ArrayList<>();
18 | private final int startOffset;
19 | private final int duration;
20 | private final int delay;
21 | private final Direction direction;
22 | private final Context context;
23 | private final int animId;
24 | private final Animation anim;
25 |
26 | public static class Builder {
27 | private static final int DEFAULT_OFFSET = 100;
28 | private static final int DEFAULT_DURATION = 500;
29 | private static final int DEFAULT_DELAY = 0;
30 |
31 | private ViewGroup vg;
32 | private int startOffset = DEFAULT_OFFSET;
33 | private int duration = DEFAULT_DURATION;
34 | private int delay = DEFAULT_DURATION;
35 | private Direction direction = Direction.FORWARD;
36 | private Context context;
37 | private int animId;
38 | private Animation anim;
39 |
40 | Builder(ViewGroup vg) {
41 | this.vg = vg;
42 | }
43 |
44 | public Builder offset(int offset) {
45 | this.startOffset = offset;
46 | return this;
47 | }
48 |
49 | public Builder duration(int duration) {
50 | this.duration = duration;
51 | return this;
52 | }
53 |
54 | public Builder delay(int delay) {
55 | this.delay = delay;
56 | return this;
57 | }
58 |
59 | public Builder flow(Direction direction) {
60 | this.direction = direction;
61 | return this;
62 | }
63 |
64 | public Builder anim(Context context, int animId) {
65 | this.context = context;
66 | this.animId = animId;
67 | return this;
68 | }
69 |
70 | public Builder anim(Context context, Animation anim) {
71 | this.context = context;
72 | this.anim = anim;
73 | return this;
74 | }
75 |
76 | public Sequent start() {
77 | return new Sequent(this);
78 | }
79 | }
80 |
81 | public static Builder origin(ViewGroup vg) {
82 | return new Builder(vg);
83 | }
84 |
85 | private Sequent(Builder builder) {
86 | this.startOffset = builder.startOffset;
87 | this.duration = builder.duration;
88 | this.delay = builder.delay;
89 | this.direction = builder.direction;
90 | this.context = builder.context;
91 | this.animId = builder.animId;
92 | this.anim = builder.anim;
93 |
94 | ViewGroup vg = builder.vg;
95 | fetchChildLayouts(vg);
96 | arrangeLayouts(viewList);
97 | setAnimation();
98 | }
99 |
100 | private void fetchChildLayouts(ViewGroup viewGroup) {
101 | int count = viewGroup.getChildCount();
102 |
103 | for (int i = 0; i < count; i++) {
104 | View view = viewGroup.getChildAt(i);
105 | if (view instanceof ViewGroup) {
106 | fetchChildLayouts((ViewGroup) view);
107 | } else {
108 | if (view.getVisibility() == View.VISIBLE) {
109 | view.setVisibility(View.INVISIBLE);
110 | viewList.add(view);
111 | }
112 | }
113 | }
114 | }
115 |
116 | private List arrangeLayouts(List viewList) {
117 | switch (direction) {
118 | case BACKWARD:
119 | Collections.reverse(viewList);
120 | break;
121 | case RANDOM:
122 | Collections.shuffle(viewList);
123 | break;
124 | }
125 | return viewList;
126 | }
127 |
128 | private void setAnimation() {
129 | int count = viewList.size();
130 | for (int i = 0; i < count; i++) {
131 | final View view = viewList.get(i);
132 | final int offset = i * startOffset;
133 |
134 | resetAnimation(view);
135 |
136 | List animatorList = new ArrayList<>();
137 | animatorList.add(getStartObjectAnimator(offset, view));
138 |
139 | if (animId != 0) {
140 | animatorList.add(getResAnimator(context, animId, view));
141 | } else if (anim != null){
142 | animatorList.add(getResAnimator(context, anim.getAnimId(), view));
143 | } else {
144 | animatorList.add(ObjectAnimator.ofFloat(view, View.ALPHA, 0, 1));
145 | }
146 |
147 | AnimatorSet set = new AnimatorSet();
148 | set.playTogether(animatorList);
149 | set.setDuration(duration);
150 | if (delay == 0) {
151 | set.setStartDelay(i * startOffset);
152 | } else if (i == 0) {
153 | set.setStartDelay(delay);
154 | } else {
155 | set.setStartDelay((i * startOffset) + delay);
156 | }
157 | set.start();
158 | }
159 | }
160 |
161 | private void resetAnimation(View view) {
162 | ViewCompat.setAlpha(view, 1);
163 | ViewCompat.setScaleX(view, 1);
164 | ViewCompat.setScaleY(view, 1);
165 | ViewCompat.setTranslationX(view, 0);
166 | ViewCompat.setTranslationY(view, 0);
167 | ViewCompat.setRotation(view, 0);
168 | ViewCompat.setRotationY(view, 0);
169 | ViewCompat.setRotationX(view, 0);
170 | }
171 |
172 | private ObjectAnimator getStartObjectAnimator(int offset, final View view) {
173 | ObjectAnimator ob = ObjectAnimator.ofFloat(view, View.ALPHA, 0, 1);
174 | ob.setDuration(1).setStartDelay(offset);
175 | ob.addListener(new Animator.AnimatorListener() {
176 | @Override
177 | public void onAnimationStart(Animator anim) {
178 | view.setVisibility(View.VISIBLE);
179 | }
180 |
181 | @Override
182 | public void onAnimationRepeat(Animator anim) {
183 | }
184 |
185 | @Override
186 | public void onAnimationEnd(Animator anim) {
187 | }
188 |
189 | @Override
190 | public void onAnimationCancel(Animator anim) {
191 | }
192 | });
193 | return ob;
194 | }
195 |
196 | private Animator getResAnimator(Context context, int animId, View view) {
197 | Animator anim = AnimatorInflater.loadAnimator(context, animId);
198 | anim.setTarget(view);
199 | return anim;
200 | }
201 | }
202 |
--------------------------------------------------------------------------------
/sequent/src/main/res/anim/bounce_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
11 |
18 |
19 |
26 |
--------------------------------------------------------------------------------
/sequent/src/main/res/anim/fade_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
11 |
15 |
16 |
21 |
22 |
--------------------------------------------------------------------------------
/sequent/src/main/res/anim/fade_in_down.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
11 |
15 |
16 |
21 |
22 |
28 |
29 |
--------------------------------------------------------------------------------
/sequent/src/main/res/anim/fade_in_left.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
11 |
12 |
19 |
20 |
--------------------------------------------------------------------------------
/sequent/src/main/res/anim/fade_in_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
11 |
12 |
19 |
20 |
--------------------------------------------------------------------------------
/sequent/src/main/res/anim/fade_in_up.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
11 |
15 |
16 |
21 |
22 |
28 |
29 |
--------------------------------------------------------------------------------
/sequent/src/main/res/anim/rotate_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
9 |
10 |
16 |
--------------------------------------------------------------------------------
/sequent/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Sequent
3 |
4 |
--------------------------------------------------------------------------------
/sequent/src/test/java/com/fujiyuu75/sequent/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.fujiyuu75.sequent;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':sample', ':sequent'
2 |
--------------------------------------------------------------------------------