Full Code of L-Briand/ShadowLayout for AI

master 2ceb317bdb0d cached
38 files
55.5 KB
16.5k tokens
1 requests
Download .txt
Repository: L-Briand/ShadowLayout
Branch: master
Commit: 2ceb317bdb0d
Files: 38
Total size: 55.5 KB

Directory structure:
gitextract_6iuvvsg5/

├── .gitignore
├── .idea/
│   ├── codeStyles/
│   │   ├── Project.xml
│   │   └── codeStyleConfig.xml
│   ├── gradle.xml
│   ├── jarRepositories.xml
│   └── runConfigurations.xml
├── LICENSE
├── README.MD
├── build.gradle
├── consumer-rules.pro
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── proguard-rules.pro
├── sample/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── java/
│           │   └── net/
│           │       └── orandja/
│           │           └── shadowlayout/
│           │               └── sample/
│           │                   └── MainActivity.kt
│           └── res/
│               ├── drawable/
│               │   ├── ic_launcher_background.xml
│               │   ├── ic_launcher_foreground.xml
│               │   ├── multicolor.xml
│               │   └── round_corners.xml
│               ├── layout/
│               │   └── activity_main.xml
│               ├── mipmap-anydpi-v26/
│               │   ├── ic_launcher.xml
│               │   └── ic_launcher_round.xml
│               └── values/
│                   ├── colors.xml
│                   ├── strings.xml
│                   └── styles.xml
├── settings.gradle
└── shadowlayout/
    ├── .gitignore
    ├── build.gradle
    └── src/
        └── main/
            ├── AndroidManifest.xml
            ├── java/
            │   └── net/
            │       └── orandja/
            │           └── shadowlayout/
            │               ├── ShadowLayout.kt
            │               └── Utils.kt
            └── res/
                └── values/
                    └── attrs.xml

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================

# Created by https://www.toptal.com/developers/gitignore/api/androidstudio
# Edit at https://www.toptal.com/developers/gitignore?templates=androidstudio

### AndroidStudio ###
# Covers files to be ignored for android development using Android Studio.

# Built application files
*.apk
*.ap_

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle
.gradle/
build/

# Signing files
.signing/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio
/*/build/
/*/local.properties
/*/out
/*/*/build
/*/*/production
captures/
.navigation/
*.ipr
*~
*.swp

# Android Patch
gen-external-apklibs

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild

# NDK
obj/

# IntelliJ IDEA
*.iml
*.iws
/out/

# User-specific configurations
.idea/caches/
.idea/libraries/
.idea/shelf/
.idea/workspace.xml
.idea/tasks.xml
.idea/.name
.idea/compiler.xml
.idea/copyright/profiles_settings.xml
.idea/encodings.xml
.idea/misc.xml
.idea/modules.xml
.idea/scopes/scope_settings.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml
.idea/datasources.xml
.idea/dataSources.ids
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml
.idea/assetWizardSettings.xml

# OS-specific files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Legacy Eclipse project files
.classpath
.project
.cproject
.settings/

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.war
*.ear

# virtual machine crash logs (Reference: http://www.java.com/en/download/help/error_hotspot.xml)
hs_err_pid*

## Plugin-specific files:

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Mongo Explorer plugin
.idea/mongoSettings.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

### AndroidStudio Patch ###

!/gradle/wrapper/gradle-wrapper.jar

# End of https://www.toptal.com/developers/gitignore/api/androidstudio


================================================
FILE: .idea/codeStyles/Project.xml
================================================
<component name="ProjectCodeStyleConfiguration">
  <code_scheme name="Project" version="173">
    <option name="RIGHT_MARGIN" value="130" />
    <JetCodeStyleSettings>
      <option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
    </JetCodeStyleSettings>
    <codeStyleSettings language="XML">
      <indentOptions>
        <option name="CONTINUATION_INDENT_SIZE" value="4" />
      </indentOptions>
      <arrangement>
        <rules>
          <section>
            <rule>
              <match>
                <AND>
                  <NAME>xmlns:android</NAME>
                  <XML_ATTRIBUTE />
                  <XML_NAMESPACE>^$</XML_NAMESPACE>
                </AND>
              </match>
            </rule>
          </section>
          <section>
            <rule>
              <match>
                <AND>
                  <NAME>xmlns:.*</NAME>
                  <XML_ATTRIBUTE />
                  <XML_NAMESPACE>^$</XML_NAMESPACE>
                </AND>
              </match>
              <order>BY_NAME</order>
            </rule>
          </section>
          <section>
            <rule>
              <match>
                <AND>
                  <NAME>.*:id</NAME>
                  <XML_ATTRIBUTE />
                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
                </AND>
              </match>
            </rule>
          </section>
          <section>
            <rule>
              <match>
                <AND>
                  <NAME>.*:name</NAME>
                  <XML_ATTRIBUTE />
                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
                </AND>
              </match>
            </rule>
          </section>
          <section>
            <rule>
              <match>
                <AND>
                  <NAME>name</NAME>
                  <XML_ATTRIBUTE />
                  <XML_NAMESPACE>^$</XML_NAMESPACE>
                </AND>
              </match>
            </rule>
          </section>
          <section>
            <rule>
              <match>
                <AND>
                  <NAME>style</NAME>
                  <XML_ATTRIBUTE />
                  <XML_NAMESPACE>^$</XML_NAMESPACE>
                </AND>
              </match>
            </rule>
          </section>
          <section>
            <rule>
              <match>
                <AND>
                  <NAME>.*</NAME>
                  <XML_ATTRIBUTE />
                  <XML_NAMESPACE>^$</XML_NAMESPACE>
                </AND>
              </match>
              <order>BY_NAME</order>
            </rule>
          </section>
          <section>
            <rule>
              <match>
                <AND>
                  <NAME>.*</NAME>
                  <XML_ATTRIBUTE />
                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
                </AND>
              </match>
              <order>ANDROID_ATTRIBUTE_ORDER</order>
            </rule>
          </section>
          <section>
            <rule>
              <match>
                <AND>
                  <NAME>.*</NAME>
                  <XML_ATTRIBUTE />
                  <XML_NAMESPACE>.*</XML_NAMESPACE>
                </AND>
              </match>
              <order>BY_NAME</order>
            </rule>
          </section>
        </rules>
      </arrangement>
    </codeStyleSettings>
    <codeStyleSettings language="kotlin">
      <option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
    </codeStyleSettings>
  </code_scheme>
</component>

================================================
FILE: .idea/codeStyles/codeStyleConfig.xml
================================================
<component name="ProjectCodeStyleConfiguration">
  <state>
    <option name="USE_PER_PROJECT_SETTINGS" value="true" />
  </state>
</component>

================================================
FILE: .idea/gradle.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="GradleMigrationSettings" migrationVersion="1" />
  <component name="GradleSettings">
    <option name="linkedExternalProjectsSettings">
      <GradleProjectSettings>
        <option name="testRunner" value="PLATFORM" />
        <option name="distributionType" value="DEFAULT_WRAPPED" />
        <option name="externalProjectPath" value="$PROJECT_DIR$" />
        <option name="modules">
          <set>
            <option value="$PROJECT_DIR$" />
            <option value="$PROJECT_DIR$/sample" />
            <option value="$PROJECT_DIR$/shadowlayout" />
          </set>
        </option>
        <option name="resolveModulePerSourceSet" value="false" />
        <option name="useQualifiedModuleNames" value="true" />
      </GradleProjectSettings>
    </option>
  </component>
</project>

================================================
FILE: .idea/jarRepositories.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="RemoteRepositoriesConfiguration">
    <remote-repository>
      <option name="id" value="central" />
      <option name="name" value="Maven Central repository" />
      <option name="url" value="https://repo1.maven.org/maven2" />
    </remote-repository>
    <remote-repository>
      <option name="id" value="jboss.community" />
      <option name="name" value="JBoss Community repository" />
      <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
    </remote-repository>
    <remote-repository>
      <option name="id" value="BintrayJCenter" />
      <option name="name" value="BintrayJCenter" />
      <option name="url" value="https://jcenter.bintray.com/" />
    </remote-repository>
    <remote-repository>
      <option name="id" value="Google" />
      <option name="name" value="Google" />
      <option name="url" value="https://dl.google.com/dl/android/maven2/" />
    </remote-repository>
    <remote-repository>
      <option name="id" value="MavenRepo" />
      <option name="name" value="MavenRepo" />
      <option name="url" value="https://repo.maven.apache.org/maven2/" />
    </remote-repository>
  </component>
</project>

================================================
FILE: .idea/runConfigurations.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="RunConfigurationProducerService">
    <option name="ignoredProducers">
      <set>
        <option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
      </set>
    </option>
  </component>
</project>

================================================
FILE: LICENSE
================================================
BSD 3-Clause License

Copyright (c) 2020, Lionel Briand
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
   contributors may be used to endorse or promote products derived from
   this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


================================================
FILE: README.MD
================================================
# ShadowLayout a css like shadow for android

Have you ever wanted a CSS type of shadow in your Android project ? No?! Me neither but designers
keep using it and the death flag is triggered when the app isn't a copy of the design. So, there it goes.

It do much more than casting a shadow so the name can be inaccurate. Internally, it uses the native 
`ScriptIntrinsicBlur` render script so it can easily blur the whole layout like the
[Blurry](https://github.com/wasabeef/Blurry) library.

# Requirements

Android 5.+ (API 21)

# Gradle

The project is hosted on maven Central :
```groovy
allprojects {
    repositories {
        mavenCentral()
    }
}
```

Then add dependency :
```groovy
dependencies {
    implementation("net.orandja.shadowlayout:shadowlayout:1.0.1")
}
```


# Usage

Add `android:clipChildren="false"`, `android:clipToPadding="false"` to the parent layout to let ShadowLayout draw outside of view bounds.

```xml
<net.orandja.shadowlayout.ShadowLayout
    android:padding="8dp"
    android:layout_gravity="center"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/round_corners"
    app:shadow_radius="8"
    app:shadow_x_shift="-1dp"
    app:shadow_y_shift="2dp"
    app:shadow_downscale="1"
    app:shadow_color="#808"
    app:shadow_with_foreground="true"
    app:shadow_with_color="false"
    app:shadow_with_dpi_scale="true"
    app:shadow_with_css_scale="true"
    app:shadow_cast_only_background="true">

    <androidx.appcompat.widget.AppCompatTextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="@color/black"
        android:text="The quick brown fox jump over the lazy dog"
        android:textSize="16sp" />

</net.orandja.shadowlayout.ShadowLayout>
```

![quick brown fox text view](assets/quick_fox.png)

## Parameters

Default value in parenthesis

- `shadow_radius` (6f) The radius of the gaussian blur in float. See #Rules of downscaling section to see how it works. 
- `shadow_x_shift` (0dp) Shift on the horizontal axis in dp
- `shadow_y_shift` (0dp) Shift on the vertical axis in dp
- `shadow_color` (#33000000) Color of the casted shadow
- `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. 
- `shadow_with_foreground` (true) Draw the actual view on top of the shadow.
- `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.
- `shadow_with_dpi_scale` (true) Downscale the internal bitmap by the current smartphone dpi. A 100dp view will result in a 100px bitmap. 
- `shadow_with_css_scale` (true) Downscale by 5/3 more. Because CSS shadow standard blur by a half more than the real blur size.
- `shadow_cast_only_background` (false) Only render the background and not the view as shadow


## Limitations

The default implementation of android gaussian blur (`ScriptIntrinsicBlur` render script) is limited to 25 pixels at max. 
To counter that, the layout downscale the real render of the view inside a bitmap (ALPHA_8 or RGBA with `shadow_with_color` at true). 
Then blur it. Then renders the blur inside the canvas. Then **redraw** the view in the canvas. (`shadow_with_foreground` at true)

The radius can mean multiple things depending on the configurations. 

## Rules of downscaling

When no downscale are applied:
 
```xml
<net.orandja.shadowlayout.ShadowLayout
    app:shadow_radius="3f"
    app:shadow_downscale="1"
    app:shadow_with_dpi_scale="false"
    app:shadow_with_css_scale="false" />
```

The internal bitmap is the same size of the view. The radius is the number of **pixels** blured around.
With 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.
The 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.

When `app:shadow_with_dpi_scale="true"`: Downscale the internal bitmap by the current smartphone dpi. A 100dp view will result in a 100px bitmap.
The radius means **dp**. It blurs up to 25dp.

When `app:shadow_with_css_scale="true"`: Same as dpi, it will add a 5/3 downscale to mimic the CSS shadow blur.

# Shadow anything

As said before since it draw the whole layout it can cast a shadow of anything. Like text:

```xml
    <net.orandja.shadowlayout.ShadowLayout
        android:padding="8dp"
        android:layout_gravity="center"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:shadow_radius="1"
        app:shadow_x_shift="1dp"
        app:shadow_y_shift="2dp"
        app:shadow_downscale="1"
        app:shadow_color="#AA000000"
        app:shadow_with_foreground="true"
        app:shadow_with_color="true"
        app:shadow_with_css_scale="false"
        app:shadow_with_dpi_scale="true"
        app:shadow_cast_only_background="true">

        <androidx.appcompat.widget.AppCompatTextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="#808"
            android:text="The quick brown fox jump over the lazy dog"
            android:textSize="16sp" />

    </net.orandja.shadowlayout.ShadowLayout>
```

![quick brown fox text view](assets/quick_fox_text.png)

Since `shadow_with_color` is at true, the drawn shadow is of the same color of the text rendered.
The color parameter only affect alpha. 


================================================
FILE: build.gradle
================================================
buildscript {
    ext.kotlin_version = '1.5.0'
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.vanniktech:gradle-maven-publish-plugin:0.15.1'
        classpath 'com.android.tools.build:gradle:4.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}


================================================
FILE: consumer-rules.pro
================================================


================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Sat Jun 20 19:39:00 CEST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-all.zip


================================================
FILE: gradle.properties
================================================
org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true
android.enableJetifier=true
kotlin.code.style=official

GROUP=net.orandja.shadowlayout
POM_ARTIFACT_ID=shadowlayout
VERSION_NAME=1.0.1

POM_NAME=Shadow Layout
POM_DESCRIPTION=ShadowLayout a css like shadow for android
POM_INCEPTION_YEAR=2020
POM_URL=https://github.com/L-Briand/ShadowLayout

POM_LICENCE_NAME=BSD 3-Clause License
POM_LICENCE_URL=https://opensource.org/licenses/BSD-3-Clause
POM_LICENCE_DIST=repo

POM_SCM_URL=https://github.com/L-Briand/ShadowLayout
POM_SCM_CONNECTION=scm:git:git://github.com/L-Briand/ShadowLayout.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/L-Briand/ShadowLayout.git

POM_DEVELOPER_ID=L-Briand
POM_DEVELOPER_NAME=Lionel Briand
POM_DEVELOPER_URL=https://github.com/L-Briand

================================================
FILE: gradlew
================================================
#!/usr/bin/env sh

##############################################################################
##
##  Gradle start up script for UN*X
##
##############################################################################

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
    ls=`ls -ld "$PRG"`
    link=`expr "$ls" : '.*-> \(.*\)$'`
    if expr "$link" : '/.*' > /dev/null; then
        PRG="$link"
    else
        PRG=`dirname "$PRG"`"/$link"
    fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn () {
    echo "$*"
}

die () {
    echo
    echo "$*"
    echo
    exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
  CYGWIN* )
    cygwin=true
    ;;
  Darwin* )
    darwin=true
    ;;
  MINGW* )
    msys=true
    ;;
  NONSTOP* )
    nonstop=true
    ;;
esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
        # IBM's JDK on AIX uses strange locations for the executables
        JAVACMD="$JAVA_HOME/jre/sh/java"
    else
        JAVACMD="$JAVA_HOME/bin/java"
    fi
    if [ ! -x "$JAVACMD" ] ; then
        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
    fi
else
    JAVACMD="java"
    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
    MAX_FD_LIMIT=`ulimit -H -n`
    if [ $? -eq 0 ] ; then
        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
            MAX_FD="$MAX_FD_LIMIT"
        fi
        ulimit -n $MAX_FD
        if [ $? -ne 0 ] ; then
            warn "Could not set maximum file descriptor limit: $MAX_FD"
        fi
    else
        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
    fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
    JAVACMD=`cygpath --unix "$JAVACMD"`

    # We build the pattern for arguments to be converted via cygpath
    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
    SEP=""
    for dir in $ROOTDIRSRAW ; do
        ROOTDIRS="$ROOTDIRS$SEP$dir"
        SEP="|"
    done
    OURCYGPATTERN="(^($ROOTDIRS))"
    # Add a user-defined pattern to the cygpath arguments
    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
    fi
    # Now convert the arguments - kludge to limit ourselves to /bin/sh
    i=0
    for arg in "$@" ; do
        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option

        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
        else
            eval `echo args$i`="\"$arg\""
        fi
        i=$((i+1))
    done
    case $i in
        (0) set -- ;;
        (1) set -- "$args0" ;;
        (2) set -- "$args0" "$args1" ;;
        (3) set -- "$args0" "$args1" "$args2" ;;
        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
    esac
fi

# Escape application args
save () {
    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
    echo " "
}
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
  cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"


================================================
FILE: gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega


================================================
FILE: proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile


================================================
FILE: sample/.gitignore
================================================
/build

================================================
FILE: sample/build.gradle
================================================
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "fr.orandja.shadowlayout.sample"
        minSdkVersion 21
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'androidx.core:core-ktx:1.5.0'
    implementation 'androidx.appcompat:appcompat:1.3.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'

    implementation project(':shadowlayout')
}


================================================
FILE: sample/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

================================================
FILE: sample/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="net.orandja.shadowlayout.sample">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:ignore="AllowBackup">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

================================================
FILE: sample/src/main/java/net/orandja/shadowlayout/sample/MainActivity.kt
================================================
package net.orandja.shadowlayout.sample

import android.animation.ObjectAnimator
import android.animation.ValueAnimator
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import net.orandja.shadowlayout.ShadowLayout

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        ValueAnimator.ofFloat(0f, 0f, 25f, 25f).apply {
            duration = 2000
            repeatCount = ObjectAnimator.INFINITE
            repeatMode = ObjectAnimator.REVERSE
            addUpdateListener { findViewById<ShadowLayout>(R.id.__rainbow).shadow_radius = it.animatedValue as Float }
        }.start()
    }
}


================================================
FILE: sample/src/main/res/drawable/ic_launcher_background.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<vector
    android:height="108dp"
    android:width="108dp"
    android:viewportHeight="108"
    android:viewportWidth="108"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <path android:fillColor="#3DDC84"
          android:pathData="M0,0h108v108h-108z"/>
    <path android:fillColor="#00000000" android:pathData="M9,0L9,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M19,0L19,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M29,0L29,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M39,0L39,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M49,0L49,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M59,0L59,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M69,0L69,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M79,0L79,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M89,0L89,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M99,0L99,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,9L108,9"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,19L108,19"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,29L108,29"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,39L108,39"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,49L108,49"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,59L108,59"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,69L108,69"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,79L108,79"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,89L108,89"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,99L108,99"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M19,29L89,29"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M19,39L89,39"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M19,49L89,49"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M19,59L89,59"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M19,69L89,69"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M19,79L89,79"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M29,19L29,89"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M39,19L39,89"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M49,19L49,89"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M59,19L59,89"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M69,19L69,89"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M79,19L79,89"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
</vector>


================================================
FILE: sample/src/main/res/drawable/ic_launcher_foreground.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="108dp"
    android:height="108dp"
    android:viewportWidth="108"
    android:viewportHeight="108"
    android:tint="#FFFFFF">
  <group android:scaleX="2.61"
      android:scaleY="2.61"
      android:translateX="22.68"
      android:translateY="22.68">
    <path
        android:fillColor="@android:color/white"
        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"/>
  </group>
</vector>


================================================
FILE: sample/src/main/res/drawable/multicolor.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <corners android:radius="8dp" />
    <gradient
        android:angle="0"
        android:centerColor="#F0F"
        android:centerX="50%"
        android:centerY="50%"
        android:endColor="#0FF"
        android:startColor="#FF0" />
</shape>

================================================
FILE: sample/src/main/res/drawable/round_corners.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <corners android:radius="8dp" />
    <solid android:color="#999" />
</shape>

================================================
FILE: sample/src/main/res/layout/activity_main.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:clipChildren="false"
    android:clipToPadding="false"
    android:orientation="vertical"
    android:padding="16dp">

    <net.orandja.shadowlayout.ShadowLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:background="@drawable/round_corners"
        android:padding="8dp"
        app:shadow_cast_only_background="true"
        app:shadow_color="#808"
        app:shadow_downscale="1"
        app:shadow_radius="8"
        app:shadow_with_color="false"
        app:shadow_with_content="true"
        app:shadow_with_css_scale="true"
        app:shadow_with_dpi_scale="true"
        app:shadow_x_shift="-1dp"
        app:shadow_y_shift="2dp">

        <androidx.appcompat.widget.AppCompatTextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="The quick brown fox jump over the lazy dog"
            android:textColor="#000"
            android:textSize="16sp" />

    </net.orandja.shadowlayout.ShadowLayout>

    <Space
        android:layout_width="8dp"
        android:layout_height="8dp" />

    <net.orandja.shadowlayout.ShadowLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:padding="8dp"
        app:shadow_color="#AA000000"
        app:shadow_downscale="1"
        app:shadow_radius="1"
        app:shadow_with_color="true"
        app:shadow_with_content="true"
        app:shadow_with_css_scale="false"
        app:shadow_with_dpi_scale="true"
        app:shadow_x_shift="1dp"
        app:shadow_y_shift="2dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <androidx.appcompat.widget.AppCompatTextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="The quick brown fox jump over the lazy dog"
                android:textColor="#808"
                android:textSize="16sp" />

        </LinearLayout>

    </net.orandja.shadowlayout.ShadowLayout>

    <Space
        android:layout_width="16dp"
        android:layout_height="16dp" />

    <net.orandja.shadowlayout.ShadowLayout
        android:id="@+id/__rainbow"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="12dp"
        android:background="@drawable/multicolor"
        android:padding="16dp"
        app:shadow_color="#FF000000"
        app:shadow_downscale="1"
        app:shadow_radius="25"
        app:shadow_with_color="true"
        app:shadow_with_content="false"
        app:shadow_with_css_scale="true"
        app:shadow_with_dpi_scale="true"
        app:shadow_x_shift="4dp"
        app:shadow_y_shift="10dp">

        <androidx.appcompat.widget.AppCompatTextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="The quick brown fox jump over the lazy dog"
            android:textColor="#808"
            android:textSize="16sp" />
    </net.orandja.shadowlayout.ShadowLayout>

    <net.orandja.shadowlayout.ShadowLayout
        android:id="@+id/__default"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_margin="12dp"
        android:background="@android:color/white"
        android:padding="16dp">

        <androidx.appcompat.widget.AppCompatTextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="The quick brown fox jump over the lazy dog"
            android:textColor="#808"
            android:textSize="16sp" />
    </net.orandja.shadowlayout.ShadowLayout>

</LinearLayout>

================================================
FILE: sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@drawable/ic_launcher_background"/>
    <foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

================================================
FILE: sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@drawable/ic_launcher_background"/>
    <foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

================================================
FILE: sample/src/main/res/values/colors.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#6200EE</color>
    <color name="colorPrimaryDark">#3700B3</color>
    <color name="colorAccent">#03DAC5</color>
</resources>

================================================
FILE: sample/src/main/res/values/strings.xml
================================================
<resources>
    <string name="app_name">sample</string>
</resources>

================================================
FILE: sample/src/main/res/values/styles.xml
================================================
<resources>
    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
        <item name="shadowLayoutStyle">@style/ShadowLayout</item>
    </style>

    <style name="ShadowLayout">
        <item name="shadow_color">#FF000000</item>
        <item name="shadow_downscale">1</item>
        <item name="shadow_radius">10</item>
        <item name="shadow_with_color">false</item>
        <item name="shadow_with_content">true</item>
        <item name="shadow_cast_only_background">false</item>
        <item name="shadow_with_css_scale">true</item>
        <item name="shadow_with_dpi_scale">true</item>
        <item name="shadow_x_shift">2dp</item>
        <item name="shadow_y_shift">3dp</item>
    </style>

</resources>

================================================
FILE: settings.gradle
================================================
rootProject.name = "ShadowLayout"

include ":shadowlayout", ":sample"

================================================
FILE: shadowlayout/.gitignore
================================================
/build

================================================
FILE: shadowlayout/build.gradle
================================================
plugins {
    id 'com.android.library'
    id 'kotlin-android'
    id 'com.vanniktech.maven.publish'
}

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8
    }

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        consumerProguardFiles 'consumer-rules.pro'
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.core:core-ktx:1.5.0'
}

================================================
FILE: shadowlayout/src/main/AndroidManifest.xml
================================================
<manifest package="net.orandja.shadowlayout" />


================================================
FILE: shadowlayout/src/main/java/net/orandja/shadowlayout/ShadowLayout.kt
================================================
package net.orandja.shadowlayout

import android.content.Context
import android.content.res.Resources
import android.graphics.*
import android.renderscript.Allocation
import android.renderscript.Element
import android.renderscript.RenderScript
import android.renderscript.ScriptIntrinsicBlur
import android.util.AttributeSet
import android.util.DisplayMetrics
import android.view.View
import android.view.ViewOutlineProvider
import android.widget.FrameLayout
import androidx.annotation.ColorRes
import androidx.annotation.DimenRes
import androidx.annotation.Nullable
import androidx.core.content.res.ResourcesCompat
import androidx.core.graphics.scaleMatrix
import androidx.core.graphics.times
import androidx.core.graphics.translationMatrix
import androidx.core.graphics.withMatrix
import kotlin.math.ceil

/** A CSS like shadow */
@Suppress("PropertyName")
class ShadowLayout @JvmOverloads constructor(
    context: Context,
    @Nullable attrs: AttributeSet? = null,
    defStyleAttr: Int = R.attr.shadowLayoutStyle,
    defStyleRes: Int = 0
) : FrameLayout(context, attrs, defStyleAttr, defStyleRes) {

    companion object {
        @JvmField
        val ratioDpToPixels =
            Resources.getSystem().displayMetrics.densityDpi.toFloat() / DisplayMetrics.DENSITY_DEFAULT

        @JvmField
        val ratioPixelsToDp: Float = (1.0 / ratioDpToPixels.toDouble()).toFloat()

        // Thanks to this hero https://stackoverflow.com/a/41322648/4681367
        const val cssRatio: Float = 5f / 3f
    }

    // BASIC FIELDS

    private val paint = Paint(Paint.ANTI_ALIAS_FLAG or Paint.DITHER_FLAG)
    private val eraser = Paint().apply { xfermode = PorterDuffXfermode(PorterDuff.Mode.DST_OUT) }

    var shadow_color: Int
        get() = paint.color
        set(value) {
            if (paint.color == value) return
            paint.color = value
            postInvalidate()
        }

    fun setColorRes(@ColorRes color: Int) {
        shadow_color = ResourcesCompat.getColor(resources, color, context.theme)
    }

    var shadow_x_shift: Float by OnUpdate(0f)
    fun setXShift(@DimenRes shift: Int) {
        shadow_x_shift = context.resources.getDimension(shift)
    }

    var shadow_y_shift: Float by OnUpdate(0f)
    fun setYShift(@DimenRes shift: Int) {
        shadow_y_shift = context.resources.getDimension(shift)
    }

    var shadow_downscale: Float by OnUpdate(1f, { it.coerceAtLeast(0.1f) }) {
        realRadius = shadow_radius / it
        updateBitmap()
    }
    var shadow_radius: Float by OnUpdate(0f, { it.coerceAtLeast(0f) }) {
        realRadius = it / shadow_downscale
    }
    private var realRadius: Float by OnUpdate(
        0f, { it.coerceIn(0f, 25f) } // allowed blur size on ScriptIntrinsicBlur by android
    )

    var shadow_cast_only_background: Boolean by OnUpdate(false)
    var shadow_with_content: Boolean by OnUpdate(true)
    var shadow_with_color: Boolean by OnUpdate(false) {
        destroyBitmap()
        updateBitmap()
    }
    var shadow_with_dpi_scale: Boolean by OnUpdate(true) {
        destroyBitmap()
        updateBitmap()
    }
    var shadow_with_css_scale: Boolean by OnUpdate(true) {
        destroyBitmap()
        updateBitmap()
    }


    // IN VARIABLES

    private val ratioDpToPixels get() = if (shadow_with_dpi_scale) Companion.ratioDpToPixels else 1f
    private val ratioPixelsToDp get() = if (shadow_with_dpi_scale) Companion.ratioPixelsToDp else 1f
    private val cssRatio get() = if (shadow_with_css_scale) Companion.cssRatio else 1f

    // size in pixel of the blur spread
    private val pixelsOverBoundaries: Int get() = if (shadow_downscale < 1f) 25 else ceil(25f * shadow_downscale).toInt()
    private val viewBounds: Rect = Rect()
    private fun setViewBounds(width: Int, height: Int) {
        viewBounds.set(0, 0, width, height)
        updateBitmap()
    }

    private var blurBitmap: Bitmap? = null
    private var blurCanvas: Canvas? = null

    private var renderScript: RenderScript? = null;
    private var script: ScriptIntrinsicBlur? = null;
    private var inAlloc: Allocation? = null
    private var outAlloc: Allocation? = null

    private var lastWithColorScript: Boolean? = null
    private fun getScript(): Pair<ScriptIntrinsicBlur, RenderScript> {
        val renderScript = this.renderScript ?: RenderScript.create(context)
        if (lastWithColorScript != shadow_with_color) { // recreate script only if colors change
            lastWithColorScript = shadow_with_color
            script = null
        }
        if (script != null) return Pair(script!!, renderScript!!)
        val element = if (shadow_with_color) Element.U8_4(renderScript) else Element.U8(renderScript)
        script = ScriptIntrinsicBlur.create(renderScript, element)
        return Pair(script!!, renderScript!!)
    }

    private val lastBounds = Rect()
    private var lastScale = 0f
    private var lastWithColorBitmap: Boolean? = null
    private var lastWithDpi: Boolean? = null
    private var lastWithCss: Boolean? = null
    private fun updateBitmap() {
        // do not recreate if same specs.
        if (viewBounds.isEmpty || isAttachedToWindow
            && lastBounds == viewBounds
            && shadow_downscale == lastScale
            && shadow_with_color == lastWithColorBitmap
            && shadow_with_dpi_scale == lastWithDpi
            && shadow_with_css_scale == lastWithCss
        ) return
        lastBounds.set(viewBounds)
        lastScale = shadow_downscale
        lastWithColorBitmap = shadow_with_color
        lastWithColorBitmap = shadow_with_color
        lastWithDpi = shadow_with_dpi_scale
        lastWithCss = shadow_with_css_scale

        // create a receptacle for blur script. (MDPI / downscale) + (pixels * 2) cause blur spread in all directions
        blurBitmap?.recycle()
        blurBitmap = Bitmap.createBitmap(
            (ceil(
                (viewBounds.width().toFloat() * ratioPixelsToDp) / shadow_downscale / cssRatio
            ) + pixelsOverBoundaries * 2).toInt(),
            (ceil(
                (viewBounds.height().toFloat() * ratioPixelsToDp) / shadow_downscale / cssRatio
            ) + pixelsOverBoundaries * 2).toInt(),
            if (shadow_with_color) Bitmap.Config.ARGB_8888 else Bitmap.Config.ALPHA_8
        )

        blurCanvas = Canvas(blurBitmap!!)

        val (script, renderScript) = getScript()
        inAlloc?.destroy()
        inAlloc = Allocation.createFromBitmap(renderScript, blurBitmap)
        if (outAlloc?.type != inAlloc?.type) {
            outAlloc?.destroy()
            outAlloc = Allocation.createTyped(renderScript, inAlloc!!.type)
        }
        script.setInput(inAlloc)
    }

    private fun destroyBitmap() {
        blurBitmap?.recycle()
        blurBitmap = null
        blurCanvas = null
        script?.destroy()
        script = null
        inAlloc?.destroy()
        inAlloc = null
        outAlloc?.destroy()
        outAlloc = null
        lastBounds.setEmpty()
        lastScale = 0f
        lastWithColorScript = null
        lastWithColorBitmap = null
        lastWithDpi = null
        lastWithCss = null
    }

    /** Cause the default elevation rendering to not work */
    override fun getOutlineProvider(): ViewOutlineProvider = object : ViewOutlineProvider() {
        override fun getOutline(view: View?, outline: Outline?) = Unit
    }

    // Overriding view

    init {
        if (!isInEditMode) {
            val attributes = context.obtainStyledAttributes(
                attrs, R.styleable.ShadowLayout, defStyleAttr, defStyleRes
            )

            shadow_color = attributes.getColor(R.styleable.ShadowLayout_shadow_color, 51 shl 24)
            shadow_with_color = attributes.getBoolean(R.styleable.ShadowLayout_shadow_with_color, false)
            shadow_with_content = attributes.getBoolean(R.styleable.ShadowLayout_shadow_with_content, true)
            shadow_with_dpi_scale = attributes.getBoolean(R.styleable.ShadowLayout_shadow_with_dpi_scale, true)
            shadow_with_css_scale = attributes.getBoolean(R.styleable.ShadowLayout_shadow_with_css_scale, true)
            shadow_x_shift = attributes.getDimension(R.styleable.ShadowLayout_shadow_x_shift, 0f)
            shadow_y_shift = attributes.getDimension(R.styleable.ShadowLayout_shadow_y_shift, 0f)
            shadow_downscale = attributes.getFloat(R.styleable.ShadowLayout_shadow_downscale, 1f)
            shadow_radius = attributes.getFloat(R.styleable.ShadowLayout_shadow_radius, 6f)
            shadow_cast_only_background = attributes.getBoolean(R.styleable.ShadowLayout_shadow_cast_only_background, false)

            attributes.recycle()
        }
        setWillNotDraw(false)
    }

    override fun onAttachedToWindow() {
        super.onAttachedToWindow()
        if (!isInEditMode) updateBitmap()
    }

    override fun onDetachedFromWindow() {
        super.onDetachedFromWindow()
        if (!isInEditMode) destroyBitmap()
    }

    override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
        super.onSizeChanged(w, h, oldw, oldh)
        if (!isInEditMode) setViewBounds(w, h)
    }

    private inline val blurTMatrix: Matrix // cause blur spreads
        get() = translationMatrix(pixelsOverBoundaries.toFloat(), pixelsOverBoundaries.toFloat())
    private inline val blurSMatrix: Matrix // to draw inside the small blurBitmap
        get() = scaleMatrix(ratioPixelsToDp / shadow_downscale / cssRatio, ratioPixelsToDp / shadow_downscale / cssRatio)

    private inline val drawTMatrix: Matrix // counterbalance for blur spread in canvas
        get() = translationMatrix(
            -(pixelsOverBoundaries * ratioDpToPixels * shadow_downscale * cssRatio),
            -(pixelsOverBoundaries * ratioDpToPixels * shadow_downscale * cssRatio)
        )
    private inline val drawSMatrix: Matrix // enlarge blur image to canvas size
        get() = scaleMatrix(
            ratioDpToPixels * shadow_downscale * cssRatio,
            ratioDpToPixels * shadow_downscale * cssRatio
        )
    private inline val shiftTMatrix: Matrix // User want a nice shifted shadow
        get() = translationMatrix(
            shadow_x_shift / shadow_downscale / cssRatio,
            shadow_y_shift / shadow_downscale / cssRatio
        )

    override fun draw(canvas: Canvas?) {
        canvas ?: return
        if (isInEditMode) {
            super.draw(canvas)
            return
        }
        if (blurCanvas != null) {
            blurCanvas!!.drawRect(blurCanvas!!.clipBounds, eraser)
            blurCanvas!!.withMatrix(blurTMatrix * blurSMatrix) {
                if (shadow_cast_only_background) {
                    background.bounds = viewBounds
                    background?.draw(blurCanvas!!)
                } else super.draw(blurCanvas)
            }
            if (realRadius > 0f) { // Do not blur if no radius
                val (script) = getScript()
                script.setRadius(realRadius)
                inAlloc?.copyFrom(blurBitmap)
                script.forEach(outAlloc)
                outAlloc?.copyTo(blurBitmap)
            }
            canvas.withMatrix(drawTMatrix * drawSMatrix * shiftTMatrix) {
                canvas.drawBitmap(blurBitmap!!, 0f, 0f, paint)
            }
        }
        if (shadow_with_content) super.draw(canvas)
    }

}

================================================
FILE: shadowlayout/src/main/java/net/orandja/shadowlayout/Utils.kt
================================================
package net.orandja.shadowlayout

import android.view.View
import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KProperty

internal class OnUpdate<T>(default: T, val transformation: ((T) -> T)? = null, val onUpdate: ((T) -> Unit)? = null) :
    ReadWriteProperty<View, T> {
    var backing: T = default
    override fun getValue(thisRef: View, property: KProperty<*>): T = backing
    override fun setValue(thisRef: View, property: KProperty<*>, value: T) {
        if (backing == value) return
        backing = transformation?.invoke(value) ?: value
        onUpdate?.invoke(value)
        thisRef.postInvalidate()
    }
}

================================================
FILE: shadowlayout/src/main/res/values/attrs.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <attr name="shadowLayoutStyle" format="reference" />
    <declare-styleable name="ShadowLayout">
        <!-- The radius of the gaussian blur in float -->
        <attr name="shadow_radius" format="float" />
        <!-- Shift on the horizontal axis in dp -->
        <attr name="shadow_x_shift" format="dimension" />
        <!-- Shift on the vertical axis in dp -->
        <attr name="shadow_y_shift" format="dimension" />
        <!-- Color of the casted shadow -->
        <attr name="shadow_color" format="color" />
        <!-- Keep all the subview colors in the blur -->
        <attr name="shadow_with_content" format="boolean" />
        <!-- Keep all the subview colors in the blur  -->
        <attr name="shadow_with_color" format="boolean" />
        <!-- Downscale of the internal bitmap that render the shadow -->
        <attr name="shadow_downscale" format="float" />
        <!-- Downscale the internal bitmap by the current smartphone dpi -->
        <attr name="shadow_with_dpi_scale" format="boolean" />
        <!-- Downscale by 5/3 more -->
        <attr name="shadow_with_css_scale" format="boolean" />
        <!-- Only render the background and not the view as shadow -->
        <attr name="shadow_cast_only_background" format="boolean" />
    </declare-styleable>
</resources>
Download .txt
gitextract_6iuvvsg5/

├── .gitignore
├── .idea/
│   ├── codeStyles/
│   │   ├── Project.xml
│   │   └── codeStyleConfig.xml
│   ├── gradle.xml
│   ├── jarRepositories.xml
│   └── runConfigurations.xml
├── LICENSE
├── README.MD
├── build.gradle
├── consumer-rules.pro
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── proguard-rules.pro
├── sample/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── java/
│           │   └── net/
│           │       └── orandja/
│           │           └── shadowlayout/
│           │               └── sample/
│           │                   └── MainActivity.kt
│           └── res/
│               ├── drawable/
│               │   ├── ic_launcher_background.xml
│               │   ├── ic_launcher_foreground.xml
│               │   ├── multicolor.xml
│               │   └── round_corners.xml
│               ├── layout/
│               │   └── activity_main.xml
│               ├── mipmap-anydpi-v26/
│               │   ├── ic_launcher.xml
│               │   └── ic_launcher_round.xml
│               └── values/
│                   ├── colors.xml
│                   ├── strings.xml
│                   └── styles.xml
├── settings.gradle
└── shadowlayout/
    ├── .gitignore
    ├── build.gradle
    └── src/
        └── main/
            ├── AndroidManifest.xml
            ├── java/
            │   └── net/
            │       └── orandja/
            │           └── shadowlayout/
            │               ├── ShadowLayout.kt
            │               └── Utils.kt
            └── res/
                └── values/
                    └── attrs.xml
Condensed preview — 38 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (62K chars).
[
  {
    "path": ".gitignore",
    "chars": 2160,
    "preview": "\n# Created by https://www.toptal.com/developers/gitignore/api/androidstudio\n# Edit at https://www.toptal.com/developers/"
  },
  {
    "path": ".idea/codeStyles/Project.xml",
    "chars": 3614,
    "preview": "<component name=\"ProjectCodeStyleConfiguration\">\n  <code_scheme name=\"Project\" version=\"173\">\n    <option name=\"RIGHT_MA"
  },
  {
    "path": ".idea/codeStyles/codeStyleConfig.xml",
    "chars": 142,
    "preview": "<component name=\"ProjectCodeStyleConfiguration\">\n  <state>\n    <option name=\"USE_PER_PROJECT_SETTINGS\" value=\"true\" />\n "
  },
  {
    "path": ".idea/gradle.xml",
    "chars": 872,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"GradleMigrationSettings\" migrationVersio"
  },
  {
    "path": ".idea/jarRepositories.xml",
    "chars": 1267,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"RemoteRepositoriesConfiguration\">\n    <r"
  },
  {
    "path": ".idea/runConfigurations.xml",
    "chars": 337,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"RunConfigurationProducerService\">\n    <o"
  },
  {
    "path": "LICENSE",
    "chars": 1521,
    "preview": "BSD 3-Clause License\n\nCopyright (c) 2020, Lionel Briand\nAll rights reserved.\n\nRedistribution and use in source and binar"
  },
  {
    "path": "README.MD",
    "chars": 5683,
    "preview": "# ShadowLayout a css like shadow for android\n\nHave you ever wanted a CSS type of shadow in your Android project ? No?! M"
  },
  {
    "path": "build.gradle",
    "chars": 426,
    "preview": "buildscript {\n    ext.kotlin_version = '1.5.0'\n    repositories {\n        google()\n        mavenCentral()\n    }\n    depe"
  },
  {
    "path": "consumer-rules.pro",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "chars": 231,
    "preview": "#Sat Jun 20 19:39:00 CEST 2020\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER"
  },
  {
    "path": "gradle.properties",
    "chars": 774,
    "preview": "org.gradle.jvmargs=-Xmx1536m\nandroid.useAndroidX=true\nandroid.enableJetifier=true\nkotlin.code.style=official\n\nGROUP=net."
  },
  {
    "path": "gradlew",
    "chars": 5296,
    "preview": "#!/usr/bin/env sh\n\n##############################################################################\n##\n##  Gradle start up"
  },
  {
    "path": "gradlew.bat",
    "chars": 2260,
    "preview": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@r"
  },
  {
    "path": "proguard-rules.pro",
    "chars": 751,
    "preview": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguar"
  },
  {
    "path": "sample/.gitignore",
    "chars": 6,
    "preview": "/build"
  },
  {
    "path": "sample/build.gradle",
    "chars": 899,
    "preview": "apply plugin: 'com.android.application'\napply plugin: 'kotlin-android'\n\nandroid {\n    compileSdkVersion 30\n    buildTool"
  },
  {
    "path": "sample/proguard-rules.pro",
    "chars": 750,
    "preview": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguar"
  },
  {
    "path": "sample/src/main/AndroidManifest.xml",
    "chars": 810,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:to"
  },
  {
    "path": "sample/src/main/java/net/orandja/shadowlayout/sample/MainActivity.kt",
    "chars": 757,
    "preview": "package net.orandja.shadowlayout.sample\n\nimport android.animation.ObjectAnimator\nimport android.animation.ValueAnimator\n"
  },
  {
    "path": "sample/src/main/res/drawable/ic_launcher_background.xml",
    "chars": 4867,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<vector\n    android:height=\"108dp\"\n    android:width=\"108dp\"\n    android:viewport"
  },
  {
    "path": "sample/src/main/res/drawable/ic_launcher_foreground.xml",
    "chars": 2347,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"108dp\"\n    android:height=\"108dp\"\n"
  },
  {
    "path": "sample/src/main/res/drawable/multicolor.xml",
    "chars": 385,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:sha"
  },
  {
    "path": "sample/src/main/res/drawable/round_corners.xml",
    "chars": 216,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:sha"
  },
  {
    "path": "sample/src/main/res/layout/activity_main.xml",
    "chars": 4249,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmln"
  },
  {
    "path": "sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml",
    "chars": 270,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <b"
  },
  {
    "path": "sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml",
    "chars": 270,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <b"
  },
  {
    "path": "sample/src/main/res/values/colors.xml",
    "chars": 207,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#6200EE</color>\n    <color name=\"color"
  },
  {
    "path": "sample/src/main/res/values/strings.xml",
    "chars": 68,
    "preview": "<resources>\n    <string name=\"app_name\">sample</string>\n</resources>"
  },
  {
    "path": "sample/src/main/res/values/styles.xml",
    "chars": 1007,
    "preview": "<resources>\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\""
  },
  {
    "path": "settings.gradle",
    "chars": 69,
    "preview": "rootProject.name = \"ShadowLayout\"\n\ninclude \":shadowlayout\", \":sample\""
  },
  {
    "path": "shadowlayout/.gitignore",
    "chars": 6,
    "preview": "/build"
  },
  {
    "path": "shadowlayout/build.gradle",
    "chars": 966,
    "preview": "plugins {\n    id 'com.android.library'\n    id 'kotlin-android'\n    id 'com.vanniktech.maven.publish'\n}\n\nandroid {\n    co"
  },
  {
    "path": "shadowlayout/src/main/AndroidManifest.xml",
    "chars": 48,
    "preview": "<manifest package=\"net.orandja.shadowlayout\" />\n"
  },
  {
    "path": "shadowlayout/src/main/java/net/orandja/shadowlayout/ShadowLayout.kt",
    "chars": 11330,
    "preview": "package net.orandja.shadowlayout\n\nimport android.content.Context\nimport android.content.res.Resources\nimport android.gra"
  },
  {
    "path": "shadowlayout/src/main/java/net/orandja/shadowlayout/Utils.kt",
    "chars": 636,
    "preview": "package net.orandja.shadowlayout\n\nimport android.view.View\nimport kotlin.properties.ReadWriteProperty\nimport kotlin.refl"
  },
  {
    "path": "shadowlayout/src/main/res/values/attrs.xml",
    "chars": 1360,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <attr name=\"shadowLayoutStyle\" format=\"reference\" />\n    <declare"
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the L-Briand/ShadowLayout GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 38 files (55.5 KB), approximately 16.5k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!