diff --git a/README.md b/README.md index 8a0cd88..383f05b 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ [![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://raw.githubusercontent.com/Cuberto/flashy-tabbar-android/master/LICENSE) +[![](https://jitpack.io/v/Udhayarajan/liquid-swipe-android.svg)](https://jitpack.io/#Udhayarajan/liquid-swipe-android) + ![Animation](https://raw.githubusercontent.com/Cuberto/liquid-swipe/master/Screenshots/animation.gif) ## Requirements @@ -10,52 +12,40 @@ ## Example -To run the example project, clone the repo, and run `app` +To run the example project, clone the repo, and run `sample` ### As library #### GitHub Packages -Step 1 : Generate a Personal Access Token for GitHub -- Inside you GitHub account: -- Settings -> Developer Settings -> Personal Access Tokens -> Generate new token -- Make sure you select the following scopes (“ read:packages”) and Generate a token -- After Generating make sure to copy your new personal access token. You cannot see it again! The only option is to generate a new key. - -Step 2: Store your GitHub — Personal Access Token details -- Create a github.properties file within your root Android project -- In case of a public repository make sure you add this file to .gitignore for keep the token private -- Add properties gpr.usr=GITHUB_USERID and gpr.key=PERSONAL_ACCESS_TOKEN -- Replace GITHUB_USERID with personal / organisation Github User ID and PERSONAL_ACCESS_TOKEN with the token generated in #Step 1 - -Step 3 : Update build.gradle inside the application module -- Add the following code to build.gradle inside the app module that will be using the library +Step 1 : Update root `build.gradle(Project: )` +- In Android Studio -> Make sure that you have selected `Android` + +![image](https://user-images.githubusercontent.com/77388817/120667372-0ce94d00-c4ab-11eb-8700-8676f7b15e84.png) +- Under Gradle Scripts 1st File is root build.gradle + +![image](https://user-images.githubusercontent.com/77388817/120668108-c6e0b900-c4ab-11eb-9e5e-6bbeec2a2e36.png) +- Add following code in 1st file: ``` - def githubProperties = new Properties() - githubProperties.load(new FileInputStream(rootProject.file("github.properties"))) - repositories { - maven { - name = "GitHubPackages" - - url = uri("https://maven.pkg.github.com/Cuberto/liquid-swipe-android") - credentials { - /** Create github.properties in root project folder file with - ** gpr.usr=GITHUB_USER_ID & gpr.key=PERSONAL_ACCESS_TOKEN - ** Or set env variable GPR_USER & GPR_API_KEY if not adding a properties file**/ - username = githubProperties['gpr.usr'] ?: System.getenv("GPR_USER") - password = githubProperties['gpr.key'] ?: System.getenv("GPR_API_KEY") - } - } + allprojects { + repositories { + ... + maven { url 'https://jitpack.io' } + } } ``` + +Step 2: Update app `build.gradle(Module: .app)` +- Now open second file - inside dependencies of the build.gradle of app module, use the following code ``` dependencies { - //consume library - implementation 'com.cuberto:liquid-swipe:1.0.0' - .... + ... + implementation 'com.github.Udhayarajan:liquid-swipe-android:1.0.1' } ``` + + Sync project and now you can use flashytabbar library ## Usage diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index 42639a2..0000000 --- a/app/build.gradle +++ /dev/null @@ -1,36 +0,0 @@ -apply plugin: 'com.android.application' - -apply plugin: 'kotlin-android' - -apply plugin: 'kotlin-android-extensions' - -android { - compileSdkVersion 29 - buildToolsVersion "29.0.2" - defaultConfig { - applicationId "com.cuberto.liquidswipetest" - minSdkVersion 21 - targetSdkVersion 29 - versionCode 1 - versionName "1.0" - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'androidx.appcompat:appcompat:1.0.2' - implementation 'androidx.core:core-ktx:1.0.2' - implementation 'androidx.constraintlayout:constraintlayout:1.1.3' - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test.ext:junit:1.1.0' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' - implementation project(':liquid-swipe') -} diff --git a/build.gradle b/build.gradle index 8202308..ebef07f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,14 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.3.50' + ext.kotlin_version = '1.4.32' repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.2' + classpath 'com.android.tools.build:gradle:4.1.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -19,10 +19,13 @@ allprojects { repositories { google() jcenter() - + maven { + url "https://jitpack.io" + } } } + task clean(type: Delete) { delete rootProject.buildDir } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..62d4c05 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 175708a..622ab64 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Fri Nov 15 16:50:20 MSK 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip diff --git a/gradlew b/gradlew index cccdd3d..fbd7c51 100755 --- a/gradlew +++ b/gradlew @@ -1,5 +1,21 @@ #!/usr/bin/env sh +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + ############################################################################## ## ## Gradle start up script for UN*X @@ -28,7 +44,7 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -66,6 +82,7 @@ esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then @@ -109,10 +126,11 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath @@ -138,19 +156,19 @@ if $cygwin ; then else eval `echo args$i`="\"$arg\"" fi - i=$((i+1)) + i=`expr $i + 1` done case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi @@ -159,14 +177,9 @@ save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } -APP_ARGS=$(save "$@") +APP_ARGS=`save "$@"` # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index f955316..5093609 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -13,8 +29,11 @@ if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome @@ -65,6 +84,7 @@ set CMD_LINE_ARGS=%* set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% diff --git a/app/.gitignore b/liquid-swipe-android/.gitignore similarity index 100% rename from app/.gitignore rename to liquid-swipe-android/.gitignore diff --git a/liquid-swipe-android/build.gradle b/liquid-swipe-android/build.gradle new file mode 100644 index 0000000..07d84e4 --- /dev/null +++ b/liquid-swipe-android/build.gradle @@ -0,0 +1,78 @@ +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'maven-publish' +} + +android { + compileSdkVersion 30 + buildToolsVersion "30.0.3" + + + defaultConfig { + minSdkVersion 21 + targetSdkVersion 30 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles 'consumer-rules.pro' + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + } + +} + +dependencies { + + implementation fileTree(dir: 'libs', include: ['*.jar']) + + implementation 'androidx.appcompat:appcompat:1.3.0' + implementation 'androidx.core:core-ktx:1.5.0' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.2' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + +} + + +// Because the components are created only during the afterEvaluate phase, you must +// configure your publications using the afterEvaluate() lifecycle method. +afterEvaluate { + publishing { + publications { + // Creates a Maven publication called "release". + release(MavenPublication) { + // Applies the component for the release build variant. + from components.release + + // You can then customize attributes of the publication as shown below. + groupId = 'com.Cuberto.liquid-swipe-android' + artifactId = 'final' + version = '1.0.0' + } + // Creates a Maven publication called “debug”. + debug(MavenPublication) { + // Applies the component for the debug build variant. + from components.debug + + groupId = 'com.Cuberto.liquid-swipe-android' + artifactId = 'final-debug' + version = '1.0.0' + + } + } + } +} \ No newline at end of file diff --git a/liquid-swipe/consumer-rules.pro b/liquid-swipe-android/consumer-rules.pro similarity index 100% rename from liquid-swipe/consumer-rules.pro rename to liquid-swipe-android/consumer-rules.pro diff --git a/app/proguard-rules.pro b/liquid-swipe-android/proguard-rules.pro similarity index 100% rename from app/proguard-rules.pro rename to liquid-swipe-android/proguard-rules.pro diff --git a/liquid-swipe/src/androidTest/java/com/cuberto/liquid_swipe/ExampleInstrumentedTest.kt b/liquid-swipe-android/src/androidTest/java/com/cuberto/liquid_swipe/ExampleInstrumentedTest.kt similarity index 100% rename from liquid-swipe/src/androidTest/java/com/cuberto/liquid_swipe/ExampleInstrumentedTest.kt rename to liquid-swipe-android/src/androidTest/java/com/cuberto/liquid_swipe/ExampleInstrumentedTest.kt diff --git a/liquid-swipe/src/main/AndroidManifest.xml b/liquid-swipe-android/src/main/AndroidManifest.xml similarity index 100% rename from liquid-swipe/src/main/AndroidManifest.xml rename to liquid-swipe-android/src/main/AndroidManifest.xml diff --git a/liquid-swipe/src/main/java/com/cuberto/liquid_swipe/EdgeController.kt b/liquid-swipe-android/src/main/java/com/cuberto/liquid_swipe/EdgeController.kt similarity index 100% rename from liquid-swipe/src/main/java/com/cuberto/liquid_swipe/EdgeController.kt rename to liquid-swipe-android/src/main/java/com/cuberto/liquid_swipe/EdgeController.kt diff --git a/liquid-swipe/src/main/java/com/cuberto/liquid_swipe/LiquidPager.kt b/liquid-swipe-android/src/main/java/com/cuberto/liquid_swipe/LiquidPager.kt similarity index 100% rename from liquid-swipe/src/main/java/com/cuberto/liquid_swipe/LiquidPager.kt rename to liquid-swipe-android/src/main/java/com/cuberto/liquid_swipe/LiquidPager.kt diff --git a/liquid-swipe/src/main/java/com/cuberto/liquid_swipe/ViewI.kt b/liquid-swipe-android/src/main/java/com/cuberto/liquid_swipe/ViewI.kt similarity index 100% rename from liquid-swipe/src/main/java/com/cuberto/liquid_swipe/ViewI.kt rename to liquid-swipe-android/src/main/java/com/cuberto/liquid_swipe/ViewI.kt diff --git a/liquid-swipe/src/main/java/com/cuberto/liquid_swipe/animation/AnimationHelper.kt b/liquid-swipe-android/src/main/java/com/cuberto/liquid_swipe/animation/AnimationHelper.kt similarity index 100% rename from liquid-swipe/src/main/java/com/cuberto/liquid_swipe/animation/AnimationHelper.kt rename to liquid-swipe-android/src/main/java/com/cuberto/liquid_swipe/animation/AnimationHelper.kt diff --git a/liquid-swipe/src/main/java/com/cuberto/liquid_swipe/animation/Direction.kt b/liquid-swipe-android/src/main/java/com/cuberto/liquid_swipe/animation/Direction.kt similarity index 100% rename from liquid-swipe/src/main/java/com/cuberto/liquid_swipe/animation/Direction.kt rename to liquid-swipe-android/src/main/java/com/cuberto/liquid_swipe/animation/Direction.kt diff --git a/liquid-swipe/src/main/java/com/cuberto/liquid_swipe/animation/LeftEdgeController.kt b/liquid-swipe-android/src/main/java/com/cuberto/liquid_swipe/animation/LeftEdgeController.kt similarity index 100% rename from liquid-swipe/src/main/java/com/cuberto/liquid_swipe/animation/LeftEdgeController.kt rename to liquid-swipe-android/src/main/java/com/cuberto/liquid_swipe/animation/LeftEdgeController.kt diff --git a/liquid-swipe/src/main/java/com/cuberto/liquid_swipe/animation/RightEdgeController.kt b/liquid-swipe-android/src/main/java/com/cuberto/liquid_swipe/animation/RightEdgeController.kt similarity index 100% rename from liquid-swipe/src/main/java/com/cuberto/liquid_swipe/animation/RightEdgeController.kt rename to liquid-swipe-android/src/main/java/com/cuberto/liquid_swipe/animation/RightEdgeController.kt diff --git a/liquid-swipe/src/main/java/com/cuberto/liquid_swipe/animation/WaveLayer.kt b/liquid-swipe-android/src/main/java/com/cuberto/liquid_swipe/animation/WaveLayer.kt similarity index 100% rename from liquid-swipe/src/main/java/com/cuberto/liquid_swipe/animation/WaveLayer.kt rename to liquid-swipe-android/src/main/java/com/cuberto/liquid_swipe/animation/WaveLayer.kt diff --git a/liquid-swipe/src/main/res/drawable/ic_button.xml b/liquid-swipe-android/src/main/res/drawable/ic_button.xml similarity index 100% rename from liquid-swipe/src/main/res/drawable/ic_button.xml rename to liquid-swipe-android/src/main/res/drawable/ic_button.xml diff --git a/liquid-swipe/src/main/res/values/attrs.xml b/liquid-swipe-android/src/main/res/values/attrs.xml similarity index 100% rename from liquid-swipe/src/main/res/values/attrs.xml rename to liquid-swipe-android/src/main/res/values/attrs.xml diff --git a/liquid-swipe/src/main/res/values/strings.xml b/liquid-swipe-android/src/main/res/values/strings.xml similarity index 100% rename from liquid-swipe/src/main/res/values/strings.xml rename to liquid-swipe-android/src/main/res/values/strings.xml diff --git a/liquid-swipe/src/test/java/com/cuberto/liquid_swipe/ExampleUnitTest.kt b/liquid-swipe-android/src/test/java/com/cuberto/liquid_swipe/ExampleUnitTest.kt similarity index 100% rename from liquid-swipe/src/test/java/com/cuberto/liquid_swipe/ExampleUnitTest.kt rename to liquid-swipe-android/src/test/java/com/cuberto/liquid_swipe/ExampleUnitTest.kt diff --git a/liquid-swipe/build.gradle b/liquid-swipe/build.gradle deleted file mode 100644 index 2812fa3..0000000 --- a/liquid-swipe/build.gradle +++ /dev/null @@ -1,71 +0,0 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' -apply plugin: 'maven-publish' - -def githubProperties = new Properties() -githubProperties.load(new FileInputStream(rootProject.file("github.properties"))) - -def getVersionName = { -> - return "1.0.0" -} - -def getArtificatId = { -> - return "liquid-swipe" -} - -publishing { - publications { - bar(MavenPublication) { - groupId 'com.cuberto' - artifactId getArtificatId() - version getVersionName() - artifact("$buildDir/outputs/aar/${getArtificatId()}-release.aar") - } - } - - repositories { - maven { - name = "GitHubPackages" - url = uri("https://maven.pkg.github.com/Cuberto/liquid-swipe-android") - credentials { - username = githubProperties['gpr.usr'] ?: System.getenv("GPR_USER") - password = githubProperties['gpr.key'] ?: System.getenv("GPR_API_KEY") - } - } - } -} - -android { - compileSdkVersion 29 - buildToolsVersion "29.0.2" - - - defaultConfig { - minSdkVersion 21 - targetSdkVersion 29 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles 'consumer-rules.pro' - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'androidx.appcompat:appcompat:1.1.0' - implementation 'androidx.core:core-ktx:1.1.0' - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test.ext:junit:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' -} diff --git a/liquid-swipe/.gitignore b/sample/.gitignore similarity index 53% rename from liquid-swipe/.gitignore rename to sample/.gitignore index d0b97c6..e8fa30f 100644 --- a/liquid-swipe/.gitignore +++ b/sample/.gitignore @@ -1,2 +1,2 @@ /build -*.iml \ No newline at end of file +*.iml diff --git a/sample/build.gradle b/sample/build.gradle new file mode 100644 index 0000000..5bd2181 --- /dev/null +++ b/sample/build.gradle @@ -0,0 +1,49 @@ +plugins{ + id 'com.android.application' + id 'kotlin-android' +} + + + +android { + compileSdkVersion 30 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.cuberto.liquidswipetest" + minSdkVersion 21 + targetSdkVersion 30 + versionCode 1 + versionName "1.0" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + multiDexEnabled true + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + } + +} + +dependencies { + + implementation fileTree(dir: 'libs', include: ['*.jar']) + + implementation 'androidx.appcompat:appcompat:1.3.0' + implementation 'androidx.core:core-ktx:1.5.0' + implementation 'androidx.constraintlayout:constraintlayout:2.0.4' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.2' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + + + implementation project(':liquid-swipe-android') +} diff --git a/liquid-swipe/proguard-rules.pro b/sample/proguard-rules.pro similarity index 100% rename from liquid-swipe/proguard-rules.pro rename to sample/proguard-rules.pro diff --git a/app/src/androidTest/java/com/cuberto/liquidswipetest/ExampleInstrumentedTest.kt b/sample/src/androidTest/java/com/cuberto/liquidswipetest/ExampleInstrumentedTest.kt similarity index 100% rename from app/src/androidTest/java/com/cuberto/liquidswipetest/ExampleInstrumentedTest.kt rename to sample/src/androidTest/java/com/cuberto/liquidswipetest/ExampleInstrumentedTest.kt diff --git a/app/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml similarity index 100% rename from app/src/main/AndroidManifest.xml rename to sample/src/main/AndroidManifest.xml diff --git a/app/src/main/java/com/cuberto/liquidswipetest/Adapter.kt b/sample/src/main/java/com/cuberto/liquidswipetest/Adapter.kt similarity index 89% rename from app/src/main/java/com/cuberto/liquidswipetest/Adapter.kt rename to sample/src/main/java/com/cuberto/liquidswipetest/Adapter.kt index 838d9ac..c627c8a 100644 --- a/app/src/main/java/com/cuberto/liquidswipetest/Adapter.kt +++ b/sample/src/main/java/com/cuberto/liquidswipetest/Adapter.kt @@ -5,7 +5,8 @@ import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentPagerAdapter -class Adapter(fragmentManager: FragmentManager) : FragmentPagerAdapter(fragmentManager) { +class Adapter(fragmentManager: FragmentManager) : FragmentPagerAdapter(fragmentManager, + FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) { private val total: Int = 6 private val data : ArrayList = ArrayList(total) diff --git a/app/src/main/java/com/cuberto/liquidswipetest/MainActivity.kt b/sample/src/main/java/com/cuberto/liquidswipetest/MainActivity.kt similarity index 100% rename from app/src/main/java/com/cuberto/liquidswipetest/MainActivity.kt rename to sample/src/main/java/com/cuberto/liquidswipetest/MainActivity.kt diff --git a/app/src/main/java/com/cuberto/liquidswipetest/PageFragment.kt b/sample/src/main/java/com/cuberto/liquidswipetest/PageFragment.kt similarity index 100% rename from app/src/main/java/com/cuberto/liquidswipetest/PageFragment.kt rename to sample/src/main/java/com/cuberto/liquidswipetest/PageFragment.kt diff --git a/app/src/main/res/drawable-hdpi/circles_1.png b/sample/src/main/res/drawable-hdpi/circles_1.png similarity index 100% rename from app/src/main/res/drawable-hdpi/circles_1.png rename to sample/src/main/res/drawable-hdpi/circles_1.png diff --git a/app/src/main/res/drawable-hdpi/circles_2.png b/sample/src/main/res/drawable-hdpi/circles_2.png similarity index 100% rename from app/src/main/res/drawable-hdpi/circles_2.png rename to sample/src/main/res/drawable-hdpi/circles_2.png diff --git a/app/src/main/res/drawable-hdpi/img_1.png b/sample/src/main/res/drawable-hdpi/img_1.png similarity index 100% rename from app/src/main/res/drawable-hdpi/img_1.png rename to sample/src/main/res/drawable-hdpi/img_1.png diff --git a/app/src/main/res/drawable-hdpi/img_2.png b/sample/src/main/res/drawable-hdpi/img_2.png similarity index 100% rename from app/src/main/res/drawable-hdpi/img_2.png rename to sample/src/main/res/drawable-hdpi/img_2.png diff --git a/app/src/main/res/drawable-mdpi/circles_1.png b/sample/src/main/res/drawable-mdpi/circles_1.png similarity index 100% rename from app/src/main/res/drawable-mdpi/circles_1.png rename to sample/src/main/res/drawable-mdpi/circles_1.png diff --git a/app/src/main/res/drawable-mdpi/circles_2.png b/sample/src/main/res/drawable-mdpi/circles_2.png similarity index 100% rename from app/src/main/res/drawable-mdpi/circles_2.png rename to sample/src/main/res/drawable-mdpi/circles_2.png diff --git a/app/src/main/res/drawable-mdpi/img_1.png b/sample/src/main/res/drawable-mdpi/img_1.png similarity index 100% rename from app/src/main/res/drawable-mdpi/img_1.png rename to sample/src/main/res/drawable-mdpi/img_1.png diff --git a/app/src/main/res/drawable-mdpi/img_2.png b/sample/src/main/res/drawable-mdpi/img_2.png similarity index 100% rename from app/src/main/res/drawable-mdpi/img_2.png rename to sample/src/main/res/drawable-mdpi/img_2.png diff --git a/app/src/main/res/drawable-xhdpi/circles_1.png b/sample/src/main/res/drawable-xhdpi/circles_1.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/circles_1.png rename to sample/src/main/res/drawable-xhdpi/circles_1.png diff --git a/app/src/main/res/drawable-xhdpi/circles_2.png b/sample/src/main/res/drawable-xhdpi/circles_2.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/circles_2.png rename to sample/src/main/res/drawable-xhdpi/circles_2.png diff --git a/app/src/main/res/drawable-xhdpi/img_1.png b/sample/src/main/res/drawable-xhdpi/img_1.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/img_1.png rename to sample/src/main/res/drawable-xhdpi/img_1.png diff --git a/app/src/main/res/drawable-xhdpi/img_2.png b/sample/src/main/res/drawable-xhdpi/img_2.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/img_2.png rename to sample/src/main/res/drawable-xhdpi/img_2.png diff --git a/app/src/main/res/drawable-xxhdpi/circles_1.png b/sample/src/main/res/drawable-xxhdpi/circles_1.png similarity index 100% rename from app/src/main/res/drawable-xxhdpi/circles_1.png rename to sample/src/main/res/drawable-xxhdpi/circles_1.png diff --git a/app/src/main/res/drawable-xxhdpi/circles_2.png b/sample/src/main/res/drawable-xxhdpi/circles_2.png similarity index 100% rename from app/src/main/res/drawable-xxhdpi/circles_2.png rename to sample/src/main/res/drawable-xxhdpi/circles_2.png diff --git a/app/src/main/res/drawable-xxhdpi/img_1.png b/sample/src/main/res/drawable-xxhdpi/img_1.png similarity index 100% rename from app/src/main/res/drawable-xxhdpi/img_1.png rename to sample/src/main/res/drawable-xxhdpi/img_1.png diff --git a/app/src/main/res/drawable-xxhdpi/img_2.png b/sample/src/main/res/drawable-xxhdpi/img_2.png similarity index 100% rename from app/src/main/res/drawable-xxhdpi/img_2.png rename to sample/src/main/res/drawable-xxhdpi/img_2.png diff --git a/app/src/main/res/drawable-xxxhdpi/circles_1.png b/sample/src/main/res/drawable-xxxhdpi/circles_1.png similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/circles_1.png rename to sample/src/main/res/drawable-xxxhdpi/circles_1.png diff --git a/app/src/main/res/drawable-xxxhdpi/circles_2.png b/sample/src/main/res/drawable-xxxhdpi/circles_2.png similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/circles_2.png rename to sample/src/main/res/drawable-xxxhdpi/circles_2.png diff --git a/app/src/main/res/drawable-xxxhdpi/img_1.png b/sample/src/main/res/drawable-xxxhdpi/img_1.png similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/img_1.png rename to sample/src/main/res/drawable-xxxhdpi/img_1.png diff --git a/app/src/main/res/drawable-xxxhdpi/img_2.png b/sample/src/main/res/drawable-xxxhdpi/img_2.png similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/img_2.png rename to sample/src/main/res/drawable-xxxhdpi/img_2.png diff --git a/app/src/main/res/layout/activity_main.xml b/sample/src/main/res/layout/activity_main.xml similarity index 91% rename from app/src/main/res/layout/activity_main.xml rename to sample/src/main/res/layout/activity_main.xml index aca2505..16b747e 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/sample/src/main/res/layout/activity_main.xml @@ -9,6 +9,5 @@ - + android:layout_height="match_parent"/> \ No newline at end of file diff --git a/app/src/main/res/layout/first_page.xml b/sample/src/main/res/layout/first_page.xml similarity index 100% rename from app/src/main/res/layout/first_page.xml rename to sample/src/main/res/layout/first_page.xml diff --git a/app/src/main/res/layout/fragment_page_number.xml b/sample/src/main/res/layout/fragment_page_number.xml similarity index 100% rename from app/src/main/res/layout/fragment_page_number.xml rename to sample/src/main/res/layout/fragment_page_number.xml diff --git a/app/src/main/res/layout/second_page.xml b/sample/src/main/res/layout/second_page.xml similarity index 100% rename from app/src/main/res/layout/second_page.xml rename to sample/src/main/res/layout/second_page.xml diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/sample/src/main/res/mipmap-hdpi/ic_launcher.png old mode 100755 new mode 100644 similarity index 100% rename from app/src/main/res/mipmap-hdpi/ic_launcher.png rename to sample/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/sample/src/main/res/mipmap-mdpi/ic_launcher.png old mode 100755 new mode 100644 similarity index 100% rename from app/src/main/res/mipmap-mdpi/ic_launcher.png rename to sample/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/sample/src/main/res/mipmap-xhdpi/ic_launcher.png old mode 100755 new mode 100644 similarity index 100% rename from app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to sample/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png old mode 100755 new mode 100644 similarity index 100% rename from app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to sample/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png old mode 100755 new mode 100644 similarity index 100% rename from app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/app/src/main/res/values/colors.xml b/sample/src/main/res/values/colors.xml similarity index 100% rename from app/src/main/res/values/colors.xml rename to sample/src/main/res/values/colors.xml diff --git a/app/src/main/res/values/strings.xml b/sample/src/main/res/values/strings.xml similarity index 100% rename from app/src/main/res/values/strings.xml rename to sample/src/main/res/values/strings.xml diff --git a/app/src/main/res/values/styles.xml b/sample/src/main/res/values/styles.xml similarity index 100% rename from app/src/main/res/values/styles.xml rename to sample/src/main/res/values/styles.xml diff --git a/app/src/test/java/com/cuberto/liquidswipetest/ExampleUnitTest.kt b/sample/src/test/java/com/cuberto/liquidswipetest/ExampleUnitTest.kt similarity index 100% rename from app/src/test/java/com/cuberto/liquidswipetest/ExampleUnitTest.kt rename to sample/src/test/java/com/cuberto/liquidswipetest/ExampleUnitTest.kt diff --git a/settings.gradle b/settings.gradle index 9ccaacd..50ece2e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1 @@ -include ':app', ':liquid-swipe' -rootProject.name='LiquidSwipeTest' +include ':liquid-swipe-android',":sample"