diff --git a/generate_docs.sh b/generate_docs.sh index 993cf57cc..b8138cf38 100755 --- a/generate_docs.sh +++ b/generate_docs.sh @@ -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. @@ -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 @@ -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 diff --git a/glide/README.md b/glide/README.md index 52681a381..1459fe47f 100644 --- a/glide/README.md +++ b/glide/README.md @@ -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. -Glide logo +Glide logo ## `GlideImage()` @@ -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) }, ) ``` @@ -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 @@ -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/ diff --git a/glide/build.gradle b/glide/build.gradle index 97c92b708..609d35194 100644 --- a/glide/build.gradle +++ b/glide/build.gradle @@ -22,6 +22,10 @@ plugins { id 'org.jetbrains.dokka' } +kotlin { + explicitApi() +} + android { compileSdkVersion 30 diff --git a/mkdocs.yml b/mkdocs.yml index 1cdaf7ed9..3fe236944 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -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