Skip to content

Commit

Permalink
Fix Glide docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbanes committed Oct 14, 2020
1 parent c41edd7 commit 576a148
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
8 changes: 7 additions & 1 deletion generate_docs.sh
Expand Up @@ -2,6 +2,7 @@

DOCS_ROOT=docs-gen

[ -d $DOCS_ROOT ] && rm -r $DOCS_ROOT
mkdir $DOCS_ROOT

# Work around Dokka failing to link against external links generated from 'gfm' sources.
Expand All @@ -17,7 +18,7 @@ sed -i.bak 's/$dokka.linkExtension:md/$dokka.linkExtension:html/g' package-list-
rm package-list-coil-base

# Copy over any static + API docs to our $DOCS_ROOT
cp -r docs/ $DOCS_ROOT/
cp -R docs/* $DOCS_ROOT

cp README.md $DOCS_ROOT/index.md
cp CONTRIBUTING.md $DOCS_ROOT/contributing.md
Expand All @@ -37,6 +38,11 @@ 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 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

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

Expand Down
17 changes: 8 additions & 9 deletions glide/README.md
Expand Up @@ -4,7 +4,7 @@

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.

<img src="https://glide-kt.github.io/glide/logo.svg" width="480" alt="Glide logo">
<img src="https://github.com/bumptech/glide/blob/master/static/glide_logo.png?raw=true" width="480" alt="Glide logo">

## `GlideImage()`

Expand All @@ -20,13 +20,16 @@ GlideImage(

This loads the `data` passed in with [Glide][glide], and then displays the resulting image using the standard `Image` composable.

You can also customize the Glide [`ImageRequest`](https://glide-kt.github.io/glide/image_requests/) through the `requestBuilder` parameter. This allows usage of things like (but not limited to) transformations:
You can also customize the Glide [`RequestBuilder`](https://bumptech.github.io/glide/javadocs/4110/com/bumptech/glide/RequestBuilder.html) through the `requestBuilder` parameter. This allows usage of things like (but not limited to) transformations:

```kotlin
GlideImage(
data = "https://picsum.photos/300/300",
requestBuilder = {
transformations(CircleCropTransformation())
val options = RequestOptions()
options.centerCrop()

apply(options)
},
)
```
Expand Down Expand Up @@ -91,7 +94,7 @@ GlideImage(

## GIFs

Accompanist Glide supports GIFs through Glide's own GIF support. Follow the [setup instructions](https://glide-kt.github.io/glide/gifs/) and it should just work.
Accompanist Glide supports GIFs through Glide's own GIF support. There's nothing you need to do, it should just work.

## Download

Expand All @@ -107,10 +110,6 @@ dependencies {

Snapshots of the development version are available in [Sonatype's `snapshots` repository][snap]. These are updated on every commit.

### What's the goal of the library?

Eventually the goal is to upstream all of this functionality back to [Glide][glide]. [Jetpack Compose][compose]'s development is currently moving very fast, which means that there are frequent API changes between releases. For now, it makes sense to keep this as a seperately released library to track the latest Compose release.

[compose]: https://developer.android.com/jetpack/compose
[snap]: https://oss.sonatype.org/content/repositories/snapshots/dev/chrisbanes/accompanist/accompanist-glide/
[glide]: https://github.com/glide-kt/glide
[glide]: https://bumptech.github.io/glide/
4 changes: 4 additions & 0 deletions glide/build.gradle
Expand Up @@ -22,6 +22,10 @@ plugins {
id 'org.jetbrains.dokka'
}

kotlin {
explicitApi()
}

android {
compileSdkVersion 30

Expand Down
2 changes: 2 additions & 0 deletions mkdocs.yml
Expand Up @@ -15,9 +15,11 @@ repo_url: 'https://github.com/chrisbanes/accompanist'
nav:
- 'Overview': index.md
- 'Coil': coil.md
- 'Glide': glide.md
- 'Picasso': picasso.md
- 'API':
- 'Coil': api/coil/index.md
- 'Glide': api/glide/index.md
- 'Picasso': api/picasso/index.md
- 'Image Loading Core': api/imageloading-core/index.md
- 'Snapshots': using-snapshot-version.md
Expand Down

0 comments on commit 576a148

Please sign in to comment.