├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── styles.xml │ │ │ │ └── colors.xml │ │ │ ├── drawable │ │ │ │ ├── ic_color.png │ │ │ │ ├── ic_close_black.png │ │ │ │ ├── ic_collections.png │ │ │ │ ├── ic_format_size.png │ │ │ │ ├── ic_sentiment_satisfied.png │ │ │ │ └── ic_launcher_background.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 │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ └── layout │ │ │ │ └── activity_main.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── elconfidencial │ │ │ └── bubbleshowcase │ │ │ └── MainActivity.kt │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── elconfidencial │ │ │ └── bubbleshowcase │ │ │ └── ExampleUnitTest.kt │ └── androidTest │ │ └── java │ │ └── com │ │ └── elconfidencial │ │ └── bubbleshowcase │ │ └── ExampleInstrumentedTest.kt ├── proguard-rules.pro └── build.gradle ├── bubbleshowcase ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── bool.xml │ │ │ │ ├── colors.xml │ │ │ │ └── attrs.xml │ │ │ ├── values-w600dp │ │ │ │ └── bool.xml │ │ │ ├── drawable-hdpi │ │ │ │ └── ic_close.png │ │ │ ├── drawable-mdpi │ │ │ │ └── ic_close.png │ │ │ ├── drawable-xhdpi │ │ │ │ └── ic_close.png │ │ │ ├── drawable-xxhdpi │ │ │ │ └── ic_close.png │ │ │ ├── drawable │ │ │ │ └── rounded_rectangle.xml │ │ │ └── layout │ │ │ │ └── view_bubble_message.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── elconfidencial │ │ │ └── bubbleshowcase │ │ │ ├── SequenceShowCaseListener.kt │ │ │ ├── OnBubbleMessageViewListener.kt │ │ │ ├── BubbleShowCaseListener.kt │ │ │ ├── BubbleShowCaseSequence.kt │ │ │ ├── AnimationUtils.kt │ │ │ ├── ScreenUtils.kt │ │ │ ├── BubbleShowCaseBuilder.kt │ │ │ ├── BubbleMessageView.kt │ │ │ └── BubbleShowCase.kt │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── elconfidencial │ │ │ └── bubbleshowcase │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── elconfidencial │ │ └── bubbleshowcase │ │ └── ExampleInstrumentedTest.java ├── libraryUpdateInstructions ├── proguard-rules.pro ├── build.gradle └── deploy.gradle ├── settings.gradle ├── resources └── usage_sample.gif ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── .idea ├── vcs.xml ├── runConfigurations.xml ├── gradle.xml ├── modules.xml └── misc.xml ├── gradle.properties ├── LICENSE ├── gradlew.bat ├── README.md └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /bubbleshowcase/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':bubbleshowcase' 2 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | BubbleShowCase 3 | 4 | -------------------------------------------------------------------------------- /resources/usage_sample.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECLaboratorio/BubbleShowCase-Android/HEAD/resources/usage_sample.gif -------------------------------------------------------------------------------- /bubbleshowcase/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | BubbleShowCase 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECLaboratorio/BubbleShowCase-Android/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECLaboratorio/BubbleShowCase-Android/HEAD/app/src/main/res/drawable/ic_color.png -------------------------------------------------------------------------------- /bubbleshowcase/src/main/res/values/bool.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | false 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_close_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECLaboratorio/BubbleShowCase-Android/HEAD/app/src/main/res/drawable/ic_close_black.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_collections.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECLaboratorio/BubbleShowCase-Android/HEAD/app/src/main/res/drawable/ic_collections.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_format_size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECLaboratorio/BubbleShowCase-Android/HEAD/app/src/main/res/drawable/ic_format_size.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECLaboratorio/BubbleShowCase-Android/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECLaboratorio/BubbleShowCase-Android/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECLaboratorio/BubbleShowCase-Android/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /bubbleshowcase/src/main/res/values-w600dp/bool.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECLaboratorio/BubbleShowCase-Android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECLaboratorio/BubbleShowCase-Android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECLaboratorio/BubbleShowCase-Android/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/ECLaboratorio/BubbleShowCase-Android/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /bubbleshowcase/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_sentiment_satisfied.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECLaboratorio/BubbleShowCase-Android/HEAD/app/src/main/res/drawable/ic_sentiment_satisfied.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECLaboratorio/BubbleShowCase-Android/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/ECLaboratorio/BubbleShowCase-Android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECLaboratorio/BubbleShowCase-Android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /bubbleshowcase/src/main/res/drawable-hdpi/ic_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECLaboratorio/BubbleShowCase-Android/HEAD/bubbleshowcase/src/main/res/drawable-hdpi/ic_close.png -------------------------------------------------------------------------------- /bubbleshowcase/src/main/res/drawable-mdpi/ic_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECLaboratorio/BubbleShowCase-Android/HEAD/bubbleshowcase/src/main/res/drawable-mdpi/ic_close.png -------------------------------------------------------------------------------- /bubbleshowcase/src/main/res/drawable-xhdpi/ic_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECLaboratorio/BubbleShowCase-Android/HEAD/bubbleshowcase/src/main/res/drawable-xhdpi/ic_close.png -------------------------------------------------------------------------------- /bubbleshowcase/src/main/res/drawable-xxhdpi/ic_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECLaboratorio/BubbleShowCase-Android/HEAD/bubbleshowcase/src/main/res/drawable-xxhdpi/ic_close.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | /bubbleshowcase/keystore.gradle 7 | .DS_Store 8 | /build 9 | /captures 10 | .externalNativeBuild 11 | -------------------------------------------------------------------------------- /bubbleshowcase/src/main/java/com/elconfidencial/bubbleshowcase/SequenceShowCaseListener.kt: -------------------------------------------------------------------------------- 1 | package com.elconfidencial.bubbleshowcase 2 | 3 | /** 4 | * Created by jcampos on 11/09/2018. 5 | */ 6 | interface SequenceShowCaseListener { 7 | fun onDismiss() 8 | } -------------------------------------------------------------------------------- /bubbleshowcase/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #77000000 4 | #3F51B5 5 | #FFF 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Sep 04 15:24:44 CEST 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/test/java/com/elconfidencial/bubbleshowcase/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.elconfidencial.bubbleshowcase 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /bubbleshowcase/src/main/res/drawable/rounded_rectangle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 11 | -------------------------------------------------------------------------------- /bubbleshowcase/src/main/java/com/elconfidencial/bubbleshowcase/OnBubbleMessageViewListener.kt: -------------------------------------------------------------------------------- 1 | package com.elconfidencial.bubbleshowcase 2 | 3 | /** 4 | * Created by jcampos on 10/09/2018. 5 | */ 6 | interface OnBubbleMessageViewListener { 7 | /** 8 | * It is called when a user clicks the close action image in the BubbleMessageView 9 | */ 10 | fun onCloseActionImageClick() 11 | 12 | 13 | /** 14 | * It is called when a user clicks the BubbleMessageView 15 | */ 16 | fun onBubbleClick() 17 | } -------------------------------------------------------------------------------- /bubbleshowcase/src/test/java/com/elconfidencial/bubbleshowcase/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.elconfidencial.bubbleshowcase; 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 | } -------------------------------------------------------------------------------- /bubbleshowcase/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #33691E 6 | #E65100 7 | #C62828 8 | #D81B60 9 | #CFD8DC 10 | #FF4081 11 | #FFF59D 12 | #000 13 | #00BFA5 14 | 15 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /bubbleshowcase/libraryUpdateInstructions: -------------------------------------------------------------------------------- 1 | Steps: 2 | 3 | 1. Push all changes to Github https://github.com/ECLaboratorio/BubbleShowCase-Android 4 | 2. Check if you have the file keystore.gradle. If not, create it with this: 5 | 6 | ext { 7 | bintray_api_key = 'API KEY' // Get it from here https://bintray.com/profile/edit 8 | } 9 | 10 | 3. Go to deploy.gradle: Upgrade libraryVersion number 11 | 4. Execute this command in terminal: "gradle install" to build the new version 12 | 5. Execute this command in terminal: "gradle bintrayUpload" to upload changes in Bintray. You can check if everything is correct in https://bintray.com/laboratorioec/Laboratorio-apps/BubbleShowCase 13 | 14 | For more information, check this blog: https://notes.devlabs.bg/beginners-guide-for-publishing-a-kotlin-library-to-jcenter-41272bfc214 -------------------------------------------------------------------------------- /app/src/androidTest/java/com/elconfidencial/bubbleshowcase/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.elconfidencial.bubbleshowcase 2 | 3 | import android.support.test.InstrumentationRegistry 4 | import android.support.test.runner.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getTargetContext() 22 | assertEquals("com.elconfidencial.bubbleshowcase", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /bubbleshowcase/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 | -------------------------------------------------------------------------------- /bubbleshowcase/src/main/java/com/elconfidencial/bubbleshowcase/BubbleShowCaseListener.kt: -------------------------------------------------------------------------------- 1 | package com.elconfidencial.bubbleshowcase 2 | 3 | /** 4 | * Created by jcampos on 04/09/2018. 5 | * 6 | * Listener of user actions in a BubbleShowCase 7 | */ 8 | interface BubbleShowCaseListener { 9 | /** 10 | * It is called when the user clicks on the targetView 11 | */ 12 | fun onTargetClick(bubbleShowCase: BubbleShowCase) 13 | 14 | /** 15 | * It is called when the user clicks on the close icon 16 | */ 17 | fun onCloseActionImageClick(bubbleShowCase: BubbleShowCase) 18 | 19 | /** 20 | * It is called when the user clicks on the background dim 21 | */ 22 | fun onBackgroundDimClick(bubbleShowCase: BubbleShowCase) 23 | 24 | /** 25 | * It is called when the user clicks on the bubble 26 | */ 27 | fun onBubbleClick(bubbleShowCase: BubbleShowCase) 28 | } -------------------------------------------------------------------------------- /bubbleshowcase/src/androidTest/java/com/elconfidencial/bubbleshowcase/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.elconfidencial.bubbleshowcase; 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 | * Instrumented 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.elconfidencial.bubbleshowcaseview.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Datos 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | apply plugin: 'kotlin-android' 4 | 5 | apply plugin: 'kotlin-android-extensions' 6 | 7 | android { 8 | compileSdkVersion 27 9 | defaultConfig { 10 | applicationId "com.elconfidencial.bubbleshowcase" 11 | minSdkVersion 16 12 | targetSdkVersion 27 13 | versionCode 1 14 | versionName "1.0" 15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 16 | } 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | } 24 | 25 | dependencies { 26 | implementation fileTree(dir: 'libs', include: ['*.jar']) 27 | implementation project(':bubbleshowcase') 28 | implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 29 | implementation 'com.android.support:design:27.1.1' 30 | implementation 'com.android.support:appcompat-v7:27.1.1' 31 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 32 | testImplementation 'junit:junit:4.12' 33 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 34 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 35 | } 36 | -------------------------------------------------------------------------------- /bubbleshowcase/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-android-extensions' 4 | apply plugin: 'com.github.dcendents.android-maven' 5 | apply plugin: 'com.jfrog.bintray' 6 | apply plugin: 'org.jetbrains.dokka' 7 | apply plugin: 'maven-publish' 8 | 9 | 10 | 11 | android { 12 | compileSdkVersion 26 13 | 14 | 15 | 16 | defaultConfig { 17 | minSdkVersion 16 18 | targetSdkVersion 26 19 | versionCode 1 20 | versionName "1.0" 21 | 22 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 23 | 24 | } 25 | 26 | buildTypes { 27 | release { 28 | minifyEnabled false 29 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 30 | } 31 | } 32 | 33 | } 34 | 35 | dokka { 36 | outputFormat = 'html' 37 | outputDirectory = "$buildDir/javadoc" 38 | } 39 | 40 | dependencies { 41 | implementation fileTree(dir: 'libs', include: ['*.jar']) 42 | implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 43 | implementation 'com.android.support.constraint:constraint-layout:1.0.2' 44 | implementation 'com.android.support:appcompat-v7:26.1.0' 45 | testImplementation 'junit:junit:4.12' 46 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 47 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 48 | } 49 | repositories { 50 | mavenCentral() 51 | } 52 | 53 | 54 | apply from: 'deploy.gradle' 55 | -------------------------------------------------------------------------------- /bubbleshowcase/src/main/java/com/elconfidencial/bubbleshowcase/BubbleShowCaseSequence.kt: -------------------------------------------------------------------------------- 1 | package com.elconfidencial.bubbleshowcase 2 | 3 | /** 4 | * Created by jcampos on 10/09/2018. 5 | */ 6 | class BubbleShowCaseSequence{ 7 | private val mBubbleShowCaseBuilderList = ArrayList() 8 | 9 | init{ 10 | mBubbleShowCaseBuilderList.clear() 11 | } 12 | 13 | fun addShowCase(bubbleShowCaseBuilder: BubbleShowCaseBuilder): BubbleShowCaseSequence { 14 | mBubbleShowCaseBuilderList.add(bubbleShowCaseBuilder) 15 | return this 16 | } 17 | 18 | fun addShowCases(bubbleShowCaseBuilderList: List): BubbleShowCaseSequence { 19 | mBubbleShowCaseBuilderList.addAll(bubbleShowCaseBuilderList) 20 | return this 21 | } 22 | 23 | fun show() = show(0) 24 | 25 | private fun show(position: Int){ 26 | if(position >= mBubbleShowCaseBuilderList.size) 27 | return 28 | 29 | when(position){ 30 | 0 -> { 31 | mBubbleShowCaseBuilderList[position].isFirstOfSequence(true) 32 | mBubbleShowCaseBuilderList[position].isLastOfSequence(false) 33 | } 34 | mBubbleShowCaseBuilderList.size-1 -> { 35 | mBubbleShowCaseBuilderList[position].isFirstOfSequence(false) 36 | mBubbleShowCaseBuilderList[position].isLastOfSequence(true) 37 | } 38 | else -> { 39 | mBubbleShowCaseBuilderList[position].isFirstOfSequence(false) 40 | mBubbleShowCaseBuilderList[position].isLastOfSequence(false) 41 | } 42 | } 43 | mBubbleShowCaseBuilderList[position].sequenceListener(object : SequenceShowCaseListener{ 44 | override fun onDismiss() { 45 | show(position + 1) 46 | } 47 | }).show() 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /bubbleshowcase/src/main/java/com/elconfidencial/bubbleshowcase/AnimationUtils.kt: -------------------------------------------------------------------------------- 1 | package com.elconfidencial.bubbleshowcase 2 | 3 | import android.animation.ObjectAnimator 4 | import android.animation.PropertyValuesHolder 5 | import android.view.View 6 | import android.view.animation.AlphaAnimation 7 | import android.view.animation.Animation 8 | import android.view.animation.DecelerateInterpolator 9 | import android.view.animation.ScaleAnimation 10 | 11 | /** 12 | * Created by jcampos on 05/09/2018. 13 | */ 14 | object AnimationUtils { 15 | 16 | fun getScaleAnimation(offset: Int, duration: Int): Animation { 17 | val anim = ScaleAnimation( 18 | 0f, 1f, // Start and end values for the X axis scaling 19 | 0f, 1f, // Start and end values for the Y axis scaling 20 | Animation.RELATIVE_TO_SELF, 0.5f, // Pivot point of X scaling 21 | Animation.RELATIVE_TO_SELF, 0.5f) // Pivot point of Y scaling 22 | anim.fillAfter = true 23 | anim.startOffset = offset.toLong() 24 | anim.duration = duration.toLong() 25 | return anim 26 | } 27 | 28 | fun getFadeInAnimation(offset: Int, duration: Int): Animation { 29 | val fadeIn = AlphaAnimation(0f, 1f) 30 | fadeIn.startOffset = offset.toLong() 31 | fadeIn.interpolator = DecelerateInterpolator() 32 | fadeIn.duration = duration.toLong() 33 | return fadeIn 34 | } 35 | 36 | fun setBouncingAnimation(view: View, offset: Int, duration: Int): View { 37 | 38 | val objAnim = ObjectAnimator.ofPropertyValuesHolder(view, 39 | PropertyValuesHolder.ofFloat("scaleX", 1.05f), 40 | PropertyValuesHolder.ofFloat("scaleY", 1.05f)) 41 | objAnim.duration = duration.toLong() 42 | objAnim.startDelay = offset.toLong() 43 | objAnim.repeatCount = ObjectAnimator.INFINITE 44 | objAnim.repeatMode = ObjectAnimator.REVERSE 45 | objAnim.start() 46 | return view 47 | } 48 | 49 | fun setAnimationToView(view: View, animation: Animation): View { 50 | view.startAnimation(animation) 51 | return view 52 | } 53 | } -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 26 | 27 | 28 | 29 | 30 | 31 | 33 | 34 | 35 | 36 | 37 | 1.8 38 | 39 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /bubbleshowcase/deploy.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.github.dcendents.android-maven' 2 | apply plugin: 'com.jfrog.bintray' 3 | apply from: 'keystore.gradle' 4 | 5 | //This file was created following instructions from: https://notes.devlabs.bg/beginners-guide-for-publishing-a-kotlin-library-to-jcenter-41272bfc214 6 | 7 | ext{ 8 | groupId = 'com.elconfidencial.bubbleshowcase' 9 | artifactId = 'bubbleshowcase' 10 | libraryVersion = '1.3.1' 11 | } 12 | 13 | version = libraryVersion 14 | group = groupId 15 | 16 | bintray{ 17 | user = 'laboratorioec' 18 | key = bintray_api_key //Defined in keystore.gradle file 19 | configurations = ['archives'] 20 | publish = true 21 | override = true 22 | pkg { 23 | repo = "Laboratorio-apps" 24 | name = "BubbleShowCase" 25 | version { 26 | name = libraryVersion 27 | } 28 | } 29 | } 30 | 31 | install { 32 | repositories.mavenInstaller { 33 | pom.project { 34 | packaging 'aar' 35 | groupId groupId 36 | artifactId artifactId 37 | version libraryVersion 38 | name artifactId 39 | } 40 | } 41 | } 42 | 43 | if (project.hasProperty("kotlin")) { //Kotlin libraries 44 | task sourcesJar(type: Jar) { 45 | classifier = 'sources' 46 | from android.sourceSets.main.java.srcDirs 47 | } 48 | 49 | task javadoc(type: Javadoc, dependsOn: dokka) { 50 | 51 | } 52 | } else if (project.hasProperty("android")) { 53 | task sourcesJar(type: Jar) { 54 | classifier = 'sources' 55 | from android.sourceSets.main.java.srcDirs 56 | } 57 | 58 | task javadoc(type: Javadoc) { 59 | source = android.sourceSets.main.java.srcDirs 60 | classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) 61 | } 62 | } else { // Java libraries 63 | task sourcesJar(type: Jar, dependsOn: classes) { 64 | classifier = 'sources' 65 | from sourceSets.main.allSource 66 | } 67 | } 68 | 69 | task javadocJar(type: Jar, dependsOn: javadoc) { 70 | classifier = 'javadoc' 71 | from javadoc.destinationDir 72 | // options.encoding = 'UTF-8' 73 | } 74 | 75 | artifacts { 76 | archives javadocJar 77 | archives sourcesJar 78 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /bubbleshowcase/src/main/res/layout/view_bubble_message.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 26 | 27 | 38 | 39 | 49 | 50 | 59 | 60 | 61 | 62 | 63 | 72 | 73 | -------------------------------------------------------------------------------- /bubbleshowcase/src/main/java/com/elconfidencial/bubbleshowcase/ScreenUtils.kt: -------------------------------------------------------------------------------- 1 | package com.elconfidencial.bubbleshowcase 2 | 3 | import android.app.Activity 4 | import android.content.Context 5 | import android.content.res.Resources 6 | import android.graphics.Point 7 | import android.graphics.Rect 8 | import android.util.DisplayMetrics 9 | import android.view.View 10 | import android.view.ViewGroup 11 | import android.view.WindowManager 12 | import android.view.Window.ID_ANDROID_CONTENT 13 | 14 | 15 | 16 | /** 17 | * Created by jcampos on 05/09/2018. 18 | */ 19 | object ScreenUtils { 20 | 21 | fun getScreenHeight(context: Context): Int { 22 | val wm = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager 23 | val display = wm.defaultDisplay 24 | val size = Point() 25 | display.getSize(size) 26 | return size.y 27 | } 28 | 29 | fun getScreenWidth(context: Context): Int { 30 | val wm = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager 31 | val display = wm.defaultDisplay 32 | val size = Point() 33 | display.getSize(size) 34 | return size.x 35 | } 36 | 37 | fun getAxisXpositionOfViewOnScreen(targetView: View): Int { 38 | val locationTarget = IntArray(2) 39 | targetView.getLocationOnScreen(locationTarget) 40 | return locationTarget[0] 41 | } 42 | 43 | fun getAxisYpositionOfViewOnScreen(targetView: View): Int { 44 | val locationTarget = IntArray(2) 45 | targetView.getLocationOnScreen(locationTarget) 46 | return locationTarget[1] 47 | } 48 | 49 | fun getVerticalScreenOffset(activity: Activity): Int{ 50 | val viewRoot = getViewRoot(activity) 51 | return getScreenHeight(activity) - viewRoot.height 52 | } 53 | 54 | fun getHorizontalScreenOffset(activity: Activity): Int{ 55 | val viewRoot = getViewRoot(activity) 56 | return getScreenWidth(activity) - viewRoot.width 57 | } 58 | 59 | private fun getViewRoot(activity: Activity): ViewGroup { 60 | val androidContent = activity.findViewById(android.R.id.content) 61 | return androidContent.parent.parent as ViewGroup 62 | } 63 | 64 | fun getStatusBarHeight(context: Context): Int { 65 | var result = 0 66 | val resourceId = context.resources.getIdentifier("status_bar_height", "dimen", "android") 67 | if (resourceId > 0) { 68 | result = context.resources.getDimensionPixelSize(resourceId) 69 | } 70 | return result 71 | } 72 | 73 | fun pxToDp(px: Int): Int { 74 | val metrics = Resources.getSystem().displayMetrics 75 | return Math.round(px / (metrics.densityDpi.toFloat() / DisplayMetrics.DENSITY_DEFAULT)) 76 | } 77 | 78 | fun dpToPx(dp: Int): Int { 79 | val metrics = Resources.getSystem().displayMetrics 80 | return Math.round(dp * (metrics.densityDpi.toFloat() / DisplayMetrics.DENSITY_DEFAULT)) 81 | } 82 | 83 | fun isViewLocatedAtHalfTopOfTheScreen(activity: Activity, targetView: View): Boolean{ 84 | val screenHeight = getScreenHeight(activity) 85 | val positionTargetAxisY = getAxisYpositionOfViewOnScreen(targetView) 86 | return screenHeight/2 > positionTargetAxisY 87 | } 88 | 89 | fun isViewLocatedAtHalfLeftOfTheScreen(activity: Activity, targetView: View): Boolean{ 90 | val screenWidth = getScreenWidth(activity) 91 | val positionTargetAxisX = getAxisXpositionOfViewOnScreen(targetView) 92 | return screenWidth/2 > positionTargetAxisX 93 | } 94 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 |