[
  {
    "path": ".gitignore",
    "content": ".gradle\r\n/local.properties\r\n/.idea/workspace.xml\r\n/.idea/libraries\r\n.DS_Store\r\n/build\r\n/captures\r\n*.iml\r\n.gradle/*\r\n.idea/*\r\n.idea\r\ngradlew.bat\r\n"
  },
  {
    "path": "Changelog.md",
    "content": "### 0.1.1\n\n - First version available.\n \n### 0.1.2\n\n - Min sdk changed to 1\n \n### 0.1.3\n \n - Animations added\n - Tip corner radius added\n - Min sdk changed to 11\n \n### 0.1.4\n \n - Fixed issues with anchored view in the CoordinatorLayout.\n \n### 0.1.5\n \n - Refactored code to use proper Builder pattern reducing method counts\n - Skipping animation if view is detached\n\n### 0.1.6\n\n - Fixed manifest for the library.\n - Added hide content when animating option to animation.\n \n### 0.1.7\n\n - Migrated to AndroidX.\n - Removed Bintray and moving to JitPack."
  },
  {
    "path": "License",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright 2016 Jay Rambhia\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License."
  },
  {
    "path": "README.md",
    "content": "## Tooltip\n\nThis is a lightweight library to show Tooltips dynamically in your app. This tooltip does\nnot require any custom layout. It works out of the box with all the layouts.\n\nHere's a short gif showing how it works.\n\n![Demo](https://raw.githubusercontent.com/jayrambhia/Tooltip/master/art/demo1.gif)\n\n## Tooltip.Builder\n\nTooltip uses Builder pattern to created immutable Tooltips.\n\n### Usage\n\n    Tooltip tooltip = new Tooltip.Builder(contenxt)\n                        .anchor(anchorView, Tooltip.BOTTOM)\n                        .content(contentView)\n                        .into(root)\n                        .withTip(new Tip(tipWidth, tipHeight, tipColor))\n                        .show();\n                        \nThat's it. It's that simple. You can customize the size and color of the tip to match color of the content view.\n\n## How To Install\n\n### JCenter / Bintray (Deprecated)\n\n##### Maven\n\n    repositories {\n        maven {\n            url  \"http://dl.bintray.com/jayrambhia/maven\"\n        }\n    }\n\n##### JCenter\n\n    repositories {\n        jcenter()\n    }\n\n##### Dependency\n\n    dependencies {\n        implementation 'com.fenchtose:tooltip:0.1.6'\n    }\n\n### JitPack\n\n    repositories {\n        maven {\n            url  \"https://jitpack.io\"\n        }\n    }\n    \n    dependencies {\n        implementation 'com.github.jayrambhia:Tooltip:0.1.7-1'\n    }\n\n### Useful Methods:\n\n - `anchor(View view)` - set anchor view with position as `Tooltip.TOP`\n - `anchor(View view, @Position int position)` - set anchor view with position\n - `content(View view)` - set content view of the tooltip\n - `animate(@NonNull TooltipAnimation animation)` - set Animation for Show and Dismiss\n - `withTip(@NonNull Tip tip)` - set `Tip` of the tooltip.\n - `into(ViewGroup viewGroup)` - set ViewGroup into which the tip is to be shown\n - `autoAdjust(boolean adjust)` - if you want the tooltip to adjust itself if going out of bound\n - `cancelable(boolean cancelable)` - if you want the tooltip to dismiss automatically if clicked outside. Default is true\n - `withPadding(int padding)` - distance from the anchor and screen boundaries\n - `autoCancel(int timeInMS)` - if tooltip should be dismissed automatically after given time. If value is <= 0, auto cancel is off\n - `withListener(@NonNull Listener listener)` - Attach dismiss listener.\n - `debug(boolean debug)` - Enable debugging mode. Default is false.\n - `checkForPreDraw(boolean check)` - Check if the anchor is drawn or not and then only draw the tooltip\n\n### Tip\n\nTip is drawn as an isosceles triangle. The length of the base is defined by width and perpendicular length between top vertex and base is defined by height.\n\n - `width` - length of the base of isosceles triangle\n - `height` - length of the perpendicular from top vertex to the base\n - `color` - Color of the tip\n - `tipRadius` - Corner radius of the tip\n\n### TooltipAnimation\n\nTooltipAnimation just holds type of the animation to be performed and duration of the animation\n \n - `type` - Type of animation - `FADE`, `SCALE`, `REVEAL`, `SCALE_AND_FADE`\n - `duration` - Animation duration in milliseconds\n - `hideContentWhileAnimating` - Content of the tooltip will be hidden when it's animating in or out. This will not work if the content is a View and not a ViewGroup.\n \n Animations are a bit tricky in this library. `FADE` and `REVEAL` are applied on the container of the tooltip\n with appropriate parameters. So if the container has some background color, it looks really weird. The same\n method can't be applied for `SCALE` because it doesn't draw the tooltip properly. So in `SCALE`, the animation\n is applied on Tooltip's content view (and if tip is present, it will be there as it is not part of the content view).\n To avoid this eye sore, you may use `SCALE_AND_FADE`, it does `SCALE` and `FADE` so the poor effect is not visible.\n \n `REVEAL` uses Circular Reveal and hence is supported for API 21 and above.\n \n\n### CoordinatorLayout and Anchored Views\n\n When a view(eg. FAB) is anchored to another view in the CoordinatorLayout and you try to draw a tooltip \n as that view as anchor, it doesn't work properly. I'm assuming that CoordinatorLayout first draws fab and them moves? I don't know.\n Anyway, an `onPreDrawListener` listener has been added and once the event is received, tooltip is laid out.\n By default, this method is not performed. To perform this method, use `checkForPreDraw(true)` while creating the builder.\n \n### Future Work\n \n - Customizable tips\n - Shadow\n - Improve and add more animations\n\n## Licenses and Release History\n\n**[CHANGELOG](https://github.com/jayrambhia/Tooltip/blob/master/Changelog.md)**\n\nNoCropper binaries and source code can be used according to the [Apache License, Version 2.0](https://github.com/jayrambhia/Tooltip/blob/master/License)."
  },
  {
    "path": "build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    repositories {\n        mavenCentral()\n        google()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:4.1.3'\n        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        mavenCentral()\n        google()\n        maven { url 'https://jitpack.io' }\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Mon Sep 11 16:57:47 CEST 2017\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-6.5-all.zip\n"
  },
  {
    "path": "gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\n\nandroid.useAndroidX=true"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\nesac\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "sample/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "sample/build.gradle",
    "content": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 29\n    buildToolsVersion \"29.0.3\"\n\n    defaultConfig {\n        applicationId \"com.fenchtose.tooltip\"\n        minSdkVersion 14\n        targetSdkVersion 29\n        versionCode 1\n        versionName \"1.0\"\n    }\n    buildTypes {\n        debug {\n            minifyEnabled true\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n        release {\n            minifyEnabled true\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\ndependencies {\n    implementation fileTree(dir: 'libs', include: ['*.jar'])\n    implementation 'junit:junit:4.13.2'\n    implementation \"androidx.appcompat:appcompat:1.2.0\"\n    implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'\n    implementation 'com.google.android.material:material:1.3.0'\n//    implementation project(\":tooltip\")\n    implementation 'com.github.jayrambhia:Tooltip:0.1.7-1'\n}\n"
  },
  {
    "path": "sample/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /Users/admin/Library/Android/sdk/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "sample/src/androidTest/java/com/fenchtose/tooltip_demo/ApplicationTest.java",
    "content": "package com.fenchtose.tooltip_demo;\n\nimport android.app.Application;\nimport android.test.ApplicationTestCase;\n\n/**\n * <a href=\"http://d.android.com/tools/testing/testing_android.html\">Testing Fundamentals</a>\n */\npublic class ApplicationTest extends ApplicationTestCase<Application> {\n    public ApplicationTest() {\n        super(Application.class);\n    }\n}"
  },
  {
    "path": "sample/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.fenchtose.tooltip_demo\">\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style/AppTheme\">\n        <activity android:name=\"com.fenchtose.tooltip_demo.MainActivity\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n\n        <activity android:name=\".SecondActivity\"/>\n        <activity android:name=\".FragmentHolderActivity\" />\n\n    </application>\n\n</manifest>"
  },
  {
    "path": "sample/src/main/java/com/fenchtose/tooltip_demo/FragmentHolderActivity.java",
    "content": "package com.fenchtose.tooltip_demo;\n\nimport android.os.Bundle;\n\nimport androidx.annotation.Nullable;\nimport androidx.appcompat.app.AppCompatActivity;\nimport androidx.fragment.app.Fragment;\n\npublic class FragmentHolderActivity extends AppCompatActivity {\n    @Override\n    protected void onCreate(@Nullable Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_fragment_holder);\n\n        Fragment fragment = new TooltipFragmentDemo();\n        getSupportFragmentManager().beginTransaction()\n            .add(R.id.fragment_container, fragment)\n            .commit();\n    }\n}\n"
  },
  {
    "path": "sample/src/main/java/com/fenchtose/tooltip_demo/MainActivity.java",
    "content": "package com.fenchtose.tooltip_demo;\n\nimport android.content.Intent;\nimport android.content.res.Resources;\nimport android.os.Bundle;\nimport android.view.Menu;\nimport android.view.MenuItem;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.FrameLayout;\nimport android.widget.TextView;\n\nimport androidx.annotation.NonNull;\nimport androidx.annotation.StringRes;\nimport androidx.appcompat.app.AppCompatActivity;\nimport androidx.core.content.ContextCompat;\n\nimport com.fenchtose.tooltip.Tooltip;\nimport com.fenchtose.tooltip.TooltipAnimation;\n\n@SuppressWarnings(\"ConstantConditions\")\npublic class MainActivity extends AppCompatActivity {\n\n    private ViewGroup root;\n\n    private int tooltipColor;\n    private int tooltipSize;\n    private int tooltipPadding;\n\n    private int tipSizeSmall;\n    private int tipSizeRegular;\n    private int tipRadius;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        root = (ViewGroup) findViewById(R.id.root);\n\n        Resources res = getResources();\n\n        tooltipSize = res.getDimensionPixelOffset(R.dimen.tooltip_width);\n        tooltipColor = ContextCompat.getColor(this, R.color.colorPrimary);\n        tooltipPadding = res.getDimensionPixelOffset(R.dimen.tooltip_padding);\n\n        tipSizeSmall = res.getDimensionPixelSize(R.dimen.tip_dimen_small);\n        tipSizeRegular = res.getDimensionPixelSize(R.dimen.tip_dimen_regular);\n        tipRadius = res.getDimensionPixelOffset(R.dimen.tip_radius);\n\n        final View bottomButton = findViewById(R.id.button_bottom);\n        if (bottomButton != null) {\n            bottomButton.setOnClickListener(new View.OnClickListener() {\n                @Override\n                public void onClick(View v) {\n                    showCustomTooltip(v);\n                }\n            });\n        }\n\n        findViewById(R.id.bottom_auto_adjust).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                showTooltip(v, R.string.bottom_auto_adjust, Tooltip.BOTTOM, true,\n                        TooltipAnimation.SCALE, false,\n                        tooltipSize,\n                        ViewGroup.LayoutParams.WRAP_CONTENT);\n            }\n        });\n\n        findViewById(R.id.bottom_no_auto_adjust).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                showTooltip(v, R.string.bottom_no_auto_adjust, Tooltip.BOTTOM, false,\n                        TooltipAnimation.SCALE, false,\n                        tooltipSize,\n                        ViewGroup.LayoutParams.WRAP_CONTENT);\n            }\n        });\n\n        findViewById(R.id.bottom).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                showTooltip(v, R.string.bottom, Tooltip.BOTTOM, false,\n                        TooltipAnimation.SCALE, true,\n                        tooltipSize,\n                        ViewGroup.LayoutParams.WRAP_CONTENT);\n            }\n        });\n\n        findViewById(R.id.top_auto_adjust).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                showTooltip(v, R.string.top_auto_adjust, Tooltip.TOP, true,\n                        TooltipAnimation.NONE, false, tooltipSize,\n                        ViewGroup.LayoutParams.WRAP_CONTENT);\n            }\n        });\n\n        findViewById(R.id.top_no_auto_adjust).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                showTooltip(v, R.string.top_no_auto_adjust, Tooltip.TOP, false,\n                        TooltipAnimation.NONE, false, tooltipSize,\n                        ViewGroup.LayoutParams.WRAP_CONTENT);\n            }\n        });\n\n        findViewById(R.id.top).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                showTooltip(v, R.string.top, Tooltip.TOP, false,TooltipAnimation.NONE, false, tooltipSize,\n                        ViewGroup.LayoutParams.WRAP_CONTENT);\n            }\n        });\n\n        findViewById(R.id.right_auto_adjust).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                showTooltip(v, R.string.right_auto_adjust, Tooltip.RIGHT, true,\n                        TooltipAnimation.REVEAL, true,\n                        ViewGroup.LayoutParams.WRAP_CONTENT,\n                        tooltipSize);\n            }\n        });\n\n        findViewById(R.id.right_no_auto_adjust).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                showTooltip(v, R.string.right_no_auto_adjust, Tooltip.RIGHT, false,\n                        TooltipAnimation.REVEAL, true,\n                        ViewGroup.LayoutParams.WRAP_CONTENT,\n                        tooltipSize);\n            }\n        });\n\n        findViewById(R.id.right).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                showTooltip(v, R.string.right, Tooltip.RIGHT, false,\n                        TooltipAnimation.REVEAL, false,\n                        tooltipSize, ViewGroup.LayoutParams.WRAP_CONTENT);\n            }\n        });\n\n        findViewById(R.id.left_auto_adjust).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                showTooltip(v, R.string.left_auto_adjust, Tooltip.LEFT, true,\n                        TooltipAnimation.SCALE_AND_FADE, true,\n                        ViewGroup.LayoutParams.WRAP_CONTENT,\n                        tooltipSize);\n            }\n        });\n\n        findViewById(R.id.left_no_auto_adjust).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                showTooltip(v, R.string.left_no_auto_adjust, Tooltip.LEFT, false,\n                        TooltipAnimation.SCALE_AND_FADE, true,\n                        ViewGroup.LayoutParams.WRAP_CONTENT,\n                        tooltipSize);\n            }\n        });\n\n        findViewById(R.id.left).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                showTooltip(v, R.string.left, Tooltip.LEFT, false,\n                        TooltipAnimation.SCALE_AND_FADE, false,\n                        tooltipSize, ViewGroup.LayoutParams.WRAP_CONTENT);\n            }\n        });\n    }\n\n    @Override\n    public boolean onCreateOptionsMenu(Menu menu) {\n        getMenuInflater().inflate(R.menu.main_menu, menu);\n        return super.onCreateOptionsMenu(menu);\n    }\n\n    @Override\n    public boolean onOptionsItemSelected(MenuItem item) {\n        if (item.getItemId() == R.id.demo_action) {\n            showMenuTooltip(findViewById(R.id.demo_action));\n        } else if (item.getItemId() == R.id.second_action) {\n            openSecondActivity();\n        } else if (item.getItemId() == R.id.third_action) {\n            openFragmentDemo();\n        }\n        return true;\n    }\n\n    private void openSecondActivity() {\n        Intent intent = new Intent(this, SecondActivity.class);\n        startActivity(intent);\n    }\n\n    private void openFragmentDemo() {\n        Intent intent = new Intent(this, FragmentHolderActivity.class);\n        startActivity(intent);\n    }\n\n    private void showTooltip(@NonNull View anchor, @StringRes int resId,\n                             @Tooltip.Position int position, boolean autoAdjust,\n                             @TooltipAnimation.Type int type, boolean hideWhenAnimating,\n                             int width, int height) {\n        ViewGroup contentView = (ViewGroup) getLayoutInflater().inflate(R.layout.tooltip_textview, null);\n        TextView textView = (TextView) contentView.getChildAt(0);\n        textView.setText(resId);\n        textView.setLayoutParams(new FrameLayout.LayoutParams(width, height));\n        showTooltip(anchor, contentView, position, autoAdjust, type, hideWhenAnimating, tooltipColor);\n    }\n\n    private void showTooltip(@NonNull View anchor, @NonNull View content,\n                             @Tooltip.Position int position, boolean autoAdjust,\n                             @TooltipAnimation.Type int type, boolean hideWhenAnimating,\n                             int tipColor) {\n\n        new Tooltip.Builder(this)\n                .anchor(anchor, position)\n                .animate(new TooltipAnimation(type, 500, hideWhenAnimating))\n                .autoAdjust(autoAdjust)\n                .content(content)\n                .withTip(new Tooltip.Tip(tipSizeRegular, tipSizeRegular, tipColor))\n                .into(root)\n                .debug(true)\n                .show();\n    }\n\n    private void showCustomTooltip(@NonNull View anchor) {\n        View content = getLayoutInflater().inflate(R.layout.item_tooltip_view_1, null);\n\n        final Tooltip customTooltip = new Tooltip.Builder(this)\n                .anchor(anchor, Tooltip.BOTTOM)\n                .animate(new TooltipAnimation(TooltipAnimation.SCALE_AND_FADE, 400, true))\n                .autoAdjust(true)\n                .withPadding(tooltipPadding)\n                .content(content)\n                .cancelable(false)\n                .withTip(new Tooltip.Tip(tipSizeRegular, tipSizeRegular, tooltipColor, tipRadius))\n                .into(root)\n                .debug(true)\n                .show();\n\n        content.findViewById(R.id.dismiss_button).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                customTooltip.dismiss(true);\n            }\n        });\n    }\n\n    private void showMenuTooltip(@NonNull View anchor) {\n        ViewGroup content = (ViewGroup) getLayoutInflater().inflate(R.layout.tooltip_textview, null);\n        TextView textView = (TextView) content.getChildAt(0);\n        textView.setText(R.string.menu_tooltip);\n\n        new Tooltip.Builder(this)\n                .anchor(anchor, Tooltip.BOTTOM)\n                .animate(new TooltipAnimation(TooltipAnimation.REVEAL, 400))\n                .autoAdjust(true)\n                .autoCancel(2000)\n                .content(content)\n                .withPadding(getResources().getDimensionPixelOffset(R.dimen.menu_tooltip_padding))\n                .withTip(new Tooltip.Tip(tipSizeSmall, tipSizeSmall, tooltipColor))\n                .into(root)\n                .debug(true)\n                .show();\n    }\n}\n"
  },
  {
    "path": "sample/src/main/java/com/fenchtose/tooltip_demo/SecondActivity.java",
    "content": "package com.fenchtose.tooltip_demo;\n\nimport android.content.res.Resources;\nimport android.os.Bundle;\nimport android.os.Handler;\nimport android.view.View;\n\nimport androidx.annotation.NonNull;\nimport androidx.annotation.Nullable;\nimport androidx.appcompat.app.AppCompatActivity;\nimport androidx.coordinatorlayout.widget.CoordinatorLayout;\nimport androidx.core.content.ContextCompat;\n\nimport com.fenchtose.tooltip.Tooltip;\nimport com.fenchtose.tooltip.TooltipAnimation;\nimport com.google.android.material.floatingactionbutton.FloatingActionButton;\n\n/**\n * Created by Jay Rambhia on 5/27/16.\n */\npublic class SecondActivity extends AppCompatActivity {\n\n    private static final String TAG = \"SecondActivity\";\n    private CoordinatorLayout root;\n    private FloatingActionButton fab;\n\n    private int tooltipColor;\n    private int tooltipSize;\n    private int tooltipPadding;\n\n    private int tipSizeSmall;\n    private int tipSizeRegular;\n    private int tipRadius;\n\n    @Override\n    protected void onCreate(@Nullable Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_second);\n        root = (CoordinatorLayout) findViewById(R.id.root_layout);\n        fab = (FloatingActionButton) findViewById(R.id.fab);\n\n        Resources res = getResources();\n\n        tooltipSize = res.getDimensionPixelOffset(R.dimen.tooltip_width);\n        tooltipColor = ContextCompat.getColor(this, R.color.colorPrimary);\n        tooltipPadding = res.getDimensionPixelOffset(R.dimen.tooltip_padding);\n\n        tipSizeSmall = res.getDimensionPixelSize(R.dimen.tip_dimen_small);\n        tipSizeRegular = res.getDimensionPixelSize(R.dimen.tip_dimen_regular);\n\n        tipRadius = res.getDimensionPixelOffset(R.dimen.tip_radius);\n\n        new Handler().postDelayed(new Runnable() {\n            @Override\n            public void run() {\n                showTooltip();\n            }\n        }, 1000);\n    }\n\n    private void showTooltip() {\n        showCustomTooltip(fab);\n    }\n\n    private void showCustomTooltip(@NonNull View anchor) {\n        View content = getLayoutInflater().inflate(R.layout.item_tooltip_view_1, null);\n\n        final Tooltip customTooltip = new Tooltip.Builder(this)\n                .anchor(anchor, Tooltip.TOP)\n                .animate(new TooltipAnimation(TooltipAnimation.SCALE_AND_FADE, 400))\n                .autoAdjust(true)\n                .withPadding(tooltipPadding)\n                .content(content)\n                .cancelable(false)\n                .checkForPreDraw(true)\n                .withTip(new Tooltip.Tip(tipSizeRegular, tipSizeRegular, tooltipColor, tipRadius))\n                .into(root)\n                .debug(true)\n                .show();\n\n        content.findViewById(R.id.dismiss_button).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                customTooltip.dismiss(true);\n            }\n        });\n\n    }\n}\n"
  },
  {
    "path": "sample/src/main/java/com/fenchtose/tooltip_demo/TooltipFragmentDemo.java",
    "content": "package com.fenchtose.tooltip_demo;\n\nimport android.content.res.Resources;\nimport android.os.Bundle;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\n\nimport androidx.annotation.Nullable;\nimport androidx.core.content.ContextCompat;\nimport androidx.fragment.app.Fragment;\n\nimport com.fenchtose.tooltip.Tooltip;\nimport com.fenchtose.tooltip.TooltipAnimation;\n\npublic class TooltipFragmentDemo extends Fragment {\n\n    private ViewGroup mRootLayout;\n\n    @Nullable\n    @Override\n    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n        return inflater.inflate(R.layout.tooltip_fragment_demo_layout, container,false);\n    }\n\n    @Override\n    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {\n        super.onViewCreated(view, savedInstanceState);\n        view.findViewById(R.id.button_bottom).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                showCustomTooltip(v);\n            }\n        });\n\n        mRootLayout = (ViewGroup)view;\n    }\n\n    private void showCustomTooltip(View anchor) {\n        View content = LayoutInflater.from(getContext()).inflate(R.layout.item_tooltip_view_1, null);\n        Resources res = getResources();\n\n        int tooltipPadding = res.getDimensionPixelOffset(R.dimen.tooltip_padding);\n        int tooltipColor = ContextCompat.getColor(getContext(), R.color.colorPrimary);\n        int tipSizeSmall = res.getDimensionPixelSize(R.dimen.tip_dimen_small);\n        int tipRadius = res.getDimensionPixelOffset(R.dimen.tip_radius);\n\n        new Tooltip.Builder(getActivity())\n            .anchor(anchor, Tooltip.BOTTOM)\n            .animate(new TooltipAnimation(TooltipAnimation.SCALE_AND_FADE, 400))\n            .autoAdjust(true)\n            .withPadding(tooltipPadding)\n//            .withMargin(6)\n            .content(content)\n            .cancelable(true)\n            .checkForPreDraw(true)\n            .withTip(new Tooltip.Tip(tipSizeSmall, tipSizeSmall, tooltipColor))\n            .into(mRootLayout)\n            .debug(true)\n            .show();\n    }\n}\n"
  },
  {
    "path": "sample/src/main/res/layout/activity_fragment_holder.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:id=\"@+id/fragment_container\">\n\n</FrameLayout>"
  },
  {
    "path": "sample/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/root\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:padding=\"0dp\"\n    tools:context=\"com.fenchtose.tooltip_demo.MainActivity\">\n\n    <ImageView\n        android:id=\"@+id/right_auto_adjust\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:src=\"@mipmap/ic_launcher\"/>\n\n    <ImageView\n        android:id=\"@+id/right_no_auto_adjust\"\n        android:layout_marginTop=\"48dp\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:src=\"@mipmap/ic_launcher\"/>\n\n    <ImageView\n        android:id=\"@+id/right\"\n        android:layout_marginTop=\"112dp\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:src=\"@mipmap/ic_launcher\"/>\n\n    <ImageView\n        android:layout_alignParentBottom=\"true\"\n        android:id=\"@+id/top_auto_adjust\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:src=\"@mipmap/ic_launcher\"/>\n\n    <ImageView\n        android:layout_alignParentBottom=\"true\"\n        android:id=\"@+id/top_no_auto_adjust\"\n        android:layout_marginLeft=\"48dp\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:src=\"@mipmap/ic_launcher\"/>\n\n    <ImageView\n        android:layout_alignParentBottom=\"true\"\n        android:id=\"@+id/top\"\n        android:layout_marginLeft=\"112dp\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:src=\"@mipmap/ic_launcher\"/>\n\n    <ImageView\n        android:layout_alignParentBottom=\"true\"\n        android:layout_alignParentRight=\"true\"\n        android:id=\"@+id/left_auto_adjust\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:src=\"@mipmap/ic_launcher\"/>\n\n    <ImageView\n        android:layout_alignParentBottom=\"true\"\n        android:layout_alignParentRight=\"true\"\n        android:id=\"@+id/left_no_auto_adjust\"\n        android:layout_marginBottom=\"48dp\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:src=\"@mipmap/ic_launcher\"/>\n\n    <ImageView\n        android:layout_alignParentBottom=\"true\"\n        android:layout_alignParentRight=\"true\"\n        android:id=\"@+id/left\"\n        android:layout_marginBottom=\"112dp\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:src=\"@mipmap/ic_launcher\"/>\n\n    <ImageView\n        android:layout_alignParentRight=\"true\"\n        android:id=\"@+id/bottom_auto_adjust\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:src=\"@mipmap/ic_launcher\"/>\n\n    <ImageView\n        android:layout_alignParentRight=\"true\"\n        android:id=\"@+id/bottom_no_auto_adjust\"\n        android:layout_marginRight=\"48dp\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:src=\"@mipmap/ic_launcher\"/>\n\n    <ImageView\n        android:layout_alignParentRight=\"true\"\n        android:id=\"@+id/bottom\"\n        android:layout_marginRight=\"112dp\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:src=\"@mipmap/ic_launcher\"/>\n\n    <Button\n        android:id=\"@+id/button_bottom\"\n        android:layout_centerInParent=\"true\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"@string/tooltip_bottom\"/>\n</RelativeLayout>\n"
  },
  {
    "path": "sample/src/main/res/layout/activity_second.xml",
    "content": "<androidx.coordinatorlayout.widget.CoordinatorLayout\n    android:id=\"@+id/root_layout\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\">\n\n\n    <com.google.android.material.appbar.AppBarLayout\n        android:id=\"@+id/appbar\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:theme=\"@style/ThemeOverlay.AppCompat.Dark.ActionBar\"\n        android:fitsSystemWindows=\"true\">\n\n        <androidx.appcompat.widget.Toolbar\n            android:id=\"@+id/toolbar\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"?attr/actionBarSize\"\n            android:background=\"?attr/colorPrimary\"\n            android:fitsSystemWindows=\"false\"\n            app:layout_scrollFlags=\"scroll|enterAlways\"\n            android:elevation=\"0dp\"\n            tools:targetApi=\"21\"\n            app:popupTheme=\"@style/ThemeOverlay.AppCompat.Light\">\n\n\n        </androidx.appcompat.widget.Toolbar>\n\n        <com.google.android.material.tabs.TabLayout\n            android:id=\"@+id/tabs\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"56dp\"\n            android:background=\"?attr/colorPrimary\"\n            android:scrollbarSize=\"24sp\"\n            app:tabMode=\"scrollable\" />\n\n    </com.google.android.material.appbar.AppBarLayout>\n\n    <!--<LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:id=\"@+id/viewpager_container\"\n        app:layout_behavior=\"@string/appbar_scrolling_view_behavior\"\n        android:orientation=\"vertical\">-->\n\n\n    <androidx.viewpager2.widget.ViewPager2\n        android:id=\"@+id/viewpager\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        app:layout_behavior=\"@string/appbar_scrolling_view_behavior\">\n\n        <!--<android.support.v4.view.PagerTabStrip\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"48dp\"\n            android:layout_gravity=\"top\"/>-->\n\n    </androidx.viewpager2.widget.ViewPager2>\n\n\n    <com.google.android.material.floatingactionbutton.FloatingActionButton\n        android:id=\"@+id/fab\"\n        android:layout_height=\"56dp\"\n        android:layout_width=\"56dp\"\n        app:fabSize=\"normal\"\n        android:layout_margin=\"16dp\"\n        android:src=\"@drawable/ic_add_white_24dp\"\n        app:elevation=\"8dp\"\n        app:borderWidth=\"0dp\"\n        app:layout_anchor=\"@id/viewpager\"\n        app:layout_anchorGravity=\"bottom|right|end\"\n        app:layout_behavior=\"@string/appbar_scrolling_view_behavior\" />\n\n\n</androidx.coordinatorlayout.widget.CoordinatorLayout>"
  },
  {
    "path": "sample/src/main/res/layout/item_tooltip_view_1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\"\n    android:padding=\"8dp\"\n    android:background=\"@color/colorPrimary\"\n    android:layout_width=\"wrap_content\"\n    android:gravity=\"center_horizontal\"\n    android:layout_height=\"wrap_content\">\n\n    <TextView\n        android:id=\"@+id/textview\"\n        android:layout_width=\"200dp\"\n        android:gravity=\"center\"\n        android:textColor=\"@android:color/white\"\n        android:textSize=\"16sp\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"@string/custom_view\"/>\n\n    <ImageView\n        android:id=\"@+id/dismiss_button\"\n        android:layout_margin=\"8dp\"\n        android:layout_width=\"48dp\"\n        android:layout_height=\"48dp\"\n        android:src=\"@mipmap/ic_launcher\"/>\n\n</LinearLayout>"
  },
  {
    "path": "sample/src/main/res/layout/tooltip_fragment_demo_layout.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\">\n\n    <Button\n        android:id=\"@+id/button_bottom\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"center\"\n        android:text=\"@string/tooltip_bottom\" />\n\n</FrameLayout>"
  },
  {
    "path": "sample/src/main/res/layout/tooltip_textview.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"wrap_content\"\n\tandroid:layout_height=\"wrap_content\"\n\tandroid:background=\"@color/colorPrimary\"\n\t>\n\n\t<TextView\n\t\tandroid:layout_width=\"wrap_content\"\n\t\tandroid:padding=\"8dp\"\n\t\tandroid:textColor=\"@android:color/white\"\n\t\tandroid:textSize=\"16sp\"\n\t\tandroid:text=\"@string/bottom_auto_adjust\"\n\t\tandroid:layout_height=\"wrap_content\">\n\n\t</TextView>\n\n</FrameLayout>\n"
  },
  {
    "path": "sample/src/main/res/menu/main_menu.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\">\n    <item\n        android:id=\"@+id/demo_action\"\n        android:icon=\"@drawable/ic_add_white_24dp\"\n        app:showAsAction=\"always\"\n        android:title=\"Add\"/>\n\n    <item\n        android:id=\"@+id/second_action\"\n        android:title=\"FAB Tooltip\"/>\n\n    <item\n        android:id=\"@+id/third_action\"\n        android:title=\"Tooltip in fragment\"/>\n\n</menu>"
  },
  {
    "path": "sample/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#3F51B5</color>\n    <color name=\"colorPrimaryDark\">#303F9F</color>\n    <color name=\"colorAccent\">#FF4081</color>\n</resources>\n"
  },
  {
    "path": "sample/src/main/res/values/dimens.xml",
    "content": "<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"activity_vertical_margin\">16dp</dimen>\n\n    <dimen name=\"tooltip_width\">200dp</dimen>\n    <dimen name=\"tooltip_padding\">18dp</dimen>\n    <dimen name=\"menu_tooltip_padding\">4dp</dimen>\n    <dimen name=\"tip_radius\">4dp</dimen>\n    \n    <dimen name=\"tip_dimen_regular\">16dp</dimen>\n    <dimen name=\"tip_dimen_small\">12dp</dimen>\n\n</resources>\n"
  },
  {
    "path": "sample/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">Tooltip</string>\n\n    <string name=\"bottom_auto_adjust\">This tooltip has BOTTOM position and it will adjust its sides so as to stay in the bounds. SCALE Animation</string>\n    <string name=\"bottom_no_auto_adjust\">This tooltip has BOTTOM position. It will not auto adjust to bounds. SCALE Animation</string>\n    <string name=\"bottom\">This tooltip has BOTTOM position and no adjustments are required. SCALE Animation</string>\n\n    <string name=\"top_auto_adjust\">This tooltip has TOP position and it will adjust its sides so as to stay in the bounds. NO animation</string>\n    <string name=\"top_no_auto_adjust\">This tooltip has TOP position. It will not auto adjust to bounds. NO animation</string>\n    <string name=\"top\">This tooltip has TOP position and no adjustments are required. NO animation</string>\n\n    <string name=\"right_auto_adjust\">This\\ntooltip has\\nRIGHT\\nposition \\nand\\nit will adjust \\nits sides\\nso as to stay in\\nthe bounds\\nREVEAL Animation</string>\n    <string name=\"right_no_auto_adjust\">This\\ntooltip has\\nRIGHT\\nposition.\\n\\nIt will not auto\\n\\nadjust\\nto bounds\\nREVEAL Animation</string>\n    <string name=\"right\">This tooltip has RIGHT position and no adjustments are required\\nREVEAL Animation</string>\n\n    <string name=\"left_auto_adjust\">This tooltip has\\nLEFT position \\nand\\nit will adjust \\nits sides\\nso as to stay in\\nthe bounds\\nSCALE_AND_FADE</string>\n    <string name=\"left_no_auto_adjust\">This\\ntooltip has\\nLEFT\\nposition.\\n\\nIt will not auto\\n\\nadjust\\nto bounds\\nSCALE_AND_FADE</string>\n    <string name=\"left\">This tooltip has LEFT position and no adjustments are required\\nSCALE_AND_FADE</string>\n\n    <string name=\"custom_view\">Hey, This is a custom view.\\nThis has SCALE_AND_FADE animation\\nCheck out corner of the tip.\\n\\nClick android to dismiss</string>\n    <string name=\"menu_tooltip\">This is a tooltip for menu item.\\nThis has REVEAL animation.\\nThis will animate only for\\nlollipop and above\\nThis will go away in 2000 ms</string>\n\n</resources>\n"
  },
  {
    "path": "sample/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\">\n        <!-- Customize your theme here. -->\n        <item name=\"colorPrimary\">@color/colorPrimary</item>\n        <item name=\"colorPrimaryDark\">@color/colorPrimaryDark</item>\n        <item name=\"colorAccent\">@color/colorAccent</item>\n    </style>\n\n</resources>\n"
  },
  {
    "path": "sample/src/main/res/values/values.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <string name=\"tooltip_bottom\">Bottom Tooltip</string>\n</resources>"
  },
  {
    "path": "sample/src/main/res/values-w820dp/dimens.xml",
    "content": "<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "sample/src/test/java/com/fenchtose/tooltip_demo/ExampleUnitTest.java",
    "content": "package com.fenchtose.tooltip_demo;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * To work on unit tests, switch the Test Artifact in the Build Variants view.\n */\npublic class ExampleUnitTest {\n    @Test\n    public void addition_isCorrect() throws Exception {\n        assertEquals(4, 2 + 2);\n    }\n}"
  },
  {
    "path": "settings.gradle",
    "content": "include ':sample', ':tooltip'\n"
  },
  {
    "path": "tooltip/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "tooltip/build.gradle",
    "content": "apply plugin: 'com.android.library'\napply plugin: 'com.github.dcendents.android-maven'\napply plugin: 'maven'\n\nversion = \"0.1.7\"\ngroup = \"com.github.jayrambhia\"\n\ndef siteUrl = \"https://github.com/jayrambhia/Tooltip\"\ndef gitUrl = \"https://github.com/jayrambhia/Tooltip.git\"\n\nandroid {\n    compileSdkVersion 29\n    buildToolsVersion \"29.0.3\"\n\n    defaultConfig {\n        minSdkVersion 11\n        targetSdkVersion 29\n        versionCode 12\n        versionName version\n    }\n    buildTypes {\n    }\n}\n\nProperties properties = new Properties()\nproperties.load(project.rootProject.file('local.properties').newDataInputStream())\n\ninstall {\n    repositories.mavenInstaller {\n        pom {\n            project {\n                packaging 'aar'\n                name 'A Simple Utility for showing Tooltips'\n                url siteUrl\n                licenses {\n                    license {\n                        name 'The Apache Software License, Version 2.0'\n                        url 'http://www.apache.org/licenses/LICENSE-2.0.txt'\n                    }\n                }\n\n                developers {\n                    developer {\n                        id 'jayarambhia'\n                        name ' Jay Rambhia'\n                        email ' jayrambhia777@gmail.com'\n                    }\n                }\n\n                scm {\n                    connection gitUrl\n                    developerConnection gitUrl\n                    url siteUrl\n                }\n            }\n        }\n    }\n}\n\nconfigurations {\n    javadocDeps\n}\n\ndependencies {\n    api 'androidx.annotation:annotation:1.2.0'\n    javadocDeps 'androidx.annotation:annotation:1.2.0'\n}\n\ntask sourcesJar(type: Jar) {\n    from android.sourceSets.main.java.srcDirs\n    classifier = 'sources'\n}\n\ntask javadoc(type: Javadoc) {\n    source = android.sourceSets.main.java.srcDirs\n    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))\n    classpath += configurations.javadocDeps\n}\n\ntask javadocJar(type: Jar, dependsOn: javadoc) {\n    classifier = 'javadoc'\n    from javadoc.destinationDir\n}\nartifacts {\n    archives javadocJar\n    archives sourcesJar\n}"
  },
  {
    "path": "tooltip/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /Users/admin/Library/Android/sdk/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "tooltip/src/androidTest/java/com/fenchtose/tooltip/ApplicationTest.java",
    "content": "package com.fenchtose.tooltip;\n\nimport android.app.Application;\nimport android.test.ApplicationTestCase;\n\n/**\n * <a href=\"http://d.android.com/tools/testing/testing_android.html\">Testing Fundamentals</a>\n */\npublic class ApplicationTest extends ApplicationTestCase<Application> {\n    public ApplicationTest() {\n        super(Application.class);\n    }\n}"
  },
  {
    "path": "tooltip/src/main/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.fenchtose.tooltip\">\n</manifest>\n"
  },
  {
    "path": "tooltip/src/main/java/com/fenchtose/tooltip/AnimationUtils.java",
    "content": "package com.fenchtose.tooltip;\n\nimport android.animation.Animator;\nimport android.animation.ObjectAnimator;\nimport android.annotation.TargetApi;\nimport android.os.Build;\nimport android.view.View;\nimport android.view.ViewAnimationUtils;\n\nimport androidx.annotation.NonNull;\n\n/**\n * Helper class to create Animator Objects\n */\npublic class AnimationUtils {\n\n    /**\n     * Fade Animation\n     * @param view View to be animated\n     * @param fromAlpha initial alpha\n     * @param toAlpha final alpha\n     * @param duration animation duration in milliseconds\n     * @return Animator Object\n     */\n    @NonNull\n    public static Animator fade(@NonNull final View view, float fromAlpha, float toAlpha, int duration) {\n        ObjectAnimator animator = ObjectAnimator.ofFloat(view, \"alpha\", fromAlpha, toAlpha);\n        animator.setDuration(duration);\n        return animator;\n    }\n\n    /**\n     * Circular Reveal Animation\n     * @param view View to be animated\n     * @param cx x coordinate of the center of the circle\n     * @param cy y coordinate of the center of the circle\n     * @param startRadius initial circle radius\n     * @param finalRadius final circle radius\n     * @param duration animation duration in milliseconds\n     * @return Animator Object\n     */\n    @NonNull\n    @TargetApi(Build.VERSION_CODES.LOLLIPOP)\n    public static Animator reveal(@NonNull final View view, int cx, int cy, int startRadius, int finalRadius, int duration) {\n        Animator animator = ViewAnimationUtils.createCircularReveal(view, cx, cy, startRadius, finalRadius);\n        animator.setDuration(duration);\n        return animator;\n    }\n\n    /*@NonNull\n    public static Animator slideY(@NonNull View view, int fromY, int toY, int duration) {\n        ObjectAnimator animator = ObjectAnimator.ofFloat(view, \"y\", toY, fromY, toY);\n        animator.setDuration(duration);\n        return animator;\n    }*/\n\n    /**\n     * Animator to animate Y scale of the view. X scale is constant\n     *\n     * @param view View to be animated\n     * @param pivotX x coordinate of the pivot\n     * @param pivotY y coordinate of the pivot\n     * @param fromScale initial scale\n     * @param toScale final scale\n     * @param duration animation duration in milliseconds\n     * @return Animator Object\n     */\n    @NonNull\n    public static Animator scaleY(@NonNull View view, int pivotX, int pivotY, float fromScale, float toScale, int duration) {\n        view.setPivotX(pivotX);\n        view.setPivotY(pivotY);\n        Animator animator = ObjectAnimator.ofFloat(view, \"scaleY\", fromScale, toScale);\n        animator.setDuration(duration);\n        return animator;\n    }\n\n    /**\n     * Animator to animate X scale of the view. Y scale is constant\n     *\n     * @param view View to be animated\n     * @param pivotX x coordinate of the pivot\n     * @param pivotY y coordinate of the pivot\n     * @param fromScale initial scale\n     * @param toScale final scale\n     * @param duration animation duration in milliseconds\n     * @return Animator Object\n     */\n    @NonNull\n    public static Animator scaleX(@NonNull View view, int pivotX, int pivotY, float fromScale, float toScale, int duration) {\n        view.setPivotX(pivotX);\n        view.setPivotY(pivotY);\n        Animator animator = ObjectAnimator.ofFloat(view, \"scaleX\", fromScale, toScale);\n        animator.setDuration(duration);\n        return animator;\n    }\n\n}\n"
  },
  {
    "path": "tooltip/src/main/java/com/fenchtose/tooltip/Tooltip.java",
    "content": "package com.fenchtose.tooltip;\n\nimport android.animation.Animator;\nimport android.animation.AnimatorSet;\nimport android.annotation.SuppressLint;\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graphics.Paint;\nimport android.graphics.Path;\nimport android.graphics.Point;\nimport android.os.Build;\nimport android.os.Handler;\nimport android.util.Log;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.ViewTreeObserver;\n\nimport androidx.annotation.ColorInt;\nimport androidx.annotation.IntDef;\nimport androidx.annotation.NonNull;\nimport androidx.annotation.Nullable;\n\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\n\n/**\n * Dynamically add tooltips in any ViewGroups.\n * Use {@link Builder} to generate and inject Tooltip in your layout.\n * Use {@link #dismiss()} method to manually dismiss the tooltip.\n */\n@SuppressWarnings(\"unused\")\n@SuppressLint(\"ViewConstructor\")\npublic class Tooltip extends ViewGroup {\n\n    private static final String TAG = \"Tooltip\";\n\n    public static final int NO_AUTO_CANCEL = 0;\n    private static final int MIN_INT_VALUE = -2147483648;\n\n    private boolean debug = false;\n\n    private View contentView;\n    private View anchorView;\n\n    private int[] anchorLocation = new int[2];\n    private int[] holderLocation = new int[2];\n\n    @Position\n    private int position;\n\n    private boolean isCancelable = true;\n    private boolean autoAdjust = true;\n\n    private int padding;\n\n    private Listener builderListener;\n    private Listener listener;\n\n    private Tip tip;\n    private Paint tipPaint;\n    private Path tipPath;\n    private boolean showTip = false;\n\n    private Point anchorPoint = new Point();\n    private int[] tooltipSize = new int[2];\n\n    public static final int LEFT = 0;\n    public static final int TOP = 1;\n    public static final int RIGHT = 2;\n    public static final int BOTTOM = 3;\n    @IntDef({LEFT, TOP, RIGHT, BOTTOM})\n    @Retention(RetentionPolicy.SOURCE)\n    public @interface Position {}\n\n    private TooltipAnimation animation;\n    private boolean animate = false;\n    private boolean hasAnimatedIn = false;\n\n    // To avoid multiple click dismiss error (in animation)\n    private boolean isDismissed = false;\n    private boolean isDismissAnimationInProgress = false;\n\n    // Coordinator anchored view BS\n    /**\n     * If we have made a call to {@link #doLayout(boolean, int, int, int, int)} or not\n     */\n    private boolean hasDrawn = false;\n\n    /**\n     * If the anchor is anchored to some view in CoordinatorLayout, we get incorrect data\n     * about its position in the window. So we need to wait for a preDraw event and then\n     * draw tooltip and layout its contents.\n     */\n    private boolean checkForPreDraw = false;\n\n    /**\n     * If the view is attached to window or not\n     */\n    private boolean isAttached = false;\n\n    private Tooltip(@NonNull Builder builder) {\n        super(builder.context);\n        init(builder);\n    }\n\n    private void init(@NonNull Builder builder) {\n\n        this.contentView = builder.contentView;\n        this.anchorView = builder.anchorView;\n        this.builderListener = builder.myListener;\n\n        this.autoAdjust = builder.autoAdjust;\n        this.position = builder.position;\n        this.padding = builder.padding;\n        this.checkForPreDraw = builder.checkForPreDraw;\n        this.debug = builder.debug;\n\n        // Cancelable\n        this.isCancelable = builder.cancelable;\n\n        // Animation\n        this.animation = builder.animation;\n        animate = (animation != null && animation.getType() != TooltipAnimation.NONE);\n\n        tipPaint = new Paint(Paint.ANTI_ALIAS_FLAG);\n        tipPaint.setStyle(Paint.Style.FILL_AND_STROKE);\n\n        // Tip\n        this.tip = builder.tip;\n        this.showTip = (tip != null);\n        if (tip != null) {\n\n            tipPaint.setColor(tip.getColor());\n\n            if (tip.getTipRadius() > 0) {\n                tipPaint.setStrokeJoin(Paint.Join.ROUND);\n                tipPaint.setStrokeCap(Paint.Cap.ROUND);\n                tipPaint.setStrokeWidth(tip.getTipRadius());\n            }\n        }\n\n        tipPaint.setColor(tip == null ? 0xffffffff : tip.getColor());\n\n        if (debug) {\n            Log.d(TAG, \"show tip: \" + showTip);\n        }\n\n        this.listener = builder.listener;\n\n        tipPath = new Path();\n\n        LayoutParams params = contentView.getLayoutParams();\n        if (params == null) {\n            params = new LayoutParams(LayoutParams.WRAP_CONTENT,\n                    LayoutParams.WRAP_CONTENT);\n        }\n\n        this.addView(contentView, params);\n    }\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n        super.onMeasure(widthMeasureSpec, heightMeasureSpec);\n\n        View child = getChildAt(0);\n        measureChild(child, widthMeasureSpec, heightMeasureSpec);\n\n        if (debug) {\n            Log.i(TAG, \"child measured width: \" + child.getMeasuredWidth());\n        }\n    }\n\n    @Override\n    protected void onLayout(final boolean changed, final int l, final int t, final int r, final int b) {\n        if (debug) {\n            Log.i(TAG, \"l: \" + l + \", t: \" + t + \", r: \" + r + \", b: \" + b);\n        }\n\n        if (checkForPreDraw && !hasDrawn) {\n            anchorView.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {\n                @Override\n                public boolean onPreDraw() {\n                    anchorView.getViewTreeObserver().removeOnPreDrawListener(this);\n                    anchorView.getLocationInWindow(anchorLocation);\n                    Log.i(TAG, \"onPreDraw: \" + anchorLocation[0] + \", \" + anchorLocation[1]);\n                    hasDrawn = true;\n                    doLayout(changed, l, t, r, b);\n                    return true;\n                }\n            });\n\n            return;\n        }\n\n        hasDrawn = true;\n        doLayout(changed, l, t, r, b);\n    }\n\n    @Override\n    protected void onAttachedToWindow() {\n        super.onAttachedToWindow();\n        isAttached = true;\n    }\n\n    @Override\n    protected void onDetachedFromWindow() {\n        super.onDetachedFromWindow();\n        isAttached = false;\n    }\n\n    @Override\n    public boolean onInterceptTouchEvent(MotionEvent ev) {\n        if (isCancelable) {\n            dismiss(animate);\n        }\n\n        return false;\n    }\n\n    private void doLayout(boolean changed, int l, int t, int r, int b) {\n\n        View child = getChildAt(0);\n\n        anchorView.getLocationInWindow(anchorLocation);\n        this.getLocationInWindow(holderLocation);\n\n        int dx = anchorLocation[0] - holderLocation[0];\n        int dy = anchorLocation[1] - holderLocation[1];\n\n        int w = child.getMeasuredWidth();\n        int h = child.getMeasuredHeight();\n\n        int left = dx;\n        int top = dy;\n\n        if (debug) {\n            Log.d(TAG, \"anchor location: \" + anchorLocation[0] + \", \" + anchorLocation[1]);\n            Log.d(TAG, \"holder location: \" + holderLocation[0] + \", \" + holderLocation[1]);\n            Log.d(TAG, \"child w: \" + w + \" h: \" + h);\n            Log.d(TAG, \"left: \" + left + \", top: \" + top);\n        }\n\n        tipPath.reset();\n\n        int px = MIN_INT_VALUE;\n        int py = MIN_INT_VALUE;\n\n        switch (position) {\n            case LEFT: {\n                // to left of anchor view\n                // align with horizontal axis\n\n                int diff = (anchorView.getHeight() - h) / 2;\n                // We should pad right side\n                left -= (w + padding + (showTip ? tip.getHeight() : 0));\n                // Top and bottom padding is not required\n                top += diff;\n\n                if (showTip) {\n                    px = left + w + tip.getHeight();\n                    py = top + h/2;\n                    tipPath.moveTo(px, py);\n                    tipPath.lineTo(px - tip.getHeight(), py + tip.getWidth()/2);\n                    tipPath.lineTo(px - tip.getHeight(), py - tip.getWidth()/2);\n                    tipPath.lineTo(px, py);\n                }\n\n                break;\n            }\n\n            case RIGHT: {\n                // to right of anchor view\n                // align with horizontal axis\n                int diff = (anchorView.getHeight() - h) / 2;\n                // We should pad left side\n                left += (anchorView.getWidth() + padding + (showTip ? tip.getHeight() : 0));\n                // Top and bottom padding is not required\n                top += diff;\n\n                if (showTip) {\n                    px = left - tip.getHeight();\n                    py = top + h/2;\n                    tipPath.moveTo(px, py);\n                    tipPath.lineTo(px + tip.getHeight(), py + tip.getWidth()/2);\n                    tipPath.lineTo(px + tip.getHeight(), py - tip.getWidth()/2);\n                    tipPath.lineTo(px, py);\n                }\n\n                break;\n            }\n\n            case TOP: {\n                // to top of anchor view\n                // align with vertical axis\n                int diff = (anchorView.getWidth() - w) / 2;\n\n                // Left and Right padding are not required.\n                left += diff;\n\n                // We should only pad bottom\n                top -= (h + padding + (showTip ? tip.getHeight() : 0));\n\n                if (showTip) {\n                    px = left + w / 2;\n                    py = top + h + tip.getHeight();\n                    tipPath.moveTo(px, py);\n                    tipPath.lineTo(px - tip.getWidth() / 2, py - tip.getHeight());\n                    tipPath.lineTo(px + tip.getWidth() / 2, py - tip.getHeight());\n                    tipPath.lineTo(px, py);\n                }\n\n                break;\n            }\n\n            case BOTTOM: {\n                // to top of anchor view\n                // align with vertical axis\n                int diff = (anchorView.getWidth() - w) / 2;\n\n                // Left and Right padding are not required.\n                left += diff;\n\n                // We should only pad top\n                top += anchorView.getHeight() + padding + (showTip ? tip.getHeight() : 0);\n\n                if (debug) {\n                    Log.d(TAG, \"tip top: \" + top);\n                }\n\n                if (showTip) {\n                    px = left + w / 2;\n                    py = top - tip.getHeight();\n                    tipPath.moveTo(px, py);\n                    tipPath.lineTo(px - tip.getWidth() / 2, py + tip.getHeight());\n                    tipPath.lineTo(px + tip.getWidth() / 2, py + tip.getHeight());\n                    tipPath.lineTo(px, py);\n\n                }\n\n                break;\n            }\n\n        }\n\n        if (autoAdjust) {\n            switch (position) {\n                case TOP:\n                case BOTTOM:\n                    if (left + w > r) {\n                        // View is going out on the right side\n                        // Add padding to the right\n                        left = r - w - padding;\n                    } else if (left < l) {\n                        // View is going out on the left side\n                        // Add padding to the left\n                        left = l + padding;\n                    }\n                    break;\n\n                case LEFT:\n                case RIGHT:\n                    if (top + h > b) {\n                        // View is going out on the bottom side\n                        // Add padding to bottom\n                        top = b - h - padding;\n                    } else if (top < t) {\n                        // View is going out on the top side\n                        // Add padding to top\n                        top = t + padding;\n                    }\n                    break;\n            }\n        }\n\n        if (debug) {\n            Log.i(TAG, \"child layout: left: \" + left + \" top: \" + top + \" right: \"\n                    + (left + child.getMeasuredWidth())\n                    + \" bottom: \" + (top + child.getMeasuredHeight()));\n            Log.i(TAG, \"px: \" + px + \", py: \" + py);\n\n        }\n\n        // Tip was not drawn. We need to set anchor point for animation\n        if (px == MIN_INT_VALUE || py == MIN_INT_VALUE) {\n\n            if (debug) {\n                Log.d(TAG, \"Tip was not drawn\");\n            }\n\n            switch (position) {\n                case TOP:\n                    px = left + child.getMeasuredWidth()/2;\n                    py = top + child.getMeasuredHeight();\n                    break;\n                case BOTTOM:\n                    px = left + child.getMeasuredWidth()/2;\n                    py = top;\n                    break;\n                case LEFT:\n                    px = left + child.getMeasuredWidth();\n                    py = top + child.getMeasuredHeight();\n                    break;\n                case RIGHT:\n                    px = left;\n                    py = top + child.getMeasuredHeight()/2;\n                    break;\n            }\n        }\n\n        // Set anchor point\n        anchorPoint.set(px, py);\n\n        // Get Tooltip content size\n        tooltipSize[0] = child.getMeasuredWidth();\n        tooltipSize[1] = child.getMeasuredHeight();\n\n        child.layout(left, top, left + child.getMeasuredWidth(), top + child.getMeasuredHeight());\n\n        if (animate && !hasAnimatedIn) {\n            hasAnimatedIn = false;\n            animateIn(animation);\n        }\n    }\n\n    @Override\n    protected void dispatchDraw(Canvas canvas) {\n        super.dispatchDraw(canvas);\n        if (debug) {\n            Log.i(TAG, \"canvas w: \" + canvas.getWidth() + \", h: \" + canvas.getHeight());\n        }\n\n        if (showTip && hasDrawn) {\n            canvas.drawPath(tipPath, tipPaint);\n        }\n    }\n\n    public boolean isCancelable() {\n        return isCancelable;\n    }\n\n\n    /**\n     * Dismiss and remove Tooltip from the view.\n     * No animation is performed.\n     */\n    public void dismiss() {\n\n        // Dismissing or already dismissed\n        if (isDismissed) {\n            return;\n        }\n\n        isDismissed = true;\n\n        this.removeView(contentView);\n        ViewGroup parent = (ViewGroup) getParent();\n        parent.removeView(this);\n\n        builderListener.onDismissed();\n\n        if (listener != null) {\n            listener.onDismissed();\n        }\n    }\n\n    /**\n     * Dismiss and remove Tooltip from the view.\n     * @param animate Animation is performed if true\n     */\n    public void dismiss(boolean animate) {\n\n        // Dismissing or already dismissed\n        if (isDismissed) {\n            return;\n        }\n\n        if (!isAttached) {\n            if (debug) {\n                Log.e(TAG, \"view is detached. Not animating\");\n            }\n\n            return;\n        }\n\n        if (!animate || animation == null) {\n            dismiss();\n            return;\n        }\n\n        animateOut(animation);\n\n    }\n\n    private Point getAnchorPoint() {\n        return anchorPoint;\n    }\n\n    private int[] getTooltipSize() {\n        return tooltipSize;\n    }\n\n    private void animateIn(@NonNull TooltipAnimation animation) {\n\n        if (!isAttached) {\n            if (debug) {\n                Log.e(TAG, \"View is not attached. Not animating the tooltip\");\n            }\n            return;\n        }\n\n        Point point = getAnchorPoint();\n        int[] size = getTooltipSize();\n\n        if (debug) {\n            Log.d(TAG, \"anchor point: \" + point.x + \", \" + point.y);\n            Log.d(TAG, \"size: \" + size[0] + \", \" + size[1]);\n        }\n\n        final Animator animator = getAnimator(animation, point, size, true);\n        if (animator != null) {\n            animator.start();\n            animation.hideContentWhenAnimatingIn(animator, contentView);\n        }\n\n    }\n\n    @Nullable\n    private Animator getAnimator(@NonNull TooltipAnimation animation,\n                                 @NonNull Point point, @NonNull int[] size,\n                                 boolean animateIn) {\n\n        float startAlpha = 0;\n        float endAlpha = 1;\n\n        float startScale = 0;\n        float endScale = 1;\n\n        int startRadius = 0;\n        int finalRadius = Math.max(size[0], size[1]);\n\n        if (!animateIn) {\n            startAlpha = 1;\n            endAlpha = 0;\n\n            startScale = 1;\n            endScale = 0;\n\n            startRadius = finalRadius;\n            finalRadius = 0;\n        }\n\n        switch (animation.getType()) {\n            case TooltipAnimation.FADE:\n                return AnimationUtils.fade(this, startAlpha, endAlpha, animation.getDuration());\n\n            case TooltipAnimation.REVEAL:\n                if (Build.VERSION.SDK_INT < 21) {\n                    Log.e(TAG, \"Reveal is supported on sdk 21 and above\");\n                    return null;\n                }\n\n                return AnimationUtils.reveal(this, point.x, point.y, startRadius, finalRadius,\n                        animation.getDuration());\n\n            case TooltipAnimation.SCALE:\n                return getScaleAnimator(animation, size, startScale, endScale);\n\n            case TooltipAnimation.SCALE_AND_FADE:\n                Animator scaleAnimator = getScaleAnimator(animation, size, startScale, endScale);\n                Animator fadeAnimator = AnimationUtils.fade(this, startAlpha, endAlpha, animation.getDuration());\n\n                if (scaleAnimator == null) {\n                    return fadeAnimator;\n                }\n\n                AnimatorSet animatorSet = new AnimatorSet();\n                animatorSet.playTogether(scaleAnimator, fadeAnimator);\n\n                return animatorSet;\n\n            case TooltipAnimation.NONE:\n                return null;\n\n            default:\n                return null;\n\n        }\n    }\n\n    private void animateOut(@NonNull TooltipAnimation animation) {\n\n        if (isDismissAnimationInProgress) {\n            return;\n        }\n\n        Point point = getAnchorPoint();\n        int[] size = getTooltipSize();\n\n        if (debug) {\n            Log.d(TAG, \"anchor point: \" + point.x + \", \" + point.y);\n            Log.d(TAG, \"circular reveal : \" + point.y + \", \" + point.x);\n            Log.d(TAG, \"size: \" + size[0] + \", \" + size[1]);\n        }\n\n        Animator animator = getAnimator(animation, point, size, false);\n        if (animator == null) {\n            dismiss();\n            return;\n        }\n\n        animator.start();\n        isDismissAnimationInProgress = true;\n        animation.hideContentWhenAnimatingOut(contentView);\n\n        animator.addListener(new Animator.AnimatorListener() {\n            @Override\n            public void onAnimationStart(Animator animation) {\n\n            }\n\n            @Override\n            public void onAnimationEnd(Animator animation) {\n                dismiss();\n            }\n\n            @Override\n            public void onAnimationCancel(Animator animation) {\n                dismiss();\n            }\n\n            @Override\n            public void onAnimationRepeat(Animator animation) {\n\n            }\n        });\n    }\n\n    @Nullable\n    private Animator getScaleAnimator(@NonNull TooltipAnimation animation, @NonNull int size[],\n                                      float startScale, float endScale) {\n\n        switch (position) {\n            case BOTTOM:\n                return AnimationUtils.scaleY(contentView, size[0]/2, 0 , startScale, endScale, animation.getDuration());\n            case TOP:\n                return AnimationUtils.scaleY(contentView, size[0]/2, size[1] , startScale, endScale, animation.getDuration());\n            case RIGHT:\n                return AnimationUtils.scaleX(contentView, 0, size[1]/2, startScale, endScale, animation.getDuration());\n            case LEFT:\n                return AnimationUtils.scaleX(contentView, size[0], size[1]/2, startScale, endScale, animation.getDuration());\n            default:\n                return null;\n        }\n    }\n\n    /**\n     * Builder class for {@link Tooltip}. Builder has the responsibility of creating the Tooltip\n     * and adding/displaying it in the {@link #rootView}.\n     */\n    public static class Builder {\n\n        private final Context context;\n\n        /**\n         * ViewGroup where Tooltip is added\n         */\n        private ViewGroup rootView;\n\n        /**\n         * Content of the Tooltip\n         */\n        private View contentView;\n\n        /**\n         * Anchor of the Tooltip. This is where the tooltip is anchored.\n         */\n        private View anchorView;\n\n        /**\n         * Position of the Tooltip relative to the anchor. Default position is {@link #TOP}.\n         * Other positions are - {@link #BOTTOM}, {@link #RIGHT}, {@link #LEFT}\n         */\n        @Position\n        private int position = TOP;\n\n        /**\n         * Whether the tooltip should be dismissed or not if clicked outside\n         */\n        private boolean cancelable = true;\n\n        /**\n         * Automatically adjust tooltip layout if it's going out of screen.\n         * Scenario: If tooltip is anchored with position {@link #TOP}, it will try to position itself\n         * within the bounds of the view in right and left direction. It will not try to adjust itself in top\n         * bottom direction.\n         */\n        private boolean autoAdjust = true;\n\n        /**\n         * Tip of the tooltip.\n         */\n        private Tip tip;\n\n        /**\n         * Margin from the anchor and screen boundaries\n         */\n        private int padding = 0;\n\n        /**\n         * If you want the tooltip to dismiss automatically after a certain amount of time,\n         * set it in milliseconds. Values <= 0 are considered invalid and auto dismiss is turned off.\n         */\n        private int autoCancelTime = NO_AUTO_CANCEL;\n\n        /**\n         * Tooltip instance\n         */\n        private Tooltip tooltip;\n\n        private Handler handler;\n        private Runnable autoCancelRunnable;\n\n        /**\n         * Dismiss Listener for Builder\n         */\n        private Listener myListener;\n\n        /**\n         * Dismiss Listener for User\n         */\n        private Listener listener;\n\n        private TooltipAnimation animation;\n        private boolean animate;\n\n        /**\n         * If the anchor is anchored to some view in CoordinatorLayout, we get incorrect data\n         * about its position in the window. So we need to wait for a preDraw event and then\n         * draw tooltip.\n         */\n        private boolean checkForPreDraw = false;\n\n        /**\n         * Show logs\n         */\n        private boolean debug = false;\n\n        public Builder(@NonNull Context context) {\n            this.context = context;\n            handler = new Handler();\n\n            autoCancelRunnable = new Runnable() {\n                @Override\n                public void run() {\n                    if (tooltip != null) {\n                        tooltip.dismiss(animate);\n                    }\n                }\n            };\n\n            myListener = new Listener() {\n                @Override\n                public void onDismissed() {\n                    handler.removeCallbacks(autoCancelRunnable);\n                }\n            };\n        }\n\n        /**\n         * set tooltip's content view\n         * @param view Content of the tooltip\n         * @return Builder\n         */\n        public Builder content(@NonNull View view) {\n            this.contentView = view;\n            return this;\n        }\n\n        /**\n         * set tooltip's anchor with position {@link #TOP}\n         * @param view Anchor view\n         * @return Builder\n         */\n        public Builder anchor(@NonNull View view) {\n            this.anchorView = view;\n            return this;\n        }\n\n        /**\n         * Set tooltip's anchor with tooltip's relative position\n         * @param view Anchor view\n         * @param position position of tooltip relative to the anchor. {@link #TOP}, {@link #RIGHT},\n         *                 {@link #BOTTOM}, {@link #LEFT}\n         * @return Builder\n         */\n        public Builder anchor(@NonNull View view, @Position int position) {\n            this.anchorView = view;\n            this.position = position;\n            return this;\n        }\n\n        /**\n         * Add Tooltip in this view\n         * @param viewGroup {@link ViewGroup} root view (parent view) for the tooltip\n         * @return Builder\n         */\n        public Builder into(@NonNull ViewGroup viewGroup) {\n            this.rootView = viewGroup;\n            return this;\n        }\n\n        /**\n         * Whether the tooltip should be dismissed or not if clicked outside. Default it true\n         * @param cancelable boolean\n         * @return Builder\n         */\n        public Builder cancelable(boolean cancelable) {\n            this.cancelable = cancelable;\n            return this;\n        }\n\n        /**\n         * Automatically adjust tooltip layout if it's going out of screen.\n         * Scenario: If tooltip is anchored with position {@link #TOP}, it will try to position itself\n         * within the bounds of the view in right and left direction. It will not try to adjust itself in top\n         * bottom direction.\n         *\n         * @param autoAdjust boolean\n         * @return Builder\n         */\n        public Builder autoAdjust(boolean autoAdjust) {\n            this.autoAdjust = autoAdjust;\n            return this;\n        }\n\n        /**\n         * Margin from the anchor and screen boundaries\n         * @param padding - margin from the screen edge (in pixels).\n         * @return Builder\n         */\n        public Builder withPadding(int padding) {\n            this.padding = padding;\n            return this;\n        }\n\n        /**\n         * Attach dismiss listener\n         * @param listener dismiss listener\n         * @return Builder\n         */\n        public Builder withListener(@NonNull Listener listener) {\n            this.listener = listener;\n            return this;\n        }\n\n        /**\n         * Show Tip. If null, it doesn't show the tip.\n         * @param tip {@link Tip}\n         * @return Builder\n         */\n        public Builder withTip(@NonNull Tip tip) {\n            this.tip = tip;\n            return this;\n        }\n\n        /**\n         * If you want the tooltip to dismiss automatically after a certain amount of time,\n         * set it in milliseconds. Values &lt;= 0 are considered invalid and auto dismiss is turned off.\n         *\n         * Default is 0.\n         *\n         * @param timeInMilli dismiss time\n         * @return Builder\n         */\n        public Builder autoCancel(int timeInMilli) {\n            this.autoCancelTime = timeInMilli;\n            return this;\n        }\n\n        /**\n         * Set show and dismiss animation for the tooltip\n         *\n         * @param animation {@link TooltipAnimation} to be performed while showing and dismissing\n         * @return Builder\n         */\n        public Builder animate(@NonNull TooltipAnimation animation) {\n            this.animation = animation;\n            this.animate = true;\n            return this;\n        }\n\n        /**\n         * If the anchor is anchored to some view in CoordinatorLayout, we get incorrect data\n         * about its position in the window. So we need to wait for a preDraw event and then\n         * draw tooltip.\n         *\n         * @param check - boolean\n         * @return Builder\n         */\n        public Builder checkForPreDraw(boolean check) {\n            this.checkForPreDraw = check;\n            return this;\n        }\n\n        /**\n         * Show logs\n         * @param debug boolean\n         * @return Builder\n         */\n        public Builder debug(boolean debug) {\n            this.debug = debug;\n            return this;\n        }\n\n        /**\n         * Create a new instance of Tooltip. This method will throw {@link NullPointerException}\n         * if {@link #anchorView} or {@link #rootView} or {@link #contentView} is not assigned.\n         * @return {@link Tooltip}\n         */\n        public Tooltip build() {\n            if (anchorView == null) {\n                throw new NullPointerException(\"anchor view is null\");\n            }\n\n            if (rootView == null) {\n                throw new NullPointerException(\"Root view is null\");\n            }\n\n            if (contentView == null) {\n                throw new NullPointerException(\"content view is null\");\n            }\n\n            tooltip = new Tooltip(this);\n            return tooltip;\n        }\n\n        /**\n         * Creates a new instance of Tooltip by calling {@link #build()} and adds tooltip to {@link #rootView}.\n         * <br><br>\n         * Tooltip is added to the rootView with MATCH_PARENT for width and height constraints. {@link #contentView}\n         * is drawn based on its LayoutParams. If it does not contain any LayoutParams, new LayoutParams are generated\n         * with WRAP_CONTENT for width and height and added to the Tooltip view.\n         *\n         * @return Generated {@link Tooltip}\n         */\n        public Tooltip show() {\n            tooltip = build();\n\n            int[] anchorLocation = new int[2];\n            anchorView.getLocationInWindow(anchorLocation);\n            if (debug) {\n                Log.d(TAG, \"anchor location before adding: \" + anchorLocation[0] + \", \" + anchorLocation[1]);\n            }\n\n            rootView.addView(tooltip, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));\n\n            anchorView.getLocationInWindow(anchorLocation);\n            if (debug) {\n                Log.i(TAG, \"anchor location after adding: \" + anchorLocation[0] + \", \" + anchorLocation[1]);\n            }\n\n            if (autoCancelTime > NO_AUTO_CANCEL) {\n                handler.postDelayed(autoCancelRunnable, autoCancelTime);\n            }\n\n            /*if (animate && animation != null) {\n\n                tooltip.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {\n                    @Override\n                    public boolean onPreDraw() {\n                        tooltip.getViewTreeObserver().removeOnPreDrawListener(this);\n                        tooltip.animateIn(animation);\n                        return true;\n                    }\n                });\n\n            }*/\n\n            return tooltip;\n        }\n\n    }\n\n    /**\n     * Tip of the tooltip. Tip is drawn separately to accommodate custom views.\n     * It has three properties. {@link #width}, {@link #height}, and {@link #color}.\n     * <br><br>\n     * Tip is drawn as an isosceles triangle. The length of the base\n     * is defined by width and perpendicular length between top vertex and base is defined\n     * by height.\n     */\n    public static class Tip {\n\n        /**\n         * length of the base of isosceles triangle\n         */\n        private final int width;\n\n        /**\n         * length of the perpendicular from top vertex to the base\n         */\n        private final int height;\n\n        /**\n         * color of the tip.\n         */\n        @ColorInt\n        private final int color;\n\n        /**\n         * Corner radius of the tip in px\n         */\n        private int tipRadius;\n        private static final int DEFAULT_TIP_RADIUS = 0;\n\n        public Tip(int width, int height, int color, int tipRadius) {\n            this.width = width;\n            this.height = height;\n            this.color = color;\n            this.tipRadius = tipRadius;\n        }\n\n        public Tip(int width, int height, int color) {\n            this(width, height, color, DEFAULT_TIP_RADIUS);\n        }\n\n        public int getWidth() {\n            return width;\n        }\n\n        public int getHeight() {\n            return height;\n        }\n\n        @ColorInt\n        public int getColor() {\n            return color;\n        }\n\n        public int getTipRadius() {\n            return tipRadius;\n        }\n    }\n\n    /**\n     * Tooltip dismiss listener. {@link #onDismissed()} is called when tooltip is dismissed.\n     */\n    public interface Listener {\n        void onDismissed();\n    }\n}\n"
  },
  {
    "path": "tooltip/src/main/java/com/fenchtose/tooltip/TooltipAnimation.java",
    "content": "package com.fenchtose.tooltip;\n\nimport android.animation.Animator;\nimport android.view.View;\nimport android.view.ViewGroup;\n\nimport androidx.annotation.IntDef;\nimport androidx.annotation.NonNull;\n\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\n\n/**\n * Animation for the Tooltip.\n *\n * Types of Animations available: {@link Type}\n *\n */\npublic class TooltipAnimation {\n\n    public static final int NONE = 0;\n    public static final int FADE = 1;\n    public static final int REVEAL = 2;\n    public static final int SCALE = 3;\n    public static final int SCALE_AND_FADE = 4;\n\n    /**\n     * Types of Animations available:\n     * <br>\n     * <ul>\n     *     <li>{@link #NONE} : No Animation</li>\n     *     <li>{@link #FADE} : Fade in and Fade Out</li>\n     *     <li>{@link #REVEAL} : Circular Reveal. Center point would be Tip. If tip is not present,\n     *     center point would be where it's being anchored. This is supported for API 21 and above.</li>\n     *     <li>{@link #SCALE} : Scale animation based on position of the tooltip</li>\n     *     <li>{@link #SCALE_AND_FADE} : Scale and Fade animation</li>\n     * </ul>\n     */\n    @IntDef({NONE, FADE, REVEAL, SCALE, SCALE_AND_FADE})\n    @Retention(RetentionPolicy.SOURCE)\n    public @interface Type {}\n\n    @Type\n    private int type;\n    private static final int DEFAULT_TYPE = FADE;\n\n    private static final int DEFAULT_DURATION = 400; // ms\n    private int duration;\n    private boolean hideContentWhenAnimating;\n\n    /**\n     * Create a new Animation object for {@link Tooltip}\n     *\n     * @param type {@link Type}\n     * @param duration animation duration in milliseconds\n     */\n    public TooltipAnimation(int type, int duration) {\n        this(type, duration, false);\n    }\n\n    /**\n     * Create a new Animation object for {@link Tooltip}\n     *\n     * @param type {@link Type}\n     * @param duration animation duration in milliseconds\n     * @param hideContentWhenAnimating hide content when animating\n     */\n    public TooltipAnimation(@Type int type, int duration, boolean hideContentWhenAnimating) {\n        this.type = type;\n        this.duration = duration;\n        this.hideContentWhenAnimating = hideContentWhenAnimating;\n    }\n\n    /**\n     * Create a new Animation object for {@link Tooltip}, with duration {@link #DEFAULT_DURATION}\n     * @param type {@link Type}\n     */\n    public TooltipAnimation(@Type int type) {\n        this(type, DEFAULT_DURATION);\n    }\n\n    /**\n     * Create a new Animation object for {@link Tooltip}\n     * <br>\n     * type {@link #DEFAULT_TYPE}\n     * <br>\n     * duration {@link #DEFAULT_DURATION}\n     */\n    public TooltipAnimation() {\n        this(DEFAULT_TYPE, DEFAULT_DURATION);\n    }\n\n    @Type\n    public int getType() {\n        return type;\n    }\n\n    public int getDuration() {\n        return duration;\n    }\n\n    void hideContentWhenAnimatingIn(@NonNull final Animator animator, @NonNull final View contentView) {\n        if (hideContentWhenAnimating && contentView instanceof ViewGroup) {\n            hideAllChildren((ViewGroup) contentView);\n            animator.addListener(new Animator.AnimatorListener() {\n                @Override\n                public void onAnimationStart(Animator animation) {\n\n                }\n\n                @Override\n                public void onAnimationEnd(Animator animation) {\n                    showAllChildren((ViewGroup) contentView);\n                    animator.removeListener(this);\n                }\n\n                @Override\n                public void onAnimationCancel(Animator animation) {\n                    showAllChildren((ViewGroup) contentView);\n                    animator.removeListener(this);\n                }\n\n                @Override\n                public void onAnimationRepeat(Animator animation) {\n\n                }\n            });\n        }\n    }\n\n    void hideContentWhenAnimatingOut(@NonNull final View contentView) {\n        if (hideContentWhenAnimating && contentView instanceof ViewGroup) {\n            hideAllChildren((ViewGroup)contentView);\n        }\n    }\n\n    private static void hideAllChildren(@NonNull ViewGroup view) {\n        for (int i=0; i<view.getChildCount(); i++) {\n            view.getChildAt(i).setVisibility(View.INVISIBLE);\n        }\n    }\n\n    private static void showAllChildren(@NonNull ViewGroup view) {\n        for (int i=0; i<view.getChildCount(); i++) {\n            view.getChildAt(i).setVisibility(View.VISIBLE);\n        }\n    }\n}\n"
  },
  {
    "path": "tooltip/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">Tooltip</string>\n</resources>\n"
  },
  {
    "path": "tooltip/src/test/java/com/fenchtose/tooltip/ExampleUnitTest.java",
    "content": "package com.fenchtose.tooltip;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * To work on unit tests, switch the Test Artifact in the Build Variants view.\n */\npublic class ExampleUnitTest {\n    @Test\n    public void addition_isCorrect() throws Exception {\n        assertEquals(4, 2 + 2);\n    }\n}"
  }
]