├── app ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── 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 │ │ │ ├── integers.xml │ │ │ ├── dimens.xml │ │ │ ├── attrs_fade_transition.xml │ │ │ ├── attrs_pop_transition.xml │ │ │ ├── colors.xml │ │ │ ├── styles.xml │ │ │ └── strings.xml │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ ├── layout │ │ │ ├── onboarding_activity.xml │ │ │ ├── activity_main.xml │ │ │ ├── onboarding_page_item.xml │ │ │ └── onboarding_view.xml │ │ ├── transition │ │ │ ├── activity_main_exit.xml │ │ │ └── activity_main_reenter.xml │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ ├── xml │ │ │ └── oboarding_main_scene.xml │ │ └── drawable │ │ │ ├── ic_launcher_background.xml │ │ │ ├── ic_directions.xml │ │ │ └── ic_a_day_at_the_park.xml │ │ ├── java │ │ └── com │ │ │ └── omni │ │ │ └── onboardingscreen │ │ │ ├── feature │ │ │ ├── home │ │ │ │ └── MainActivity.kt │ │ │ └── onboarding │ │ │ │ ├── OnBoardingActivity.kt │ │ │ │ ├── entity │ │ │ │ └── OnBoardingPage.kt │ │ │ │ ├── OnBoardingPagerAdapter.kt │ │ │ │ └── customView │ │ │ │ └── OnBoardingView.kt │ │ │ ├── domain │ │ │ └── OnBoardingPrefManager.kt │ │ │ └── core │ │ │ ├── Transform.kt │ │ │ ├── FadeTransition.kt │ │ │ └── PopTransition.kt │ │ └── AndroidManifest.xml ├── proguard-rules.pro └── build.gradle ├── _config.yml ├── Screenshot ├── slideone.png ├── slidetwo.png ├── onboarding.gif └── slidethree.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .idea ├── encodings.xml ├── codeStyles │ ├── codeStyleConfig.xml │ └── Project.xml ├── vcs.xml ├── kotlinc.xml ├── runConfigurations.xml ├── gradle.xml ├── jarRepositories.xml ├── misc.xml ├── markdown-navigator-enh.xml └── markdown-navigator.xml ├── .gitignore ├── settings.gradle ├── README.md ├── LICENSE ├── gradle.properties ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /Screenshot/slideone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmneyaOsman/OnBoardingScreen/HEAD/Screenshot/slideone.png -------------------------------------------------------------------------------- /Screenshot/slidetwo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmneyaOsman/OnBoardingScreen/HEAD/Screenshot/slidetwo.png -------------------------------------------------------------------------------- /Screenshot/onboarding.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmneyaOsman/OnBoardingScreen/HEAD/Screenshot/onboarding.gif -------------------------------------------------------------------------------- /Screenshot/slidethree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmneyaOsman/OnBoardingScreen/HEAD/Screenshot/slidethree.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmneyaOsman/OnBoardingScreen/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmneyaOsman/OnBoardingScreen/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmneyaOsman/OnBoardingScreen/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmneyaOsman/OnBoardingScreen/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmneyaOsman/OnBoardingScreen/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmneyaOsman/OnBoardingScreen/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmneyaOsman/OnBoardingScreen/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmneyaOsman/OnBoardingScreen/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmneyaOsman/OnBoardingScreen/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmneyaOsman/OnBoardingScreen/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values/integers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 350 4 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmneyaOsman/OnBoardingScreen/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/kotlinc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 30dp 5 | 8dp 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/* 6 | /.idea/libraries 7 | /.idea/modules.xml 8 | /.idea/gardle.xml 9 | /.idea/misc.xml 10 | /.idea/assetWizardSettings.xml 11 | .DS_Store 12 | /build 13 | /captures 14 | .externalNativeBuild 15 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Dec 03 14:54:43 EET 2022 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME -------------------------------------------------------------------------------- /app/src/main/res/values/attrs_fade_transition.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/attrs_pop_transition.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | google() 5 | mavenCentral() 6 | } 7 | } 8 | dependencyResolutionManagement { 9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 10 | repositories { 11 | google() 12 | mavenCentral() 13 | } 14 | } 15 | rootProject.name = "onBoarding" 16 | include ':app' 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/omni/onboardingscreen/feature/home/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.omni.onboardingscreen.feature.home 2 | 3 | import androidx.appcompat.app.AppCompatActivity 4 | import android.os.Bundle 5 | import com.omni.onboardingscreen.R 6 | 7 | class MainActivity : AppCompatActivity() { 8 | 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | setContentView(R.layout.activity_main) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | #FFFFFF 5 | #4CAF50 6 | #6c63ff 7 | #303F9F 8 | #003366 9 | #C9C9C9 10 | #FFFFFF 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/onboarding_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/omni/onboardingscreen/feature/onboarding/OnBoardingActivity.kt: -------------------------------------------------------------------------------- 1 | package com.omni.onboardingscreen.feature.onboarding 2 | 3 | import android.os.Bundle 4 | import androidx.appcompat.app.AppCompatActivity 5 | import com.omni.onboardingscreen.R 6 | import com.omni.onboardingscreen.databinding.ActivityMainBinding 7 | import com.omni.onboardingscreen.databinding.OnboardingActivityBinding 8 | 9 | class OnBoardingActivity : AppCompatActivity() { 10 | 11 | override fun onCreate(savedInstanceState: Bundle?) { 12 | super.onCreate(savedInstanceState) 13 | val binding = OnboardingActivityBinding.inflate(layoutInflater) 14 | setContentView(binding.root) 15 | } 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -keep class !com.omni.** { *; } -------------------------------------------------------------------------------- /app/src/main/res/transition/activity_main_exit.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 16 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/omni/onboardingscreen/feature/onboarding/entity/OnBoardingPage.kt: -------------------------------------------------------------------------------- 1 | package com.omni.onboardingscreen.feature.onboarding.entity 2 | import androidx.annotation.DrawableRes 3 | import androidx.annotation.StringRes 4 | import com.omni.onboardingscreen.R 5 | 6 | enum class OnBoardingPage( 7 | @StringRes val titleResource: Int, 8 | @StringRes val subTitleResource: Int, 9 | @StringRes val descriptionResource: Int, 10 | @DrawableRes val logoResource: Int 11 | ) { 12 | 13 | ONE(R.string.onboarding_slide1_title, R.string.onboarding_slide1_subtitle,R.string.onboarding_slide1_desc, R.drawable.ic_directions), 14 | TWO(R.string.onboarding_slide2_title, R.string.onboarding_slide2_subtitle,R.string.onboarding_slide2_desc, R.drawable.ic_hang_out), 15 | THREE(R.string.onboarding_slide2_title, R.string.onboarding_slide3_subtitle,R.string.onboarding_slide1_desc, R.drawable.ic_a_day_at_the_park) 16 | 17 | } -------------------------------------------------------------------------------- /app/src/main/res/transition/activity_main_reenter.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 12 | 13 | 17 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/omni/onboardingscreen/domain/OnBoardingPrefManager.kt: -------------------------------------------------------------------------------- 1 | package com.omni.onboardingscreen.domain 2 | 3 | import android.content.Context 4 | import android.content.SharedPreferences 5 | 6 | class OnBoardingPrefManager (_context: Context) { 7 | 8 | 9 | private val pref: SharedPreferences 10 | private val editor: SharedPreferences.Editor 11 | 12 | 13 | var isFirstTimeLaunch: Boolean 14 | get() { 15 | return pref.getBoolean(IS_FIRST_TIME_LAUNCH, true) 16 | } 17 | set(isFirstTime) { 18 | editor.putBoolean(IS_FIRST_TIME_LAUNCH, isFirstTime) 19 | editor.commit() 20 | } 21 | 22 | 23 | init { 24 | pref = _context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE) 25 | editor = pref.edit() 26 | } 27 | 28 | companion object { 29 | private const val IS_FIRST_TIME_LAUNCH = "IS_FIRST_TIME_LAUNCH" 30 | private const val PREF_NAME = "PREF_NAME" 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## OnBoardingScreen 2 | This project aim is showing how to create Welcome onboarding or welcome screen with MotionLayout in Kotlin 3 | inspired by project [OnboardingFreebi](https://github.com/ranger163/OnboardingFreebi) by [Ahmed Nassar](https://github.com/ranger163) 4 | 5 | 6 | Demo 7 | ------------ 8 |

9 | 10 |

11 | 12 | 13 | ## Requirements 14 | 15 | This module requires the following libraries: 16 | 17 | * [Kotlin](https://kotlinlang.org) 18 | * [Androidx](https://developer.android.com/jetpack/androidx) 19 | * [MotionLayout](https://developer.android.com/reference/android/support/constraint/motion/MotionLayout) 20 | * [ViewPager2](https://medium.com/@omneyaosman/implement-viewpager2-as-a-recyclerview-7456803d102e) 21 | 22 | 23 | 24 | ## Installation 25 | 26 | * Clone this repo. 27 | * Master branch shows only Onboarding design an prefManager 28 | * development branch handles navigations from splash to onboarding for first time launch then after pressing skip or 29 | Get started in the next time App launches the splash navigates to home . 30 | * Update your android studio to verion 7.3.1 . 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | MIT License 3 | 4 | Copyright © 2020 Omneya 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE.MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Kotlin code style for this project: "official" or "obsolete": 19 | kotlin.code.style=official 20 | # Enables namespacing of each library's R class so that its R class includes only the 21 | # resources declared in the library itself and none from the library's dependencies, 22 | # thereby reducing the size of the R class for that library 23 | android.nonTransitiveRClass=true 24 | android.defaults.buildfeatures.buildconfig=true 25 | android.nonFinalResIds=false -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' 3 | id 'org.jetbrains.kotlin.android' 4 | } 5 | 6 | android { 7 | compileSdkVersion 34 8 | defaultConfig { 9 | applicationId "com.omni.onboardingscreen" 10 | minSdkVersion 21 11 | targetSdkVersion 34 12 | versionCode 3 13 | versionName "1.2" 14 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 15 | } 16 | buildTypes { 17 | release { 18 | minifyEnabled false 19 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | compileOptions { 23 | sourceCompatibility = JavaVersion.VERSION_17 24 | targetCompatibility = JavaVersion.VERSION_17 25 | } 26 | kotlinOptions { 27 | jvmTarget = "17" 28 | } 29 | 30 | buildFeatures { 31 | viewBinding true 32 | } 33 | namespace 'com.omni.onboardingscreen' 34 | } 35 | 36 | dependencies { 37 | 38 | implementation 'androidx.core:core-ktx:1.12.0' 39 | implementation 'androidx.appcompat:appcompat:1.6.1' 40 | implementation 'com.google.android.material:material:1.10.0' 41 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4' 42 | implementation 'androidx.navigation:navigation-fragment-ktx:2.7.5' 43 | implementation 'androidx.navigation:navigation-ui-ktx:2.7.5' 44 | 45 | //viewPager2 library 46 | implementation 'androidx.viewpager2:viewpager2:1.1.0-beta02' 47 | 48 | //stepper library 49 | implementation "com.tbuonomo:dotsindicator:5.0" 50 | 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 13 | 20 | 21 | 25 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Android 15 | 16 | 17 | ComplianceLintAndroid 18 | 19 | 20 | CorrectnessLintAndroid 21 | 22 | 23 | Java 24 | 25 | 26 | LintAndroid 27 | 28 | 29 | PerformanceLintAndroid 30 | 31 | 32 | Probable bugsJava 33 | 34 | 35 | RELAX NG 36 | 37 | 38 | UsabilityLintAndroid 39 | 40 | 41 | 42 | 43 | Android 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 55 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Welcome 3 | 4 | Create an account 5 | Connect with people around the world 6 | User will be able to give you live, chat and meet 7 | with people nearby. 8 | 9 | Login to your account 10 | Let\'s build connection with new people 11 | Connect helps you locate the people around you who 12 | are closest from your home. 13 | 14 | Login to your account 15 | Feel the happiness 16 | User will be able to give you live, chat and meet 17 | with people nearby. 18 | 19 | Next 20 | Skip 21 | Get started 22 | 23 | Sign In 24 | Username 25 | Password 26 | Remember me 27 | Forgot password? 28 | Login 29 | New User? 30 | Invalid username 31 | Invalid password 32 | 33 | Home 34 | Can\'t walk? then fly! 35 | previous 36 | 37 | 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/omni/onboardingscreen/core/Transform.kt: -------------------------------------------------------------------------------- 1 | package com.omni.onboardingscreen.core 2 | 3 | import android.view.LayoutInflater 4 | import android.view.View 5 | import android.widget.ImageView 6 | import androidx.viewpager2.widget.CompositePageTransformer 7 | import androidx.viewpager2.widget.MarginPageTransformer 8 | import com.omni.onboardingscreen.R 9 | 10 | 11 | val pageCompositePageTransformer = CompositePageTransformer().apply { 12 | addTransformer(MarginPageTransformer(40)) 13 | addTransformer { page, position -> 14 | val r = 1 - kotlin.math.abs(position) 15 | page.scaleY = 0.85f + r * 0.15f 16 | } 17 | } 18 | 19 | 20 | fun setParallaxTransformation(page: View, position: Float){ 21 | page.apply { 22 | val parallaxView = this.findViewById(R.id.img) 23 | when { 24 | position < -1 -> // [-Infinity,-1) 25 | // This page is way off-screen to the left. 26 | alpha = 1f 27 | position <= 1 -> { // [-1,1] 28 | parallaxView.translationX = -position * (width / 2) //Half the normal speed 29 | } 30 | else -> // (1,+Infinity] 31 | // This page is way off-screen to the right. 32 | alpha = 1f 33 | } 34 | } 35 | 36 | } 37 | 38 | //page.apply { 39 | // if (position <= 1 && position >= -1) { 40 | // planet.translationX = -position * width 41 | // name.translationX = -position * width 42 | // name.translationY = position * height / 5 43 | // /* 44 | // Planets and their names move in the opposite direction. So they are stable 45 | // If the user drags the page right to left : 46 | // Name: Goes up 47 | // If the user drags the page left to right : 48 | // Name: Goes down 49 | // */ 50 | // } 51 | //} -------------------------------------------------------------------------------- /app/src/main/java/com/omni/onboardingscreen/feature/onboarding/OnBoardingPagerAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.omni.onboardingscreen.feature.onboarding 2 | 3 | import android.view.LayoutInflater 4 | import android.view.ViewGroup 5 | import androidx.recyclerview.widget.RecyclerView 6 | import com.omni.onboardingscreen.databinding.OnboardingPageItemBinding 7 | import com.omni.onboardingscreen.feature.onboarding.entity.OnBoardingPage 8 | 9 | /** 10 | *OnBoardingPagerAdapter adapter for the viewpager2 11 | * @param onBoardingPageList as Array */ 12 | class OnBoardingPagerAdapter(private val onBoardingPageList: Array = OnBoardingPage.values()) : 13 | RecyclerView.Adapter() { 14 | 15 | 16 | override fun onCreateViewHolder(parent: ViewGroup, p1: Int): PagerViewHolder = 17 | LayoutInflater.from(parent.context).let { 18 | OnboardingPageItemBinding.inflate( 19 | it, parent, false 20 | ).let { binding -> PagerViewHolder(binding) } 21 | } 22 | 23 | 24 | override fun getItemCount() = onBoardingPageList.size 25 | 26 | override fun onBindViewHolder(holder: PagerViewHolder, position: Int) { 27 | holder.bind(onBoardingPageList[position]) 28 | } 29 | 30 | /** PagerViewHolder viewHolder inner class 31 | * @param binding is OnboardingPageItemBinding to bind data */ 32 | inner class PagerViewHolder(private val binding: OnboardingPageItemBinding) : 33 | RecyclerView.ViewHolder(binding.root) { 34 | /** 35 | * @param onBoardingPage is OnBoardingPage item 36 | * bind view **/ 37 | fun bind(onBoardingPage: OnBoardingPage) { 38 | val res = binding.root.context.resources 39 | binding.titleTv.text = res.getString(onBoardingPage.titleResource) 40 | binding.subTitleTv.text = res.getString(onBoardingPage.subTitleResource) 41 | binding.descTV.text = res.getString(onBoardingPage.descriptionResource) 42 | binding.img.setImageResource(onBoardingPage.logoResource) 43 | } 44 | 45 | } 46 | } -------------------------------------------------------------------------------- /app/src/main/java/com/omni/onboardingscreen/core/FadeTransition.kt: -------------------------------------------------------------------------------- 1 | package com.omni.onboardingscreen.core 2 | 3 | import android.animation.Animator 4 | import android.animation.ObjectAnimator 5 | import android.annotation.TargetApi 6 | import android.content.Context 7 | import android.os.Build 8 | import android.transition.Transition 9 | import android.transition.TransitionValues 10 | import android.util.AttributeSet 11 | import android.view.View 12 | import android.view.ViewGroup 13 | import com.omni.onboardingscreen.R 14 | 15 | 16 | @TargetApi(Build.VERSION_CODES.LOLLIPOP) 17 | class FadeTransition : Transition { 18 | 19 | private var startAlpha: Float = 0.0f 20 | private var endAlpha: Float = 1.0f 21 | 22 | constructor(startAlpha: Float, endAlpha: Float) { 23 | this.startAlpha = startAlpha 24 | this.endAlpha = endAlpha 25 | } 26 | 27 | constructor(context: Context, attrs: AttributeSet) : super(context, attrs) { 28 | val a = context.obtainStyledAttributes(attrs, R.styleable.FadeTransition) 29 | startAlpha = a.getFloat(R.styleable.FadeTransition_startAlpha, startAlpha) 30 | endAlpha = a.getFloat(R.styleable.FadeTransition_endAlpha, endAlpha) 31 | a.recycle() 32 | } 33 | 34 | private fun captureValues(transitionValues: TransitionValues) { 35 | transitionValues.values[PROP_NAME_ALPHA] = transitionValues.view.alpha 36 | } 37 | 38 | override fun captureStartValues(transitionValues: TransitionValues) { 39 | captureValues(transitionValues) 40 | } 41 | 42 | override fun captureEndValues(transitionValues: TransitionValues) { 43 | captureValues(transitionValues) 44 | } 45 | 46 | override fun createAnimator(sceneRoot: ViewGroup, startValues: TransitionValues, endValues: TransitionValues): Animator { 47 | val view = endValues.view 48 | if (startAlpha != endAlpha) view.alpha = endAlpha 49 | return ObjectAnimator.ofFloat(view, View.ALPHA, startAlpha, endAlpha) 50 | } 51 | 52 | companion object { 53 | private const val PROP_NAME_ALPHA = "android:custom:alpha" 54 | } 55 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /.idea/markdown-navigator-enh.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/omni/onboardingscreen/core/PopTransition.kt: -------------------------------------------------------------------------------- 1 | package com.omni.onboardingscreen.core 2 | 3 | import android.animation.Animator 4 | import android.animation.ObjectAnimator 5 | import android.animation.PropertyValuesHolder 6 | import android.annotation.TargetApi 7 | import android.content.Context 8 | import android.os.Build 9 | import android.transition.TransitionValues 10 | import android.transition.Visibility 11 | import android.util.AttributeSet 12 | import android.view.View 13 | import android.view.ViewGroup 14 | import androidx.core.animation.doOnEnd 15 | import com.omni.onboardingscreen.R 16 | 17 | 18 | @TargetApi(Build.VERSION_CODES.LOLLIPOP) 19 | class PopTransition(context: Context, attrs: AttributeSet) : Visibility(context, attrs) { 20 | 21 | private var startScale: Float = 0.0f 22 | private var endScale: Float = 1.0f 23 | 24 | init { 25 | val a = context.obtainStyledAttributes(attrs, R.styleable.PopTransition) 26 | startScale = a.getFloat(R.styleable.PopTransition_startScale, startScale) 27 | endScale = a.getFloat(R.styleable.PopTransition_endScale, endScale) 28 | a.recycle() 29 | } 30 | 31 | override fun onAppear(sceneRoot: ViewGroup, view: View, startValues: TransitionValues, endValues: TransitionValues): Animator { 32 | view.scaleX = startScale 33 | view.scaleY = startScale 34 | return ObjectAnimator.ofPropertyValuesHolder( 35 | view, 36 | PropertyValuesHolder.ofFloat(View.SCALE_X, endScale), 37 | PropertyValuesHolder.ofFloat(View.SCALE_Y, endScale) 38 | ) 39 | } 40 | 41 | override fun onDisappear(sceneRoot: ViewGroup, view: View, startValues: TransitionValues, endValues: TransitionValues): Animator { 42 | return ObjectAnimator.ofPropertyValuesHolder( 43 | view, 44 | PropertyValuesHolder.ofFloat(View.SCALE_X, endScale), 45 | PropertyValuesHolder.ofFloat(View.SCALE_Y, endScale) 46 | ).apply { 47 | doOnEnd { 48 | // Reset View X & Y to allow shared element to return with proper start dimension 49 | view.scaleX = startScale 50 | view.scaleY = startScale 51 | } 52 | } 53 | } 54 | 55 | 56 | } -------------------------------------------------------------------------------- /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 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 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 Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /.idea/markdown-navigator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 19 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /app/src/main/res/layout/onboarding_page_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 21 | 22 | 34 | 35 | 49 | 50 | 60 | 61 | -------------------------------------------------------------------------------- /app/src/main/java/com/omni/onboardingscreen/feature/onboarding/customView/OnBoardingView.kt: -------------------------------------------------------------------------------- 1 | package com.omni.onboardingscreen.feature.onboarding.customView 2 | 3 | import android.content.Context 4 | import android.util.AttributeSet 5 | import android.view.LayoutInflater 6 | import android.widget.FrameLayout 7 | import androidx.viewpager2.widget.ViewPager2 8 | import com.omni.onboardingscreen.core.pageCompositePageTransformer 9 | import com.omni.onboardingscreen.core.setParallaxTransformation 10 | import com.omni.onboardingscreen.databinding.OnboardingViewBinding 11 | import com.omni.onboardingscreen.domain.OnBoardingPrefManager 12 | import com.omni.onboardingscreen.feature.onboarding.OnBoardingPagerAdapter 13 | import com.omni.onboardingscreen.feature.onboarding.entity.OnBoardingPage 14 | 15 | class OnBoardingView @JvmOverloads 16 | constructor( 17 | context: Context, 18 | attrs: AttributeSet? = null, 19 | defStyleAttr: Int = 0, 20 | defStyleRes: Int = 0 21 | ) : 22 | FrameLayout(context, attrs, defStyleAttr, defStyleRes) { 23 | 24 | private val numberOfPages by lazy { OnBoardingPage.values().size } 25 | private val prefManager: OnBoardingPrefManager 26 | 27 | 28 | init { 29 | val binding = OnboardingViewBinding.inflate(LayoutInflater.from(context), this, true) 30 | with(binding) { 31 | setUpSlider() 32 | addingButtonsClickListeners() 33 | prefManager = OnBoardingPrefManager(root.context) 34 | } 35 | 36 | } 37 | 38 | private fun OnboardingViewBinding.setUpSlider() { 39 | with(slider) { 40 | adapter = OnBoardingPagerAdapter() 41 | 42 | setPageTransformer { page, position -> 43 | setParallaxTransformation(page, position) 44 | } 45 | // 46 | // setPageTransformer(pageCompositePageTransformer) 47 | 48 | addSlideChangeListener() 49 | 50 | val wormDotsIndicator = pageIndicator 51 | wormDotsIndicator.attachTo(this) 52 | } 53 | } 54 | 55 | 56 | private fun OnboardingViewBinding.addSlideChangeListener() { 57 | 58 | slider.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() { 59 | override fun onPageScrolled( 60 | position: Int, 61 | positionOffset: Float, 62 | positionOffsetPixels: Int 63 | ) { 64 | super.onPageScrolled(position, positionOffset, positionOffsetPixels) 65 | if (numberOfPages > 1) { 66 | val newProgress = (position + positionOffset) / (numberOfPages - 1) 67 | onboardingRoot.progress = newProgress 68 | } 69 | } 70 | }) 71 | } 72 | 73 | private fun OnboardingViewBinding.addingButtonsClickListeners() { 74 | nextBtn.setOnClickListener { navigateToNextSlide(slider) } 75 | skipBtn.setOnClickListener { 76 | setFirstTimeLaunchToFalse() 77 | } 78 | startBtn.setOnClickListener { 79 | setFirstTimeLaunchToFalse() 80 | } 81 | } 82 | 83 | private fun setFirstTimeLaunchToFalse() { 84 | prefManager.isFirstTimeLaunch = false 85 | } 86 | 87 | private fun navigateToNextSlide(slider: ViewPager2?) { 88 | val nextSlidePos: Int = slider?.currentItem?.plus(1) ?: 0 89 | slider?.setCurrentItem(nextSlidePos, true) 90 | } 91 | 92 | 93 | } -------------------------------------------------------------------------------- /app/src/main/res/xml/oboarding_main_scene.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 11 | 15 | 16 | 20 | 21 | 25 | 26 | 30 | 31 | 35 | 36 | 40 | 41 | 42 | 43 | 44 | 51 | 52 | 59 | 60 | 67 | 68 | 69 | 70 | 71 | 78 | 79 | 86 | 87 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /app/src/main/res/layout/onboarding_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 19 | 20 | 26 | 27 | 41 | 42 | 43 | 54 | 55 | 72 | 73 | 83 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 20 | 22 | 23 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | xmlns:android 33 | 34 | ^$ 35 | 36 | 37 | 38 |
39 |
40 | 41 | 42 | 43 | xmlns:.* 44 | 45 | ^$ 46 | 47 | 48 | BY_NAME 49 | 50 |
51 |
52 | 53 | 54 | 55 | .*:id 56 | 57 | http://schemas.android.com/apk/res/android 58 | 59 | 60 | 61 |
62 |
63 | 64 | 65 | 66 | .*:name 67 | 68 | http://schemas.android.com/apk/res/android 69 | 70 | 71 | 72 |
73 |
74 | 75 | 76 | 77 | name 78 | 79 | ^$ 80 | 81 | 82 | 83 |
84 |
85 | 86 | 87 | 88 | style 89 | 90 | ^$ 91 | 92 | 93 | 94 |
95 |
96 | 97 | 98 | 99 | .* 100 | 101 | ^$ 102 | 103 | 104 | BY_NAME 105 | 106 |
107 |
108 | 109 | 110 | 111 | .* 112 | 113 | http://schemas.android.com/apk/res/android 114 | 115 | 116 | ANDROID_ATTRIBUTE_ORDER 117 | 118 |
119 |
120 | 121 | 122 | 123 | .* 124 | 125 | .* 126 | 127 | 128 | BY_NAME 129 | 130 |
131 |
132 |
133 |
134 | 135 | 137 |
138 |
-------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | 22 | 24 | 26 | 28 | 30 | 32 | 34 | 36 | 38 | 40 | 42 | 44 | 46 | 48 | 50 | 52 | 54 | 56 | 58 | 60 | 62 | 64 | 66 | 68 | 70 | 72 | 74 | 75 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_directions.xml: -------------------------------------------------------------------------------- 1 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | 22 | 24 | 25 | 27 | 28 | 30 | 32 | 34 | 36 | 38 | 40 | 42 | 44 | 46 | 47 | 49 | 50 | 51 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 65 | 67 | 68 | 69 | 70 | 71 | 72 | 74 | 75 | 76 | 77 | 78 | 79 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_a_day_at_the_park.xml: -------------------------------------------------------------------------------- 1 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | 22 | 24 | 26 | 28 | 30 | 31 | 32 | 34 | 36 | 37 | 38 | 40 | 42 | 43 | 45 | 47 | 48 | 50 | 52 | 53 | 55 | 57 | 58 | 60 | 62 | 63 | 65 | 67 | 69 | 71 | 73 | 75 | 77 | 79 | 81 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 96 | 97 | 98 | 100 | 101 | 102 | 103 | 104 | 106 | 108 | 109 | 110 | 112 | 114 | 115 | 116 | 117 | 119 | 120 | 122 | 124 | 125 | 127 | 128 | 130 | 132 | 134 | 136 | 138 | 139 | 142 | 145 | 148 | 151 | 154 | 155 | 158 | 161 | 164 | 167 | 170 | 171 | 174 | 177 | 180 | 183 | 186 | 187 | 188 | 189 | 190 | 192 | 193 | 194 | 195 | 197 | 198 | 199 | 200 | 202 | 203 | 204 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 216 | 217 | 219 | 220 | 221 | 223 | 225 | 226 | 227 | 228 | 229 | 231 | 233 | 234 | 236 | 238 | 239 | 241 | 243 | 244 | 246 | 248 | 249 | 251 | 253 | 255 | 256 | 258 | 260 | 262 | 263 | 265 | 267 | 269 | 271 | 273 | 274 | 276 | 277 | 278 | 280 | 282 | 284 | 286 | 288 | 289 | 291 | 292 | 294 | 296 | 297 | 298 | 299 | 301 | 302 | 303 | 305 | 307 | 308 | 310 | 312 | 313 | 314 | 315 | 316 | 319 | 322 | 324 | 326 | 327 | 328 | 329 | 330 | 333 | 336 | 337 | 339 | 340 | 343 | 346 | 348 | 349 | 352 | 355 | 357 | 358 | 361 | 364 | 366 | 367 | 370 | 373 | 375 | 377 | 378 | 380 | 382 | 383 | 384 | 386 | 387 | 389 | 390 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 421 | 423 | 425 | 427 | 429 | 431 | 433 | 435 | 437 | 439 | 441 | 443 | 445 | 447 | 449 | 451 | 452 | 453 | 455 | 456 | 457 | 459 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 475 | 476 | 478 | 480 | 481 | 482 | 483 | 485 | 486 | 488 | 490 | 491 | 492 | 493 | 495 | 497 | 498 | 500 | 501 | 503 | 504 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 516 | 518 | 520 | 522 | 524 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 537 | 538 | 539 | 541 | 542 | 544 | 545 | 547 | 548 | 549 | 551 | 552 | 554 | 555 | 557 | 558 | 560 | 561 | 562 | 564 | 565 | 567 | 568 | 570 | 571 | 573 | 575 | 576 | 578 | 579 | 581 | 583 | 584 | 585 | 587 | 589 | 591 | 593 | 595 | 597 | 599 | 601 | 603 | 604 | 605 | 606 | 608 | 610 | 611 | 612 | 614 | 616 | 618 | 620 | 621 | 623 | 624 | 626 | 628 | 630 | 632 | 633 | --------------------------------------------------------------------------------