Skip to content

Commit

Permalink
Merge branch 'main' into snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbanes committed Oct 31, 2020
2 parents 57d01c2 + f225e36 commit afc14f7
Show file tree
Hide file tree
Showing 42 changed files with 1,605 additions and 284 deletions.
11 changes: 8 additions & 3 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@

Accompanist is a group of libraries that contains some utilities which I've found myself copying around projects which use [Jetpack Compose][compose]. Currently, it contains:

- 🖼️ [Coil image loading composables](./coil/README.md)
- 🖼️ [Picasso image loading composables](./picasso/README.md)
- 🖼️ [Glide image loading composables](./glide/README.md)
### Image loading
A number of libraries which integrate popular image loading libraries into Jetpack Compose:

- 🖼️ [Coil image loading composables](./coil/)
- 🖼️ [Picasso image loading composables](./picasso/)
- 🖼️ [Glide image loading composables](./glide/)

### 📐 [Insets](./insets/)
A library which brings [WindowInsets](https://developer.android.com/reference/kotlin/android/view/WindowInsets) support to Jetpack Compose.


---

[Jetpack Compose][compose] is a fast-moving project and I'll be updating these libraries to match the
latest tagged release as quickly as possible. Each [release listing](https://github.com/chrisbanes/accompanist/releases) will outline what version of Compose libraries it depends on.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ object Versions {
}

object Libs {
const val androidGradlePlugin = "com.android.tools.build:gradle:4.2.0-alpha13"
const val androidGradlePlugin = "com.android.tools.build:gradle:4.2.0-alpha15"

const val gradleMavenPublishPlugin = "com.vanniktech:gradle-maven-publish-plugin:0.13.0"

Expand Down Expand Up @@ -85,7 +85,7 @@ object Libs {
const val core = "androidx.core:core:1.2.0"
const val coreKtx = "androidx.core:core-ktx:1.2.0"

const val appcompat = "androidx.appcompat:appcompat:1.3.0-alpha02"
const val coreAlpha = "androidx.core:core:1.5.0-alpha04"
}

object Coil {
Expand Down
6 changes: 4 additions & 2 deletions coil/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Jetpack Compose + Coil
# Coil for Jetpack Compose

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.chrisbanes.accompanist/accompanist-coil/badge.svg)](https://search.maven.org/search?q=g:dev.chrisbanes.accompanist)
[![Maven Central](https://img.shields.io/maven-central/v/dev.chrisbanes.accompanist/accompanist-coil)](https://search.maven.org/search?q=g:dev.chrisbanes.accompanist)

This library brings easy-to-use composable which can fetch and display images from external sources, such as network, using the [Coil][coil] image loading library.

Expand Down Expand Up @@ -117,6 +117,8 @@ For more information on ambients, see [here](https://developer.android.com/refer

## Download

[![Maven Central](https://img.shields.io/maven-central/v/dev.chrisbanes.accompanist/accompanist-coil)](https://search.maven.org/search?q=g:dev.chrisbanes.accompanist)

```groovy
repositories {
mavenCentral()
Expand Down
21 changes: 10 additions & 11 deletions generate_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,27 @@ cp CONTRIBUTING.md $DOCS_ROOT/contributing.md
cp images/social.png $DOCS_ROOT/header.png

sed -i.bak 's/CONTRIBUTING.md/contributing/' $DOCS_ROOT/index.md
sed -i.bak 's/coil\/README.md/glide/' $DOCS_ROOT/index.md
sed -i.bak 's/glide\/README.md/coil/' $DOCS_ROOT/index.md
sed -i.bak 's/picasso\/README.md/picasso/' $DOCS_ROOT/index.md
sed -i.bak 's/README.md//' $DOCS_ROOT/index.md
sed -i.bak 's/images\/social.png/header.png/' $DOCS_ROOT/index.md

# Convert docs/xxx.md links to just xxx/
sed -i.bak 's/docs\/\([a-zA-Z-]*\).md/\1/' $DOCS_ROOT/index.md

cp coil/README.md $DOCS_ROOT/coil.md
mkdir -p $DOCS_ROOT/coil
cp coil/images/crossfade.gif $DOCS_ROOT/coil/crossfade.gif
sed -i.bak 's/images\/crossfade.gif/crossfade.gif/' $DOCS_ROOT/coil.md
cp -r coil/images $DOCS_ROOT/coil

cp picasso/README.md $DOCS_ROOT/picasso.md
mkdir -p $DOCS_ROOT/picasso
cp picasso/images/crossfade.gif $DOCS_ROOT/picasso/crossfade.gif
sed -i.bak 's/images\/crossfade.gif/crossfade.gif/' $DOCS_ROOT/picasso.md
cp -r picasso/images $DOCS_ROOT/picasso

cp glide/README.md $DOCS_ROOT/glide.md
mkdir -p $DOCS_ROOT/glide
cp glide/images/crossfade.gif $DOCS_ROOT/glide/crossfade.gif
sed -i.bak 's/images\/crossfade.gif/crossfade.gif/' $DOCS_ROOT/glide.md
cp -r glide/images $DOCS_ROOT/glide

# Convert docs/xxx.md links to just xxx/
sed -i.bak 's/docs\/\([a-zA-Z-]*\).md/\1/' $DOCS_ROOT/index.md
cp insets/README.md $DOCS_ROOT/insets.md
mkdir -p $DOCS_ROOT/insets
cp -r insets/images $DOCS_ROOT/insets

#########################
# Tidy up Dokka output
Expand Down
6 changes: 4 additions & 2 deletions glide/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Jetpack Compose + Glide
# Glide for Jetpack Compose

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.chrisbanes.accompanist/accompanist-glide/badge.svg)](https://search.maven.org/search?q=g:dev.chrisbanes.accompanist)
[![Maven Central](https://img.shields.io/maven-central/v/dev.chrisbanes.accompanist/accompanist-glide)](https://search.maven.org/search?q=g:dev.chrisbanes.accompanist)

This library brings easy-to-use composable which can fetch and display images from external sources, such as network, using the [Glide][glide] image loading library.

Expand Down Expand Up @@ -122,6 +122,8 @@ For more information on ambients, see [here](https://developer.android.com/refer

## Download

[![Maven Central](https://img.shields.io/maven-central/v/dev.chrisbanes.accompanist/accompanist-glide)](https://search.maven.org/search?q=g:dev.chrisbanes.accompanist)

```groovy
repositories {
mavenCentral()
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
18 changes: 1 addition & 17 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
#
# Copyright 2020 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
53 changes: 33 additions & 20 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
## Gradle start up script for UN*X
Expand Down Expand Up @@ -28,7 +44,7 @@ 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=""
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down Expand Up @@ -66,6 +82,7 @@ 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
Expand Down Expand Up @@ -109,10 +126,11 @@ 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
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; 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
Expand All @@ -138,19 +156,19 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $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" ;;
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

Expand All @@ -159,14 +177,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
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" "$@"

0 comments on commit afc14f7

Please sign in to comment.