[
  {
    "path": ".gitignore",
    "content": "\n# Created by https://www.toptal.com/developers/gitignore/api/androidstudio\n# Edit at https://www.toptal.com/developers/gitignore?templates=androidstudio\n\n### AndroidStudio ###\n# Covers files to be ignored for android development using Android Studio.\n\n# Built application files\n*.apk\n*.ap_\n\n# Files for the ART/Dalvik VM\n*.dex\n\n# Java class files\n*.class\n\n# Generated files\nbin/\ngen/\nout/\n\n# Gradle files\n.gradle\n.gradle/\nbuild/\n\n# Signing files\n.signing/\n\n# Local configuration file (sdk path, etc)\nlocal.properties\n\n# Proguard folder generated by Eclipse\nproguard/\n\n# Log Files\n*.log\n\n# Android Studio\n/*/build/\n/*/local.properties\n/*/out\n/*/*/build\n/*/*/production\ncaptures/\n.navigation/\n*.ipr\n*~\n*.swp\n\n# Android Patch\ngen-external-apklibs\n\n# External native build folder generated in Android Studio 2.2 and later\n.externalNativeBuild\n\n# NDK\nobj/\n\n# IntelliJ IDEA\n*.iml\n*.iws\n/out/\n\n# User-specific configurations\n.idea/caches/\n.idea/libraries/\n.idea/shelf/\n.idea/workspace.xml\n.idea/tasks.xml\n.idea/.name\n.idea/compiler.xml\n.idea/copyright/profiles_settings.xml\n.idea/encodings.xml\n.idea/misc.xml\n.idea/modules.xml\n.idea/scopes/scope_settings.xml\n.idea/dictionaries\n.idea/vcs.xml\n.idea/jsLibraryMappings.xml\n.idea/datasources.xml\n.idea/dataSources.ids\n.idea/sqlDataSources.xml\n.idea/dynamic.xml\n.idea/uiDesigner.xml\n.idea/assetWizardSettings.xml\n\n# OS-specific files\n.DS_Store\n.DS_Store?\n._*\n.Spotlight-V100\n.Trashes\nehthumbs.db\nThumbs.db\n\n# Legacy Eclipse project files\n.classpath\n.project\n.cproject\n.settings/\n\n# Mobile Tools for Java (J2ME)\n.mtj.tmp/\n\n# Package Files #\n*.war\n*.ear\n\n# virtual machine crash logs (Reference: http://www.java.com/en/download/help/error_hotspot.xml)\nhs_err_pid*\n\n## Plugin-specific files:\n\n# mpeltonen/sbt-idea plugin\n.idea_modules/\n\n# JIRA plugin\natlassian-ide-plugin.xml\n\n# Mongo Explorer plugin\n.idea/mongoSettings.xml\n\n# Crashlytics plugin (for Android Studio and IntelliJ)\ncom_crashlytics_export_strings.xml\ncrashlytics.properties\ncrashlytics-build.properties\nfabric.properties\n\n### AndroidStudio Patch ###\n\n!/gradle/wrapper/gradle-wrapper.jar\n\n# End of https://www.toptal.com/developers/gitignore/api/androidstudio\n"
  },
  {
    "path": ".idea/codeStyles/Project.xml",
    "content": "<component name=\"ProjectCodeStyleConfiguration\">\n  <code_scheme name=\"Project\" version=\"173\">\n    <option name=\"RIGHT_MARGIN\" value=\"130\" />\n    <JetCodeStyleSettings>\n      <option name=\"CODE_STYLE_DEFAULTS\" value=\"KOTLIN_OFFICIAL\" />\n    </JetCodeStyleSettings>\n    <codeStyleSettings language=\"XML\">\n      <indentOptions>\n        <option name=\"CONTINUATION_INDENT_SIZE\" value=\"4\" />\n      </indentOptions>\n      <arrangement>\n        <rules>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>xmlns:android</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>^$</XML_NAMESPACE>\n                </AND>\n              </match>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>xmlns:.*</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>^$</XML_NAMESPACE>\n                </AND>\n              </match>\n              <order>BY_NAME</order>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>.*:id</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>\n                </AND>\n              </match>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>.*:name</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>\n                </AND>\n              </match>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>name</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>^$</XML_NAMESPACE>\n                </AND>\n              </match>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>style</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>^$</XML_NAMESPACE>\n                </AND>\n              </match>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>.*</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>^$</XML_NAMESPACE>\n                </AND>\n              </match>\n              <order>BY_NAME</order>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>.*</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>\n                </AND>\n              </match>\n              <order>ANDROID_ATTRIBUTE_ORDER</order>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>.*</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>.*</XML_NAMESPACE>\n                </AND>\n              </match>\n              <order>BY_NAME</order>\n            </rule>\n          </section>\n        </rules>\n      </arrangement>\n    </codeStyleSettings>\n    <codeStyleSettings language=\"kotlin\">\n      <option name=\"CODE_STYLE_DEFAULTS\" value=\"KOTLIN_OFFICIAL\" />\n    </codeStyleSettings>\n  </code_scheme>\n</component>"
  },
  {
    "path": ".idea/codeStyles/codeStyleConfig.xml",
    "content": "<component name=\"ProjectCodeStyleConfiguration\">\n  <state>\n    <option name=\"USE_PER_PROJECT_SETTINGS\" value=\"true\" />\n  </state>\n</component>"
  },
  {
    "path": ".idea/gradle.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"GradleMigrationSettings\" migrationVersion=\"1\" />\n  <component name=\"GradleSettings\">\n    <option name=\"linkedExternalProjectsSettings\">\n      <GradleProjectSettings>\n        <option name=\"testRunner\" value=\"PLATFORM\" />\n        <option name=\"distributionType\" value=\"DEFAULT_WRAPPED\" />\n        <option name=\"externalProjectPath\" value=\"$PROJECT_DIR$\" />\n        <option name=\"modules\">\n          <set>\n            <option value=\"$PROJECT_DIR$\" />\n            <option value=\"$PROJECT_DIR$/sample\" />\n            <option value=\"$PROJECT_DIR$/shadowlayout\" />\n          </set>\n        </option>\n        <option name=\"resolveModulePerSourceSet\" value=\"false\" />\n        <option name=\"useQualifiedModuleNames\" value=\"true\" />\n      </GradleProjectSettings>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": ".idea/jarRepositories.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"RemoteRepositoriesConfiguration\">\n    <remote-repository>\n      <option name=\"id\" value=\"central\" />\n      <option name=\"name\" value=\"Maven Central repository\" />\n      <option name=\"url\" value=\"https://repo1.maven.org/maven2\" />\n    </remote-repository>\n    <remote-repository>\n      <option name=\"id\" value=\"jboss.community\" />\n      <option name=\"name\" value=\"JBoss Community repository\" />\n      <option name=\"url\" value=\"https://repository.jboss.org/nexus/content/repositories/public/\" />\n    </remote-repository>\n    <remote-repository>\n      <option name=\"id\" value=\"BintrayJCenter\" />\n      <option name=\"name\" value=\"BintrayJCenter\" />\n      <option name=\"url\" value=\"https://jcenter.bintray.com/\" />\n    </remote-repository>\n    <remote-repository>\n      <option name=\"id\" value=\"Google\" />\n      <option name=\"name\" value=\"Google\" />\n      <option name=\"url\" value=\"https://dl.google.com/dl/android/maven2/\" />\n    </remote-repository>\n    <remote-repository>\n      <option name=\"id\" value=\"MavenRepo\" />\n      <option name=\"name\" value=\"MavenRepo\" />\n      <option name=\"url\" value=\"https://repo.maven.apache.org/maven2/\" />\n    </remote-repository>\n  </component>\n</project>"
  },
  {
    "path": ".idea/runConfigurations.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"RunConfigurationProducerService\">\n    <option name=\"ignoredProducers\">\n      <set>\n        <option value=\"com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer\" />\n      </set>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": "LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2020, Lionel Briand\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "README.MD",
    "content": "# ShadowLayout a css like shadow for android\n\nHave you ever wanted a CSS type of shadow in your Android project ? No?! Me neither but designers\nkeep using it and the death flag is triggered when the app isn't a copy of the design. So, there it goes.\n\nIt do much more than casting a shadow so the name can be inaccurate. Internally, it uses the native \n`ScriptIntrinsicBlur` render script so it can easily blur the whole layout like the\n[Blurry](https://github.com/wasabeef/Blurry) library.\n\n# Requirements\n\nAndroid 5.+ (API 21)\n\n# Gradle\n\nThe project is hosted on maven Central :\n```groovy\nallprojects {\n    repositories {\n        mavenCentral()\n    }\n}\n```\n\nThen add dependency :\n```groovy\ndependencies {\n    implementation(\"net.orandja.shadowlayout:shadowlayout:1.0.1\")\n}\n```\n\n\n# Usage\n\nAdd `android:clipChildren=\"false\"`, `android:clipToPadding=\"false\"` to the parent layout to let ShadowLayout draw outside of view bounds.\n\n```xml\n<net.orandja.shadowlayout.ShadowLayout\n    android:padding=\"8dp\"\n    android:layout_gravity=\"center\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\"\n    android:background=\"@drawable/round_corners\"\n    app:shadow_radius=\"8\"\n    app:shadow_x_shift=\"-1dp\"\n    app:shadow_y_shift=\"2dp\"\n    app:shadow_downscale=\"1\"\n    app:shadow_color=\"#808\"\n    app:shadow_with_foreground=\"true\"\n    app:shadow_with_color=\"false\"\n    app:shadow_with_dpi_scale=\"true\"\n    app:shadow_with_css_scale=\"true\"\n    app:shadow_cast_only_background=\"true\">\n\n    <androidx.appcompat.widget.AppCompatTextView\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:textColor=\"@color/black\"\n        android:text=\"The quick brown fox jump over the lazy dog\"\n        android:textSize=\"16sp\" />\n\n</net.orandja.shadowlayout.ShadowLayout>\n```\n\n![quick brown fox text view](assets/quick_fox.png)\n\n## Parameters\n\nDefault value in parenthesis\n\n- `shadow_radius` (6f) The radius of the gaussian blur in float. See #Rules of downscaling section to see how it works. \n- `shadow_x_shift` (0dp) Shift on the horizontal axis in dp\n- `shadow_y_shift` (0dp) Shift on the vertical axis in dp\n- `shadow_color` (#33000000) Color of the casted shadow\n- `shadow_downscale` (1f) Downscale of the internal bitmap that render the shadow. The higher the downscale, the lower in size is the bitmap. At 2, the size of bitmap is halved. \n- `shadow_with_foreground` (true) Draw the actual view on top of the shadow.\n- `shadow_with_color` (false) Keep all the subview colors in the blur. Coupled with `shadow_with_foreground` at false, a blur image can be render on screen.\n- `shadow_with_dpi_scale` (true) Downscale the internal bitmap by the current smartphone dpi. A 100dp view will result in a 100px bitmap. \n- `shadow_with_css_scale` (true) Downscale by 5/3 more. Because CSS shadow standard blur by a half more than the real blur size.\n- `shadow_cast_only_background` (false) Only render the background and not the view as shadow\n\n\n## Limitations\n\nThe default implementation of android gaussian blur (`ScriptIntrinsicBlur` render script) is limited to 25 pixels at max. \nTo counter that, the layout downscale the real render of the view inside a bitmap (ALPHA_8 or RGBA with `shadow_with_color` at true). \nThen blur it. Then renders the blur inside the canvas. Then **redraw** the view in the canvas. (`shadow_with_foreground` at true)\n\nThe radius can mean multiple things depending on the configurations. \n\n## Rules of downscaling\n\nWhen no downscale are applied:\n \n```xml\n<net.orandja.shadowlayout.ShadowLayout\n    app:shadow_radius=\"3f\"\n    app:shadow_downscale=\"1\"\n    app:shadow_with_dpi_scale=\"false\"\n    app:shadow_with_css_scale=\"false\" />\n```\n\nThe internal bitmap is the same size of the view. The radius is the number of **pixels** blured around.\nWith high dpi, it will be hard to see the effect. However, in some cases, it can be usefull to have a nice looking blur at the expense of more memory.\nThe max radius is 25 pixels. The parameter `shadow_downscale` multiply the max radius by its value. So at shadow_downscale=\"2.5\" it increases the max radius to 62.5f.\n\nWhen `app:shadow_with_dpi_scale=\"true\"`: Downscale the internal bitmap by the current smartphone dpi. A 100dp view will result in a 100px bitmap.\nThe radius means **dp**. It blurs up to 25dp.\n\nWhen `app:shadow_with_css_scale=\"true\"`: Same as dpi, it will add a 5/3 downscale to mimic the CSS shadow blur.\n\n# Shadow anything\n\nAs said before since it draw the whole layout it can cast a shadow of anything. Like text:\n\n```xml\n    <net.orandja.shadowlayout.ShadowLayout\n        android:padding=\"8dp\"\n        android:layout_gravity=\"center\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        app:shadow_radius=\"1\"\n        app:shadow_x_shift=\"1dp\"\n        app:shadow_y_shift=\"2dp\"\n        app:shadow_downscale=\"1\"\n        app:shadow_color=\"#AA000000\"\n        app:shadow_with_foreground=\"true\"\n        app:shadow_with_color=\"true\"\n        app:shadow_with_css_scale=\"false\"\n        app:shadow_with_dpi_scale=\"true\"\n        app:shadow_cast_only_background=\"true\">\n\n        <androidx.appcompat.widget.AppCompatTextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:textColor=\"#808\"\n            android:text=\"The quick brown fox jump over the lazy dog\"\n            android:textSize=\"16sp\" />\n\n    </net.orandja.shadowlayout.ShadowLayout>\n```\n\n![quick brown fox text view](assets/quick_fox_text.png)\n\nSince `shadow_with_color` is at true, the drawn shadow is of the same color of the text rendered.\nThe color parameter only affect alpha. \n"
  },
  {
    "path": "build.gradle",
    "content": "buildscript {\n    ext.kotlin_version = '1.5.0'\n    repositories {\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath 'com.vanniktech:gradle-maven-publish-plugin:0.15.1'\n        classpath 'com.android.tools.build:gradle:4.2.1'\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version\"\n    }\n}\n\nallprojects {\n    repositories {\n        google()\n        mavenCentral()\n    }\n}\n"
  },
  {
    "path": "consumer-rules.pro",
    "content": ""
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Sat Jun 20 19:39:00 CEST 2020\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-7.0-all.zip\n"
  },
  {
    "path": "gradle.properties",
    "content": "org.gradle.jvmargs=-Xmx1536m\nandroid.useAndroidX=true\nandroid.enableJetifier=true\nkotlin.code.style=official\n\nGROUP=net.orandja.shadowlayout\nPOM_ARTIFACT_ID=shadowlayout\nVERSION_NAME=1.0.1\n\nPOM_NAME=Shadow Layout\nPOM_DESCRIPTION=ShadowLayout a css like shadow for android\nPOM_INCEPTION_YEAR=2020\nPOM_URL=https://github.com/L-Briand/ShadowLayout\n\nPOM_LICENCE_NAME=BSD 3-Clause License\nPOM_LICENCE_URL=https://opensource.org/licenses/BSD-3-Clause\nPOM_LICENCE_DIST=repo\n\nPOM_SCM_URL=https://github.com/L-Briand/ShadowLayout\nPOM_SCM_CONNECTION=scm:git:git://github.com/L-Briand/ShadowLayout.git\nPOM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/L-Briand/ShadowLayout.git\n\nPOM_DEVELOPER_ID=L-Briand\nPOM_DEVELOPER_NAME=Lionel Briand\nPOM_DEVELOPER_URL=https://github.com/L-Briand"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env sh\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\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\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\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\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\nnonstop=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\n  NONSTOP* )\n    nonstop=true\n    ;;\nesac\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\" -a \"$nonstop\" = \"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# Escape application args\nsave () {\n    for i do printf %s\\\\n \"$i\" | sed \"s/'/'\\\\\\\\''/g;1s/^/'/;\\$s/\\$/' \\\\\\\\/\" ; done\n    echo \" \"\n}\nAPP_ARGS=$(save \"$@\")\n\n# Collect all arguments for the java command, following the shell quoting and substitution rules\neval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS \"\\\"-Dorg.gradle.appname=$APP_BASE_NAME\\\"\" -classpath \"\\\"$CLASSPATH\\\"\" org.gradle.wrapper.GradleWrapperMain \"$APP_ARGS\"\n\n# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong\nif [ \"$(uname)\" = \"Darwin\" ] && [ \"$HOME\" = \"$PWD\" ]; then\n  cd \"$(dirname \"$0\")\"\nfi\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:init\r\n@rem Get command-line arguments, handling Windows variants\r\n\r\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\r\n\r\n:win9xME_args\r\n@rem Slurp the command line arguments.\r\nset CMD_LINE_ARGS=\r\nset _SKIP=2\r\n\r\n:win9xME_args_slurp\r\nif \"x%~1\" == \"x\" goto execute\r\n\r\nset CMD_LINE_ARGS=%*\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguardFiles setting in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\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\n# Uncomment this to preserve the line number information for\n# debugging stack traces.\n#-keepattributes SourceFile,LineNumberTable\n\n# If you keep the line number information, uncomment this to\n# hide the original source file name.\n#-renamesourcefileattribute SourceFile\n"
  },
  {
    "path": "sample/.gitignore",
    "content": "/build"
  },
  {
    "path": "sample/build.gradle",
    "content": "apply plugin: 'com.android.application'\napply plugin: 'kotlin-android'\n\nandroid {\n    compileSdkVersion 30\n    buildToolsVersion \"30.0.3\"\n\n    defaultConfig {\n        applicationId \"fr.orandja.shadowlayout.sample\"\n        minSdkVersion 21\n        targetSdkVersion 30\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\ndependencies {\n    implementation \"org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version\"\n    implementation 'androidx.core:core-ktx:1.5.0'\n    implementation 'androidx.appcompat:appcompat:1.3.0'\n    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'\n\n    implementation project(':shadowlayout')\n}\n"
  },
  {
    "path": "sample/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguardFiles setting in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\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\n# Uncomment this to preserve the line number information for\n# debugging stack traces.\n#-keepattributes SourceFile,LineNumberTable\n\n# If you keep the line number information, uncomment this to\n# hide the original source file name.\n#-renamesourcefileattribute SourceFile"
  },
  {
    "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    xmlns:tools=\"http://schemas.android.com/tools\"\n    package=\"net.orandja.shadowlayout.sample\">\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:roundIcon=\"@mipmap/ic_launcher_round\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style/AppTheme\"\n        tools:ignore=\"AllowBackup\">\n        <activity android:name=\".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    </application>\n\n</manifest>"
  },
  {
    "path": "sample/src/main/java/net/orandja/shadowlayout/sample/MainActivity.kt",
    "content": "package net.orandja.shadowlayout.sample\n\nimport android.animation.ObjectAnimator\nimport android.animation.ValueAnimator\nimport android.os.Bundle\nimport androidx.appcompat.app.AppCompatActivity\nimport net.orandja.shadowlayout.ShadowLayout\n\nclass MainActivity : AppCompatActivity() {\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        setContentView(R.layout.activity_main)\n\n        ValueAnimator.ofFloat(0f, 0f, 25f, 25f).apply {\n            duration = 2000\n            repeatCount = ObjectAnimator.INFINITE\n            repeatMode = ObjectAnimator.REVERSE\n            addUpdateListener { findViewById<ShadowLayout>(R.id.__rainbow).shadow_radius = it.animatedValue as Float }\n        }.start()\n    }\n}\n"
  },
  {
    "path": "sample/src/main/res/drawable/ic_launcher_background.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<vector\n    android:height=\"108dp\"\n    android:width=\"108dp\"\n    android:viewportHeight=\"108\"\n    android:viewportWidth=\"108\"\n    xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <path android:fillColor=\"#3DDC84\"\n          android:pathData=\"M0,0h108v108h-108z\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M9,0L9,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M19,0L19,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M29,0L29,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M39,0L39,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M49,0L49,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M59,0L59,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M69,0L69,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M79,0L79,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M89,0L89,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M99,0L99,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,9L108,9\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,19L108,19\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,29L108,29\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,39L108,39\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,49L108,49\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,59L108,59\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,69L108,69\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,79L108,79\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,89L108,89\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,99L108,99\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M19,29L89,29\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M19,39L89,39\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M19,49L89,49\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M19,59L89,59\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M19,69L89,69\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M19,79L89,79\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M29,19L29,89\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M39,19L39,89\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M49,19L49,89\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M59,19L59,89\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M69,19L69,89\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M79,19L79,89\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n</vector>\n"
  },
  {
    "path": "sample/src/main/res/drawable/ic_launcher_foreground.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"108dp\"\n    android:height=\"108dp\"\n    android:viewportWidth=\"108\"\n    android:viewportHeight=\"108\"\n    android:tint=\"#FFFFFF\">\n  <group android:scaleX=\"2.61\"\n      android:scaleY=\"2.61\"\n      android:translateX=\"22.68\"\n      android:translateY=\"22.68\">\n    <path\n        android:fillColor=\"@android:color/white\"\n        android:pathData=\"M6,13c-0.55,0 -1,0.45 -1,1s0.45,1 1,1 1,-0.45 1,-1 -0.45,-1 -1,-1zM6,17c-0.55,0 -1,0.45 -1,1s0.45,1 1,1 1,-0.45 1,-1 -0.45,-1 -1,-1zM6,9c-0.55,0 -1,0.45 -1,1s0.45,1 1,1 1,-0.45 1,-1 -0.45,-1 -1,-1zM3,9.5c-0.28,0 -0.5,0.22 -0.5,0.5s0.22,0.5 0.5,0.5 0.5,-0.22 0.5,-0.5 -0.22,-0.5 -0.5,-0.5zM6,5c-0.55,0 -1,0.45 -1,1s0.45,1 1,1 1,-0.45 1,-1 -0.45,-1 -1,-1zM21,10.5c0.28,0 0.5,-0.22 0.5,-0.5s-0.22,-0.5 -0.5,-0.5 -0.5,0.22 -0.5,0.5 0.22,0.5 0.5,0.5zM14,7c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1 -1,0.45 -1,1 0.45,1 1,1zM14,3.5c0.28,0 0.5,-0.22 0.5,-0.5s-0.22,-0.5 -0.5,-0.5 -0.5,0.22 -0.5,0.5 0.22,0.5 0.5,0.5zM3,13.5c-0.28,0 -0.5,0.22 -0.5,0.5s0.22,0.5 0.5,0.5 0.5,-0.22 0.5,-0.5 -0.22,-0.5 -0.5,-0.5zM10,20.5c-0.28,0 -0.5,0.22 -0.5,0.5s0.22,0.5 0.5,0.5 0.5,-0.22 0.5,-0.5 -0.22,-0.5 -0.5,-0.5zM10,3.5c0.28,0 0.5,-0.22 0.5,-0.5s-0.22,-0.5 -0.5,-0.5 -0.5,0.22 -0.5,0.5 0.22,0.5 0.5,0.5zM10,7c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1 -1,0.45 -1,1 0.45,1 1,1zM10,12.5c-0.83,0 -1.5,0.67 -1.5,1.5s0.67,1.5 1.5,1.5 1.5,-0.67 1.5,-1.5 -0.67,-1.5 -1.5,-1.5zM18,13c-0.55,0 -1,0.45 -1,1s0.45,1 1,1 1,-0.45 1,-1 -0.45,-1 -1,-1zM18,17c-0.55,0 -1,0.45 -1,1s0.45,1 1,1 1,-0.45 1,-1 -0.45,-1 -1,-1zM18,9c-0.55,0 -1,0.45 -1,1s0.45,1 1,1 1,-0.45 1,-1 -0.45,-1 -1,-1zM18,5c-0.55,0 -1,0.45 -1,1s0.45,1 1,1 1,-0.45 1,-1 -0.45,-1 -1,-1zM21,13.5c-0.28,0 -0.5,0.22 -0.5,0.5s0.22,0.5 0.5,0.5 0.5,-0.22 0.5,-0.5 -0.22,-0.5 -0.5,-0.5zM14,17c-0.55,0 -1,0.45 -1,1s0.45,1 1,1 1,-0.45 1,-1 -0.45,-1 -1,-1zM14,20.5c-0.28,0 -0.5,0.22 -0.5,0.5s0.22,0.5 0.5,0.5 0.5,-0.22 0.5,-0.5 -0.22,-0.5 -0.5,-0.5zM10,8.5c-0.83,0 -1.5,0.67 -1.5,1.5s0.67,1.5 1.5,1.5 1.5,-0.67 1.5,-1.5 -0.67,-1.5 -1.5,-1.5zM10,17c-0.55,0 -1,0.45 -1,1s0.45,1 1,1 1,-0.45 1,-1 -0.45,-1 -1,-1zM14,12.5c-0.83,0 -1.5,0.67 -1.5,1.5s0.67,1.5 1.5,1.5 1.5,-0.67 1.5,-1.5 -0.67,-1.5 -1.5,-1.5zM14,8.5c-0.83,0 -1.5,0.67 -1.5,1.5s0.67,1.5 1.5,1.5 1.5,-0.67 1.5,-1.5 -0.67,-1.5 -1.5,-1.5z\"/>\n  </group>\n</vector>\n"
  },
  {
    "path": "sample/src/main/res/drawable/multicolor.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:shape=\"rectangle\">\n    <corners android:radius=\"8dp\" />\n    <gradient\n        android:angle=\"0\"\n        android:centerColor=\"#F0F\"\n        android:centerX=\"50%\"\n        android:centerY=\"50%\"\n        android:endColor=\"#0FF\"\n        android:startColor=\"#FF0\" />\n</shape>"
  },
  {
    "path": "sample/src/main/res/drawable/round_corners.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:shape=\"rectangle\">\n    <corners android:radius=\"8dp\" />\n    <solid android:color=\"#999\" />\n</shape>"
  },
  {
    "path": "sample/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:clipChildren=\"false\"\n    android:clipToPadding=\"false\"\n    android:orientation=\"vertical\"\n    android:padding=\"16dp\">\n\n    <net.orandja.shadowlayout.ShadowLayout\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"center\"\n        android:background=\"@drawable/round_corners\"\n        android:padding=\"8dp\"\n        app:shadow_cast_only_background=\"true\"\n        app:shadow_color=\"#808\"\n        app:shadow_downscale=\"1\"\n        app:shadow_radius=\"8\"\n        app:shadow_with_color=\"false\"\n        app:shadow_with_content=\"true\"\n        app:shadow_with_css_scale=\"true\"\n        app:shadow_with_dpi_scale=\"true\"\n        app:shadow_x_shift=\"-1dp\"\n        app:shadow_y_shift=\"2dp\">\n\n        <androidx.appcompat.widget.AppCompatTextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"The quick brown fox jump over the lazy dog\"\n            android:textColor=\"#000\"\n            android:textSize=\"16sp\" />\n\n    </net.orandja.shadowlayout.ShadowLayout>\n\n    <Space\n        android:layout_width=\"8dp\"\n        android:layout_height=\"8dp\" />\n\n    <net.orandja.shadowlayout.ShadowLayout\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"center\"\n        android:padding=\"8dp\"\n        app:shadow_color=\"#AA000000\"\n        app:shadow_downscale=\"1\"\n        app:shadow_radius=\"1\"\n        app:shadow_with_color=\"true\"\n        app:shadow_with_content=\"true\"\n        app:shadow_with_css_scale=\"false\"\n        app:shadow_with_dpi_scale=\"true\"\n        app:shadow_x_shift=\"1dp\"\n        app:shadow_y_shift=\"2dp\">\n\n        <LinearLayout\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:orientation=\"vertical\">\n\n            <androidx.appcompat.widget.AppCompatTextView\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:text=\"The quick brown fox jump over the lazy dog\"\n                android:textColor=\"#808\"\n                android:textSize=\"16sp\" />\n\n        </LinearLayout>\n\n    </net.orandja.shadowlayout.ShadowLayout>\n\n    <Space\n        android:layout_width=\"16dp\"\n        android:layout_height=\"16dp\" />\n\n    <net.orandja.shadowlayout.ShadowLayout\n        android:id=\"@+id/__rainbow\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_margin=\"12dp\"\n        android:background=\"@drawable/multicolor\"\n        android:padding=\"16dp\"\n        app:shadow_color=\"#FF000000\"\n        app:shadow_downscale=\"1\"\n        app:shadow_radius=\"25\"\n        app:shadow_with_color=\"true\"\n        app:shadow_with_content=\"false\"\n        app:shadow_with_css_scale=\"true\"\n        app:shadow_with_dpi_scale=\"true\"\n        app:shadow_x_shift=\"4dp\"\n        app:shadow_y_shift=\"10dp\">\n\n        <androidx.appcompat.widget.AppCompatTextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"The quick brown fox jump over the lazy dog\"\n            android:textColor=\"#808\"\n            android:textSize=\"16sp\" />\n    </net.orandja.shadowlayout.ShadowLayout>\n\n    <net.orandja.shadowlayout.ShadowLayout\n        android:id=\"@+id/__default\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"center\"\n        android:layout_margin=\"12dp\"\n        android:background=\"@android:color/white\"\n        android:padding=\"16dp\">\n\n        <androidx.appcompat.widget.AppCompatTextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"The quick brown fox jump over the lazy dog\"\n            android:textColor=\"#808\"\n            android:textSize=\"16sp\" />\n    </net.orandja.shadowlayout.ShadowLayout>\n\n</LinearLayout>"
  },
  {
    "path": "sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <background android:drawable=\"@drawable/ic_launcher_background\"/>\n    <foreground android:drawable=\"@drawable/ic_launcher_foreground\"/>\n</adaptive-icon>"
  },
  {
    "path": "sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <background android:drawable=\"@drawable/ic_launcher_background\"/>\n    <foreground android:drawable=\"@drawable/ic_launcher_foreground\"/>\n</adaptive-icon>"
  },
  {
    "path": "sample/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#6200EE</color>\n    <color name=\"colorPrimaryDark\">#3700B3</color>\n    <color name=\"colorAccent\">#03DAC5</color>\n</resources>"
  },
  {
    "path": "sample/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">sample</string>\n</resources>"
  },
  {
    "path": "sample/src/main/res/values/styles.xml",
    "content": "<resources>\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        <item name=\"shadowLayoutStyle\">@style/ShadowLayout</item>\n    </style>\n\n    <style name=\"ShadowLayout\">\n        <item name=\"shadow_color\">#FF000000</item>\n        <item name=\"shadow_downscale\">1</item>\n        <item name=\"shadow_radius\">10</item>\n        <item name=\"shadow_with_color\">false</item>\n        <item name=\"shadow_with_content\">true</item>\n        <item name=\"shadow_cast_only_background\">false</item>\n        <item name=\"shadow_with_css_scale\">true</item>\n        <item name=\"shadow_with_dpi_scale\">true</item>\n        <item name=\"shadow_x_shift\">2dp</item>\n        <item name=\"shadow_y_shift\">3dp</item>\n    </style>\n\n</resources>"
  },
  {
    "path": "settings.gradle",
    "content": "rootProject.name = \"ShadowLayout\"\n\ninclude \":shadowlayout\", \":sample\""
  },
  {
    "path": "shadowlayout/.gitignore",
    "content": "/build"
  },
  {
    "path": "shadowlayout/build.gradle",
    "content": "plugins {\n    id 'com.android.library'\n    id 'kotlin-android'\n    id 'com.vanniktech.maven.publish'\n}\n\nandroid {\n    compileSdkVersion 30\n    buildToolsVersion \"30.0.3\"\n\n    compileOptions {\n        sourceCompatibility = JavaVersion.VERSION_1_8\n        targetCompatibility = JavaVersion.VERSION_1_8\n    }\n    kotlinOptions {\n        jvmTarget = JavaVersion.VERSION_1_8\n    }\n\n    defaultConfig {\n        minSdkVersion 21\n        targetSdkVersion 30\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n        consumerProguardFiles 'consumer-rules.pro'\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\ndependencies {\n    implementation \"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version\"\n    implementation 'androidx.core:core-ktx:1.5.0'\n}"
  },
  {
    "path": "shadowlayout/src/main/AndroidManifest.xml",
    "content": "<manifest package=\"net.orandja.shadowlayout\" />\n"
  },
  {
    "path": "shadowlayout/src/main/java/net/orandja/shadowlayout/ShadowLayout.kt",
    "content": "package net.orandja.shadowlayout\n\nimport android.content.Context\nimport android.content.res.Resources\nimport android.graphics.*\nimport android.renderscript.Allocation\nimport android.renderscript.Element\nimport android.renderscript.RenderScript\nimport android.renderscript.ScriptIntrinsicBlur\nimport android.util.AttributeSet\nimport android.util.DisplayMetrics\nimport android.view.View\nimport android.view.ViewOutlineProvider\nimport android.widget.FrameLayout\nimport androidx.annotation.ColorRes\nimport androidx.annotation.DimenRes\nimport androidx.annotation.Nullable\nimport androidx.core.content.res.ResourcesCompat\nimport androidx.core.graphics.scaleMatrix\nimport androidx.core.graphics.times\nimport androidx.core.graphics.translationMatrix\nimport androidx.core.graphics.withMatrix\nimport kotlin.math.ceil\n\n/** A CSS like shadow */\n@Suppress(\"PropertyName\")\nclass ShadowLayout @JvmOverloads constructor(\n    context: Context,\n    @Nullable attrs: AttributeSet? = null,\n    defStyleAttr: Int = R.attr.shadowLayoutStyle,\n    defStyleRes: Int = 0\n) : FrameLayout(context, attrs, defStyleAttr, defStyleRes) {\n\n    companion object {\n        @JvmField\n        val ratioDpToPixels =\n            Resources.getSystem().displayMetrics.densityDpi.toFloat() / DisplayMetrics.DENSITY_DEFAULT\n\n        @JvmField\n        val ratioPixelsToDp: Float = (1.0 / ratioDpToPixels.toDouble()).toFloat()\n\n        // Thanks to this hero https://stackoverflow.com/a/41322648/4681367\n        const val cssRatio: Float = 5f / 3f\n    }\n\n    // BASIC FIELDS\n\n    private val paint = Paint(Paint.ANTI_ALIAS_FLAG or Paint.DITHER_FLAG)\n    private val eraser = Paint().apply { xfermode = PorterDuffXfermode(PorterDuff.Mode.DST_OUT) }\n\n    var shadow_color: Int\n        get() = paint.color\n        set(value) {\n            if (paint.color == value) return\n            paint.color = value\n            postInvalidate()\n        }\n\n    fun setColorRes(@ColorRes color: Int) {\n        shadow_color = ResourcesCompat.getColor(resources, color, context.theme)\n    }\n\n    var shadow_x_shift: Float by OnUpdate(0f)\n    fun setXShift(@DimenRes shift: Int) {\n        shadow_x_shift = context.resources.getDimension(shift)\n    }\n\n    var shadow_y_shift: Float by OnUpdate(0f)\n    fun setYShift(@DimenRes shift: Int) {\n        shadow_y_shift = context.resources.getDimension(shift)\n    }\n\n    var shadow_downscale: Float by OnUpdate(1f, { it.coerceAtLeast(0.1f) }) {\n        realRadius = shadow_radius / it\n        updateBitmap()\n    }\n    var shadow_radius: Float by OnUpdate(0f, { it.coerceAtLeast(0f) }) {\n        realRadius = it / shadow_downscale\n    }\n    private var realRadius: Float by OnUpdate(\n        0f, { it.coerceIn(0f, 25f) } // allowed blur size on ScriptIntrinsicBlur by android\n    )\n\n    var shadow_cast_only_background: Boolean by OnUpdate(false)\n    var shadow_with_content: Boolean by OnUpdate(true)\n    var shadow_with_color: Boolean by OnUpdate(false) {\n        destroyBitmap()\n        updateBitmap()\n    }\n    var shadow_with_dpi_scale: Boolean by OnUpdate(true) {\n        destroyBitmap()\n        updateBitmap()\n    }\n    var shadow_with_css_scale: Boolean by OnUpdate(true) {\n        destroyBitmap()\n        updateBitmap()\n    }\n\n\n    // IN VARIABLES\n\n    private val ratioDpToPixels get() = if (shadow_with_dpi_scale) Companion.ratioDpToPixels else 1f\n    private val ratioPixelsToDp get() = if (shadow_with_dpi_scale) Companion.ratioPixelsToDp else 1f\n    private val cssRatio get() = if (shadow_with_css_scale) Companion.cssRatio else 1f\n\n    // size in pixel of the blur spread\n    private val pixelsOverBoundaries: Int get() = if (shadow_downscale < 1f) 25 else ceil(25f * shadow_downscale).toInt()\n    private val viewBounds: Rect = Rect()\n    private fun setViewBounds(width: Int, height: Int) {\n        viewBounds.set(0, 0, width, height)\n        updateBitmap()\n    }\n\n    private var blurBitmap: Bitmap? = null\n    private var blurCanvas: Canvas? = null\n\n    private var renderScript: RenderScript? = null;\n    private var script: ScriptIntrinsicBlur? = null;\n    private var inAlloc: Allocation? = null\n    private var outAlloc: Allocation? = null\n\n    private var lastWithColorScript: Boolean? = null\n    private fun getScript(): Pair<ScriptIntrinsicBlur, RenderScript> {\n        val renderScript = this.renderScript ?: RenderScript.create(context)\n        if (lastWithColorScript != shadow_with_color) { // recreate script only if colors change\n            lastWithColorScript = shadow_with_color\n            script = null\n        }\n        if (script != null) return Pair(script!!, renderScript!!)\n        val element = if (shadow_with_color) Element.U8_4(renderScript) else Element.U8(renderScript)\n        script = ScriptIntrinsicBlur.create(renderScript, element)\n        return Pair(script!!, renderScript!!)\n    }\n\n    private val lastBounds = Rect()\n    private var lastScale = 0f\n    private var lastWithColorBitmap: Boolean? = null\n    private var lastWithDpi: Boolean? = null\n    private var lastWithCss: Boolean? = null\n    private fun updateBitmap() {\n        // do not recreate if same specs.\n        if (viewBounds.isEmpty || isAttachedToWindow\n            && lastBounds == viewBounds\n            && shadow_downscale == lastScale\n            && shadow_with_color == lastWithColorBitmap\n            && shadow_with_dpi_scale == lastWithDpi\n            && shadow_with_css_scale == lastWithCss\n        ) return\n        lastBounds.set(viewBounds)\n        lastScale = shadow_downscale\n        lastWithColorBitmap = shadow_with_color\n        lastWithColorBitmap = shadow_with_color\n        lastWithDpi = shadow_with_dpi_scale\n        lastWithCss = shadow_with_css_scale\n\n        // create a receptacle for blur script. (MDPI / downscale) + (pixels * 2) cause blur spread in all directions\n        blurBitmap?.recycle()\n        blurBitmap = Bitmap.createBitmap(\n            (ceil(\n                (viewBounds.width().toFloat() * ratioPixelsToDp) / shadow_downscale / cssRatio\n            ) + pixelsOverBoundaries * 2).toInt(),\n            (ceil(\n                (viewBounds.height().toFloat() * ratioPixelsToDp) / shadow_downscale / cssRatio\n            ) + pixelsOverBoundaries * 2).toInt(),\n            if (shadow_with_color) Bitmap.Config.ARGB_8888 else Bitmap.Config.ALPHA_8\n        )\n\n        blurCanvas = Canvas(blurBitmap!!)\n\n        val (script, renderScript) = getScript()\n        inAlloc?.destroy()\n        inAlloc = Allocation.createFromBitmap(renderScript, blurBitmap)\n        if (outAlloc?.type != inAlloc?.type) {\n            outAlloc?.destroy()\n            outAlloc = Allocation.createTyped(renderScript, inAlloc!!.type)\n        }\n        script.setInput(inAlloc)\n    }\n\n    private fun destroyBitmap() {\n        blurBitmap?.recycle()\n        blurBitmap = null\n        blurCanvas = null\n        script?.destroy()\n        script = null\n        inAlloc?.destroy()\n        inAlloc = null\n        outAlloc?.destroy()\n        outAlloc = null\n        lastBounds.setEmpty()\n        lastScale = 0f\n        lastWithColorScript = null\n        lastWithColorBitmap = null\n        lastWithDpi = null\n        lastWithCss = null\n    }\n\n    /** Cause the default elevation rendering to not work */\n    override fun getOutlineProvider(): ViewOutlineProvider = object : ViewOutlineProvider() {\n        override fun getOutline(view: View?, outline: Outline?) = Unit\n    }\n\n    // Overriding view\n\n    init {\n        if (!isInEditMode) {\n            val attributes = context.obtainStyledAttributes(\n                attrs, R.styleable.ShadowLayout, defStyleAttr, defStyleRes\n            )\n\n            shadow_color = attributes.getColor(R.styleable.ShadowLayout_shadow_color, 51 shl 24)\n            shadow_with_color = attributes.getBoolean(R.styleable.ShadowLayout_shadow_with_color, false)\n            shadow_with_content = attributes.getBoolean(R.styleable.ShadowLayout_shadow_with_content, true)\n            shadow_with_dpi_scale = attributes.getBoolean(R.styleable.ShadowLayout_shadow_with_dpi_scale, true)\n            shadow_with_css_scale = attributes.getBoolean(R.styleable.ShadowLayout_shadow_with_css_scale, true)\n            shadow_x_shift = attributes.getDimension(R.styleable.ShadowLayout_shadow_x_shift, 0f)\n            shadow_y_shift = attributes.getDimension(R.styleable.ShadowLayout_shadow_y_shift, 0f)\n            shadow_downscale = attributes.getFloat(R.styleable.ShadowLayout_shadow_downscale, 1f)\n            shadow_radius = attributes.getFloat(R.styleable.ShadowLayout_shadow_radius, 6f)\n            shadow_cast_only_background = attributes.getBoolean(R.styleable.ShadowLayout_shadow_cast_only_background, false)\n\n            attributes.recycle()\n        }\n        setWillNotDraw(false)\n    }\n\n    override fun onAttachedToWindow() {\n        super.onAttachedToWindow()\n        if (!isInEditMode) updateBitmap()\n    }\n\n    override fun onDetachedFromWindow() {\n        super.onDetachedFromWindow()\n        if (!isInEditMode) destroyBitmap()\n    }\n\n    override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {\n        super.onSizeChanged(w, h, oldw, oldh)\n        if (!isInEditMode) setViewBounds(w, h)\n    }\n\n    private inline val blurTMatrix: Matrix // cause blur spreads\n        get() = translationMatrix(pixelsOverBoundaries.toFloat(), pixelsOverBoundaries.toFloat())\n    private inline val blurSMatrix: Matrix // to draw inside the small blurBitmap\n        get() = scaleMatrix(ratioPixelsToDp / shadow_downscale / cssRatio, ratioPixelsToDp / shadow_downscale / cssRatio)\n\n    private inline val drawTMatrix: Matrix // counterbalance for blur spread in canvas\n        get() = translationMatrix(\n            -(pixelsOverBoundaries * ratioDpToPixels * shadow_downscale * cssRatio),\n            -(pixelsOverBoundaries * ratioDpToPixels * shadow_downscale * cssRatio)\n        )\n    private inline val drawSMatrix: Matrix // enlarge blur image to canvas size\n        get() = scaleMatrix(\n            ratioDpToPixels * shadow_downscale * cssRatio,\n            ratioDpToPixels * shadow_downscale * cssRatio\n        )\n    private inline val shiftTMatrix: Matrix // User want a nice shifted shadow\n        get() = translationMatrix(\n            shadow_x_shift / shadow_downscale / cssRatio,\n            shadow_y_shift / shadow_downscale / cssRatio\n        )\n\n    override fun draw(canvas: Canvas?) {\n        canvas ?: return\n        if (isInEditMode) {\n            super.draw(canvas)\n            return\n        }\n        if (blurCanvas != null) {\n            blurCanvas!!.drawRect(blurCanvas!!.clipBounds, eraser)\n            blurCanvas!!.withMatrix(blurTMatrix * blurSMatrix) {\n                if (shadow_cast_only_background) {\n                    background.bounds = viewBounds\n                    background?.draw(blurCanvas!!)\n                } else super.draw(blurCanvas)\n            }\n            if (realRadius > 0f) { // Do not blur if no radius\n                val (script) = getScript()\n                script.setRadius(realRadius)\n                inAlloc?.copyFrom(blurBitmap)\n                script.forEach(outAlloc)\n                outAlloc?.copyTo(blurBitmap)\n            }\n            canvas.withMatrix(drawTMatrix * drawSMatrix * shiftTMatrix) {\n                canvas.drawBitmap(blurBitmap!!, 0f, 0f, paint)\n            }\n        }\n        if (shadow_with_content) super.draw(canvas)\n    }\n\n}"
  },
  {
    "path": "shadowlayout/src/main/java/net/orandja/shadowlayout/Utils.kt",
    "content": "package net.orandja.shadowlayout\n\nimport android.view.View\nimport kotlin.properties.ReadWriteProperty\nimport kotlin.reflect.KProperty\n\ninternal class OnUpdate<T>(default: T, val transformation: ((T) -> T)? = null, val onUpdate: ((T) -> Unit)? = null) :\n    ReadWriteProperty<View, T> {\n    var backing: T = default\n    override fun getValue(thisRef: View, property: KProperty<*>): T = backing\n    override fun setValue(thisRef: View, property: KProperty<*>, value: T) {\n        if (backing == value) return\n        backing = transformation?.invoke(value) ?: value\n        onUpdate?.invoke(value)\n        thisRef.postInvalidate()\n    }\n}"
  },
  {
    "path": "shadowlayout/src/main/res/values/attrs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <attr name=\"shadowLayoutStyle\" format=\"reference\" />\n    <declare-styleable name=\"ShadowLayout\">\n        <!-- The radius of the gaussian blur in float -->\n        <attr name=\"shadow_radius\" format=\"float\" />\n        <!-- Shift on the horizontal axis in dp -->\n        <attr name=\"shadow_x_shift\" format=\"dimension\" />\n        <!-- Shift on the vertical axis in dp -->\n        <attr name=\"shadow_y_shift\" format=\"dimension\" />\n        <!-- Color of the casted shadow -->\n        <attr name=\"shadow_color\" format=\"color\" />\n        <!-- Keep all the subview colors in the blur -->\n        <attr name=\"shadow_with_content\" format=\"boolean\" />\n        <!-- Keep all the subview colors in the blur  -->\n        <attr name=\"shadow_with_color\" format=\"boolean\" />\n        <!-- Downscale of the internal bitmap that render the shadow -->\n        <attr name=\"shadow_downscale\" format=\"float\" />\n        <!-- Downscale the internal bitmap by the current smartphone dpi -->\n        <attr name=\"shadow_with_dpi_scale\" format=\"boolean\" />\n        <!-- Downscale by 5/3 more -->\n        <attr name=\"shadow_with_css_scale\" format=\"boolean\" />\n        <!-- Only render the background and not the view as shadow -->\n        <attr name=\"shadow_cast_only_background\" format=\"boolean\" />\n    </declare-styleable>\n</resources>"
  }
]