Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

翻译文档同步计划-内容不一致 #29

Closed
GlideDocsCNBot opened this issue Jul 28, 2019 · 0 comments
Closed

翻译文档同步计划-内容不一致 #29

GlideDocsCNBot opened this issue Jul 28, 2019 · 0 comments

Comments

@GlideDocsCNBot
Copy link
Collaborator

概述

此 Issue 由 Sync Robot 自动创建,详情请参见 #6
本次扫描结果: 新增:0 , 修改: 18, 删除: 0

文件变化列表

变更类型 文件名
UPDATED 2017-05-10-recyclerview.md
UPDATED 2017-04-20-migrating.md
UPDATED 2017-05-20-snapshots.md
UPDATED 2017-12-05-custom-modelloader.md
UPDATED 2015-05-21-transformations.md
UPDATED 2017-05-10-okhttp3.md
UPDATED 2018-02-11-hardwarebitmaps.md
UPDATED 2015-05-17-options.md
UPDATED 2015-05-17-javadocs.md
UPDATED 2017-02-13-transitions.md
UPDATED 2017-05-10-volley.md
UPDATED 2017-04-17-generatedapi.md
UPDATED 2017-03-14-configuration.md
UPDATED 2015-05-17-getting-started.md
UPDATED 2015-05-19-placeholders.md
UPDATED 2017-05-10-about.md
UPDATED 2015-05-15-download-setup.md
UPDATED 2017-05-24-caching.md

文件具体变更信息如下(仅展示UPDATED):

--- 

+++ 

@@ -21,7 +21,7 @@

 To use the RecyclerView integration library, add a dependency on it in your ``build.gradle`` file:
 
 ```groovy
-compile ("com.github.bumptech.glide:recyclerview-integration:4.9.0") {
+compile ("com.github.bumptech.glide:recyclerview-integration:4.8.0") {
   // Excludes the support library because it's already included by Glide.
   transitive = false
 }
@@ -83,7 +83,7 @@

   ImageView imageView = ((MyViewHolder) viewHolder).imageView;
   String currentUrl = myUrls.get(position);
 
-  Glide.with(fragment)
+  GlideApp.with(fragment)
     .load(currentUrl)
     .override(imageWidthPixels, imageHeightPixels)
     .into(imageView);
@@ -112,7 +112,7 @@

   @Nullable
   RequestBuilder getPreloadRequestBuilder(String url) {
     return 
-      Glide.with(fragment)
+      GlideApp.with(fragment)
         .load(url) 
         .override(imageWidthPixels, imageHeightPixels);
   }
@@ -217,7 +217,7 @@

     @Nullable
     public RequestBuilder getPreloadRequestBuilder(String url) {
       return 
-        Glide.with(fragment)
+        GlideApp.with(fragment)
           .load(url) 
           .override(imageWidthPixels, imageHeightPixels);
     }
--- 

+++ 

@@ -82,6 +82,15 @@

 ```java
 Glide.with(fragment)
   .load(url)
+  .apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(20)))
+  .into(target);
+```
+
+Or with the [generated API][24]:
+
+```java
+GlideApp.with(fragment)
+  .load(url)
   .transforms(new CenterCrop(), new RoundedCorners(20))
   .into(target);
 ```
@@ -157,6 +166,32 @@

 ### Generated API
 
 To make it even easier to use Glide v4, Glide now also offers a generated API for Applications. Applications can access the generated API by including an appropriately annotated [``AppGlideModule``][2] implementation. See the [Generated API][11] page for details on how this works.
+
+The generated API adds a ``GlideApp`` class, that provides access to ``RequestBuilder`` and ``RequestOptions`` subclasses. The ``RequestOptions`` subclass contains all methods in ``RequestOptions`` and any methods defined in [``GlideExtensions``][12]. The ``RequestBuilder`` subclass provides access to all methods in the generated ``RequestOptions`` subclass without having to use ``apply``:
+
+A request without the generated API might look like this:
+
+```java
+Glide.with(fragment)
+    .load(url)
+    .apply(centerCropTransform()
+        .placeholder(R.drawable.placeholder)
+        .error(R.drawable.error)
+        .priority(Priority.HIGH))
+    .into(imageView);
+```
+
+With the generated API, the ``RequestOptions`` calls can be inlined:
+
+```java
+GlideApp.with(fragment)
+    .load(url)
+    .centerCrop()
+    .placeholder(R.drawable.placeholder)
+    .error(R.drawable.error)
+    .priority(Priority.HIGH)
+    .into(imageView);
+```
 
 You can still use the generated ``RequestOptions`` subclass to apply the same set of options to multiple loads, but generated ``RequestBuilder`` subclass may be more convenient in most cases.
 
--- 

+++ 

@@ -40,8 +40,8 @@

 
 ```gradle
 dependencies {
-  compile 'com.github.bumptech.glide:glide:4.10.0-SNAPSHOT'
-  compile 'com.github.bumptech.glide:okhttp-integration:4.10.0-SNAPSHOT'
+  compile 'com.github.bumptech.glide:glide:4.9.0-SNAPSHOT'
+  compile 'com.github.bumptech.glide:okhttp-integration:4.9.0-SNAPSHOT'
 }
 ```
 
@@ -73,12 +73,12 @@

 <dependency>
   <groupId>com.github.bumptech.glide</groupId>
   <artifactId>glide</artifactId>
-  <version>4.10.0-SNAPSHOT</version>
+  <version>4.9.0-SNAPSHOT</version>
 </dependency>
 <dependency>
   <groupId>com.github.bumptech.glide</groupId>
   <artifactId>okhttp-integration</artifactId>
-  <version>4.10.0-SNAPSHOT</version>
+  <version>4.9.0-SNAPSHOT</version>
 </dependency>
 ```
 
--- 

+++ 

@@ -400,7 +400,7 @@

 Don't forget to add a dependency on Glide's annotation processor to your build.gradle file as well:
 
 ```groovy
-annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
+annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
 ```
 
 Next we want to get at Glide's [``Registry``][23], so we'll implement the [``registerComponents``][24] method in our ``AppGlideModule``:
--- 

+++ 

@@ -26,15 +26,6 @@

 #### Default Transformations
 
 ```java
-Glide.with(fragment)
-  .load(url)
-  .fitCenter()
-  .into(imageView);
-```
-
-Or with `RequestOptions`:
-
-```java
 RequestOptions options = new RequestOptions();
 options.centerCrop();
 
@@ -44,6 +35,26 @@

     .into(imageView);
 ```
 
+Most built in transformations also have static imports for a more fluent API. For example, you can apply a [FitCenter][2] transformation using a static method:
+
+```java
+import static com.bumptech.glide.request.RequestOptions.fitCenterTransform;
+
+Glide.with(fragment)
+    .load(url)
+    .apply(fitCenterTransform())
+    .into(imageView);
+```
+
+If you're using the [generated API][16] the transformation methods are inlined, so it's even easier:
+
+```java
+GlideApp.with(fragment)
+  .load(url)
+  .fitCenter()
+  .into(imageView);
+```
+
 For more information on using RequestOptions, see the [Options][3] wiki page.
 
 #### Multiple Transformations.
@@ -51,19 +62,21 @@

 
 To instead apply multiple transformations to a single load, use the [``MultiTransformation``][18] class or the shortcut [``.transforms()``][19] method.
 
-```java
-Glide.with(fragment)
+With the [generated API][16]:
+
+```java
+GlideApp.with(fragment)
   .load(url)
   .transform(new MultiTransformation(new FitCenter(), new YourCustomTransformation())
   .into(imageView);
 ```
 
-Or with the shortcut method:
-
-```java
-Glide.with(fragment)
+Or with the shortcut method and the [generated API][16]:
+
+```java
+GlideApp.with(fragment)
   .load(url)
-  .transform(new FitCenter(), new YourCustomTransformation())
+  .transforms(new FitCenter(), new YourCustomTransformation())
   .into(imageView);
 ```
 
--- 

+++ 

@@ -17,7 +17,7 @@

 Then add a Gradle dependency on the OkHttp integration library:
 
 ```groovy
-compile "com.github.bumptech.glide:okhttp3-integration:4.9.0"
+compile "com.github.bumptech.glide:okhttp3-integration:4.8.0"
 ```
 
 Adding a Gradle dependency on the OkHttp integration library will cause Glide to start automatically using OkHttp to load all images from http and https urls.
--- 

+++ 

@@ -24,12 +24,24 @@

 In the long run Glide will load hardware `Bitmaps` by default and no changes will be needed to enable the format, only to disable it.
 
 ### How do we disable hardware Bitmaps?
-If you need to disable hardware `Bitmaps`, you should try to do so only for requests where you need to do one of the slow or broken things below. You can disable hardware `Bitmaps` for a particular request using [`disallowHardwareConfig()`][5]:
+If you need to disable hardware `Bitmaps`, you should try to do so only for requests where you need to do one of the slow or broken things below. You can disable hardware `Bitmaps` for a particular request using [`disallowHardwareConfig()`][5].
+
+If you’re using the generated API:
 
 ```java
+GlideApp.with(fragment)
+  .load(url)
+  .disallowHardwareConfig()
+  .into(imageView);
+```
+
+Or just via `RequestOptions`:
+
+```java
+RequestOptions options = new RequestOptions().disallowHardwareConfig();
 Glide.with(fragment)
   .load(url)
-  .disallowHardwareConfig()
+  .apply(options)
   .into(imageView);
 ```
 
--- 

+++ 

@@ -9,10 +9,10 @@

 * TOC
 {:toc}
 
-### RequestBuilder options
-Most options in Glide can be applied directly on the [``RequestBuilder``][1] object returned by `Glide.with()`
-
-Available options include (among others):
+### RequestOptions
+Most options in Glide can be applied using the [``RequestOptions``][1] class and the [``apply()``][2] method.
+
+Use request options to apply (among others):
 
 * Placeholders
 * Transformations
@@ -22,27 +22,38 @@

 For example, to apply a [``CenterCrop``][3] [``Transformation``][4], you'd use the following:
 
 ```java
-
-Glide.with(fragment)
+import static com.bumptech.glide.request.RequestOptions.centerCropTransform;
+
+Glide.with(fragment)
+    .load(url)
+    .apply(centerCropTransform(context))
+    .into(imageView);
+```
+
+Statically importing methods like ``centerCropTransform`` from ``RequestOptions`` allows for a simple fluent API.
+
+If you'd like to share options consistently in loads across different parts of your app, you can also instantiate a new ``RequestOptions`` object and pass it in to each load:
+
+```java
+RequestOptions cropOptions = new RequestOptions().centerCrop(context);
+...
+Glide.with(fragment)
+    .load(url)
+    .apply(cropOptions)
+    .into(imageView);
+```
+
+[``apply()``][2] can be called multiple times, so ``RequestOptions`` can be composed. If two ``RequestOptions`` objects contain conflicting settings, the last ``RequestOptions`` applied to the load will win.
+
+#### Generated API
+If you use the [generated API][16], all ``RequestOptions`` methods are inlined and can be used directly:
+
+```java
+GlideApp.with(fragment)
     .load(url)
     .centerCrop()
     .into(imageView);
 ```
-
-### RequestOptions
-
-If you'd like to share options consistently in loads across different parts of your app, you can also instantiate a new ``RequestOptions`` object and pass it in to each load with Athe [``apply()``][2] method.
-
-```java
-RequestOptions cropOptions = new RequestOptions().centerCrop(context);
-...
-Glide.with(fragment)
-    .load(url)
-    .apply(cropOptions)
-    .into(imageView);
-```
-
-[``apply()``][2] can be called multiple times, so ``RequestOptions`` can be composed. If two ``RequestOptions`` objects contain conflicting settings, the last ``RequestOptions`` applied to the load will win.
 
 ### TransitionOptions
 
@@ -119,9 +130,9 @@

 
 ```java
 RequestBuilder<Drawable> requestBuilder =
-    Glide.with(fragment)
-      .asDrawable()
-      .apply(requestOptions);
+        Glide.with(fragment)
+            .asDrawable()
+            .apply(requestOptions);
 
 for (int i = 0; i < numViews; i++) {
    ImageView view = viewGroup.getChildAt(i);
@@ -140,9 +151,8 @@

 ```java
 Glide.with(fragment)
   .load(url)
-  .thumbnail(
-    Glide.with(fragment)
-      .load(thumbnailUrl))
+  .thumbnail(Glide.with(fragment)
+    .load(thumbnailUrl))
   .into(imageView);
 ```
 
@@ -154,10 +164,9 @@

 int thumbnailSize = ...;
 Glide.with(fragment)
   .load(localUri)
-  .thumbnail(
-    Glide.with(fragment)
-      .load(localUri)
-      .override(thumbnailSize))
+  .thumbnail(Glide.with(fragment)
+    .load(localUri)
+    .override(thumbnailSize))
   .into(view);
 ```
 
@@ -176,9 +185,8 @@

 ```java
 Glide.with(fragment)
   .load(primaryUrl)
-  .error(
-      Glide.with(fragment)
-        .load(fallbackUrl))
+  .error(Glide.with(fragment)
+      .load(fallbackUrl))
   .into(imageView);
 ```
 
@@ -186,25 +194,37 @@

 
 ### Component Options
 
-The [``Option``][11] class is a generic way of adding parameters to Glide's components, including [``ModelLoaders``][12], [``ResourceDecoders``][13], [``ResourceEncoders``][14], [``Encoders``][15] etc. Some of Glide's built in components contain Options and Options can be added to custom components as well"
-
-```java
+The [``Option``][11] class is a generic way of adding parameters to Glide's components, including [``ModelLoaders``][12], [``ResourceDecoders``][13], [``ResourceEncoders``][14], [``Encoders``][15] etc. Some of Glide's built in components contain Options and Options can be added to custom components as well. 
+
+``Option``s are applied to requests using the ``RequestOptions`` class:
+
+```java
+import static com.bumptech.glide.request.RequestOptions.option;
+
 Glide.with(context)
   .load(url)
-  .option(MyCustomModelLoader.TIMEOUT_MS, 1000L)
+  .apply(option(MyCustomModelLoader.TIMEOUT_MS, 1000L))
   .into(imageView);
 ```
 
 You can also create a new RequestOptions object:
 
 ```java
-RequestOptions options = 
-    new RequestOptions()
-      .set(MyCustomModelLoader.TIMEOUT_MS, 1000L);
+RequestOptions options = new RequestOptions()
+  .set(MyCustomModelLoader.TIMEOUT_MS, 1000L);
 
 Glide.with(context)
   .load(url)
   .apply(options)
+  .into(imageView);
+```
+
+Or use the [generated API][16]:
+
+```java
+GlideApp.with(context)
+  .load(url)
+  .set(MyCustomModelLoader.TIMEOUT_MS, 1000L)
   .into(imageView);
 ```
 
--- 

+++ 

@@ -5,8 +5,7 @@

 date: 2015-05-17 17:38:22
 ---
 
-* [Glide 4.10.0-SNAPSHOT][13]
-* [Glide 4.9.0][12]
+* [Glide 4.9.0-SNAPSHOT][12]
 * [Glide 4.8.0][11]
 * [Glide 4.7.1][10]
 * [Glide 4.6.0][9]
@@ -31,5 +30,6 @@

 [10]:{{ site.baseurl }}{% link /javadocs/470/index.html %}
 [11]:{{ site.baseurl }}{% link /javadocs/480/index.html %}
 [12]:{{ site.baseurl }}{% link /javadocs/490/index.html %}
-[13]:{{ site.baseurl }}{% link /javadocs/4100/index.html %}
 
+
+
--- 

+++ 

@@ -43,26 +43,12 @@

 #### Cross fading with placeholders and transparent images
 Glide's default cross fade animation leverages [``TransitionDrawable``][8]. [``TransitionDrawable``][8] offers two animation modes, controlled by [``setCrossFadeEnabled()``][9]. When cross fades are disabled, the image that is transitioned to is faded in on top of the image that was already showing. When cross fades are enabled, the image that is being transitioned from is animated from opaque to transparent and the image that is being transitioned to is animated from transparent to opaque. 
 
-In Glide, we default to disabling cross fades because it typically provides a much nicer looking animation. An actual cross fade where the alpha of both images is changing at once often produces a white flash in the middle of the animation where both images are partially opaque.
+In Glide, we default to disabling cross fades because it typically provides a much nicer looking animation. An actual cross fade where the alpha of both images is changing at once often produces a white flash in the middle of the animation where both images are partially opaque. 
 
-Unfortunately although disabling cross fades is typically a better default, it can also lead to problems when the image that is being loaded contains transparent pixels. When the placeholder is larger than the image that is being loaded or the image is partially transparent, disabling cross fades results in the placeholder being visible behind the image after the animation finishes. If you are loading transparent images with placeholders, you can enable cross fades by adjusting the options in [``DrawableCrossFadeFactory``][10] and passing the result into [``transition()``][11]:
-
-```java
-DrawableCrossFadeFactory factory =
-        new DrawableCrossFadeFactory.Builder().setCrossFadeEnabled(true).build();
-
-GlideApp.with(context)
-        .load(url)
-        .transition(withCrossFade(factory))
-        .diskCacheStrategy(DiskCacheStrategy.ALL)
-        .placeholder(R.color.placeholder)
-        .into(imageView);
-```
-
-See [Issue #2017](https://github.com/bumptech/glide/issues/2017) for more information. Thanks @minas90 for writing down the example above.
+Unfortunately although disabling cross fades is typically a better default, it can also lead to problems when the image that is being loaded contains transparent pixels. When the placeholder is larger than the image that is being loaded or the image is partially transparent, disabling cross fades results in the placeholder being visible behind the image after the animation finishes. If you are loading transparent images with placeholders, you can enable cross fades by adjusting the options in [``DrawableCrossFadeFactory``][10] and passing the result into [``transition()``][11].
 
 #### Cross fading across requests.
-[``Transitions``][1] do not allow you to cross fade between two different images that are loaded with different requests. Glide by default will cancel any existing requests when you start a new load into an existing View or Target (See [Targets documentation][19] for more details). As a result, if you want to load two different images and cross fade between them, you cannot do so with Glide directly. Strategies like waiting for the first load to finish, grabbing a Bitmap or Drawable out of the View, starting a second load, and then manually animating between the Drawale or Bitmap and the new image are unsafe and may result in crashes or graphical corruption.
+[``Transitions``][1] do not allow you to cross fade between two different images that are loaded with different requests. Glide by default will cancel any existing requests when you start a new load into an existing View or Target (See [Targets documentation][19] for more details). As a result, if you want to load two different images and cross fade between them, you cannot do so with Glide directly. Strategies like waiting for the first load to finish, grabbing a Bitmap or Drawable out of the View, starting a second load, and then manually animating between the Drawale or Bitmap and the new image are unsafe and may result in crashes or graphical corruption. 
 
 Instead, the easiest way to cross fade across two different images loaded in two separate requests is to use [``ViewSwitcher``][2] containing two [``ImageViews``][3]. Load the first image into the result of [``getNextView()``][4]. Then load the second image into the next result of [``getNextView()``][4] and use a [``RequestListener``][5] to call [``showNext()``][6] when the second image load finishes. For better control, you can also follow the strategy outlined in the [developer documentation][7]. As with the [``ViewSwitcher``][2], only start the cross fade after the second image load finishes.
 
--- 

+++ 

@@ -17,7 +17,7 @@

 Then add a Gradle dependency on the Volley integration library:
 
 ```groovy
-compile "com.github.bumptech.glide:volley-integration:4.9.0"
+compile "com.github.bumptech.glide:volley-integration:4.8.0"
 ```
 
 Adding a Gradle dependency on the Volley integration library will cause Glide to start automatically using Volley to load images for all http and https urls.
--- 

+++ 

@@ -11,7 +11,7 @@

 
 ### About
 
-Glide v4 uses an [annotation processor][1] to generate an API that allows applications to extend Glide's API and include components provided by integration libraries.
+Glide v4 uses an [annotation processor][1] to generate an API that allows applications to access all options in [``RequestBuilder``][2], [``RequestOptions``][3] and any included integration libraries in a single fluent API.
 
 The generated API serves two purposes:
 1. Integration libraries can extend Glide's API with custom options.
@@ -39,7 +39,7 @@

    }
 
    dependencies {
-     annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
+     annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
    }
    ```
 
@@ -72,7 +72,7 @@

 
    ```groovy
    dependencies {
-     kapt 'com.github.bumptech.glide:compiler:4.9.0'
+     kapt 'com.github.bumptech.glide:compiler:4.8.0'
    }
    ```
   Note that you must also include the ``kotlin-kapt`` plugin in your ``build.gradle`` file:
@@ -85,7 +85,7 @@

    ```groovy
    dependencies {
      kapt "android.arch.lifecycle:compiler:1.0.0"
-     kapt 'com.github.bumptech.glide:compiler:4.9.0'
+     kapt 'com.github.bumptech.glide:compiler:4.8.0'
    }
    ```
 
@@ -145,10 +145,9 @@

 
   private MyAppExtension() { } // utility class
 
-  @NonNull
   @GlideOption
-  public static BaseRequestOptions<?> miniThumb(BaseRequestOptions<?> options) {
-    return options
+  public static void miniThumb(RequestOptions options) {
+    options
       .fitCenter()
       .override(MINI_THUMB_SIZE);
   }
@@ -160,7 +159,7 @@

 public class GlideOptions extends RequestOptions {
   
   public GlideOptions miniThumb() {
-    return (GlideOptions) MyAppExtension.miniThumb(this);
+    MyAppExtension.miniThumb(this);
   }
 
   ...
@@ -171,8 +170,8 @@

 
 ```java
 @GlideOption
-public static BaseRequestOptions<?> miniThumb(BaseRequestOptions<?> options, int size) {
-  return options
+public static void miniThumb(RequestOptions options, int size) {
+  options
     .fitCenter()
     .override(size);
 }
@@ -182,7 +181,7 @@

 
 ```java
 public GlideOptions miniThumb(int size) {
-  return (GlideOptions) MyAppExtension.miniThumb(this);
+  MyAppExtension.miniThumb(this);
 }
 ```
 
@@ -195,7 +194,7 @@

    .into(imageView);
 ```
 
-Methods with the ``GlideOption`` annotation are expected to be static and to return `BaseRequestOptions<?>`. Note that the generated methods will not be available on the standard ``Glide`` and ``RequestOptions`` classes, only the generated equivalents.
+Methods with the ``GlideOption`` annotation are expected to be static and to return void. Note that the generated methods will not be available on the standard ``Glide`` and ``RequestOptions`` classes.
 
 #### GlideType
 
@@ -208,10 +207,9 @@

 public class MyAppExtension {
   private static final RequestOptions DECODE_TYPE_GIF = decodeTypeOf(GifDrawable.class).lock();
 
-  @NonNull
   @GlideType(GifDrawable.class)
-  public static RequestBuilder<GifDrwable> asGif(RequestBuilder<GifDrawable> requestBuilder) {
-    return requestBuilder
+  public static void asGif(RequestBuilder<GifDrawable> requestBuilder) {
+    requestBuilder
       .transition(new DrawableTransitionOptions())
       .apply(DECODE_TYPE_GIF);
   }
@@ -223,8 +221,10 @@

 ```java
 public class GlideRequests extends RequesetManager {
 
-  public GlideRequest<GifDrawable> asGif() {
-    return (GlideRequest<GifDrawable> MyAppExtension.asGif(this.as(GifDrawable.class));
+  public RequestBuilder<GifDrawable> asGif() {
+    RequestBuilder<GifDrawable> builder = as(GifDrawable.class);
+    MyAppExtension.asGif(builder);
+    return builder;
   }
   
   ...
@@ -240,7 +240,7 @@

   .into(imageView);
 ```
 
-Methods annotated with ``GlideType`` must take a [``RequestBuilder<T>``][2] as their first argument where the type ``<T>`` matches the class provided to the [``GlideType``][8] annotation. Methods are expected to be static and return `RequestBuilder<T>`. Methods must be defined in a class annotated with [``GlideExtension``][6]. 
+Methods annotated with ``GlideType`` must take a [``RequestBuilder<T>``][2] as their first argument where the type ``<T>`` matches the class provided to the [``GlideType``][8] annotation. Methods are expected to be static and return void. Methods must be defined in a class annotated with [``GlideExtension``][6]. 
 
 
 [1]: https://docs.oracle.com/javase/8/docs/api/javax/annotation/processing/Processor.html
--- 

+++ 

@@ -10,19 +10,10 @@

 {:toc}
 
 ### Setup
-Starting in Glide 4.9.0, setup is required in a couple of cases.
-
-For applications, setup is only required if the application wants to:
-
-* Use one or more integration libraries
-* Change Glide's configuration (disk cache size/location, memory cache size etc)
-* Extend Glide's API 
-
-For libraries, setup is only required if the library wants to register one or more components.
+For Glide's configuration to work properly, libraries and applications need to perform a certain set of steps. Note that libraries that do not wish to register additional components are not required to do this.
 
 #### Applications
-Applications that wish to use integration libraries and/or Glide's API extensions must:
-
+Applications must:
 1. Add exactly one [``AppGlideModule``][1] implementation
 2. Optionally add one or more [``LibraryGlideModule``][2] implementations.
 3. Add the [``@GlideModule``][5] annotation to the [``AppGlideModule``][1] implementation and all [``LibraryGlideModule``][2] implementations.
@@ -42,8 +33,8 @@

 
 Including Glide's annotation processor requires dependencies on Glide's annotations and the annotation processor:
 ```groovy
-compile 'com.github.bumptech.glide:annotations:4.9.0'
-annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
+compile 'com.github.bumptech.glide:annotations:4.8.0'
+annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
 ```
 
 Finally, you should keep AppGlideModule implementations in your ``proguard.cfg``:
@@ -74,7 +65,7 @@

 
 Using the [``@GlideModule``][5] annotation requires a dependency on Glide's annotations:
 ```groovy
-compile 'com.github.bumptech.glide:annotations:4.9.0'
+compile 'com.github.bumptech.glide:annotations:4.8.0'
 ```
 
 ##### Avoid AppGlideModule in libraries
@@ -82,7 +73,7 @@

 
 In addition, if two libraries include ``AppGlideModule``s, applications will be unable to compile if they depend on both and will be forced to pick one or other other. 
 
-This does mean that libraries won't be able to use Glide's generated API, but loads with the standard `RequestBuilder` and `RequestOptions` will still work just fine (see the [options page][42] for examples).
+This does mean that libraries won't be able to use Glide's generated API, but loads with ``RequestOptions`` will still work just fine (see the [options page][42] for examples).
 
 ### Application Options
 Glide allows applications to use [``AppGlideModule``][1] implementations to completely control Glide's memory and disk cache usage. Glide tries to provide reasonable defaults for most applications, but for some applications, it will be necessary to customize these values. Be sure to measure the results of any changes to avoid performance regressions.
@@ -396,7 +387,7 @@

 Glide v4 relies on two classes, [``AppGlideModule``][1] and [``LibraryGlideModule``][2], to configure the Glide singleton. Both classes are allowed to register additional components, like [``ModelLoaders``][3], [``ResourceDecoders``][4] etc. Only the [``AppGlideModules``][1] are allowed to configure application specific settings, like cache implementations and sizes. 
 
 #### AppGlideModule
-All applications can optionally add a [``AppGlideModule``][1] implementation if the Application is implementing any methods in [``AppGlideModule``][1] or wants to use any integration libraries. The [``AppGlideModule``][1] implementation acts as a signal that allows Glide's annotation processor to generate a single combined class with with all discovered [``LibraryGlideModules``][2].
+All applications must add a [``AppGlideModule``][1] implementation, even if the Application is not changing any additional settings or implementing any methods in [``AppGlideModule``][1]. The [``AppGlideModule``][1] implementation acts as a signal that allows Glide's annotation processor to generate a single combined class with with all discovered [``LibraryGlideModules``][2].
 
 There can be only one [``AppGlideModule``][1] implementation in a given application (having more than one produce errors at compile time). As a result, libraries must never provide a [``AppGlideModule``][1] implementation. 
 
--- 

+++ 

@@ -27,40 +27,31 @@

 
 Although it's good practice to clear loads you no longer need, you're not required to do so. In fact, Glide will automatically clear the load and recycle any resources used by the load when the Activity or Fragment you pass in to [``Glide.with()``][1] is destroyed.
 
-### Customizing requests.
+### Applications
 
-Glide offers a variety of options that can be applied to individual requests, including transformations, transitions, caching options etc.
-
-Default options can be applied directly on a request:
+Applications can add an appropriately annotated [``AppGlideModule``][6] implementation to generate a fluent API that inlines most options, including those defined in integration libraries:
 
 ```java
-Glide.with(fragment)
-  .load(myUrl)
-  .placeholder(placeholder)
-  .fitCenter()
-  .into(imageView);
+package com.example.myapp;
+
+import com.bumptech.glide.annotation.GlideModule;
+import com.bumptech.glide.module.AppGlideModule;
+
+@GlideModule
+public final class MyAppGlideModule extends AppGlideModule {}
 ```
 
-Options can be shared across requests using the `RequestOptions` class:
+The API is generated in the same package as the [``AppGlideModule``][6] and is named ``GlideApp`` by default. Applications can use the API by starting all loads with ``GlideApp.with()`` instead of ``Glide.with()``:
 
 ```java
-RequestOptions sharedOptions = 
-    new RequestOptions()
-      .placeholder(placeholder)
-      .fitCenter();
-
-Glide.with(fragment)
-  .load(myUrl)
-  .apply(sharedOptions)
-  .into(imageView1);
-
-Glide.with(fragment)
-  .load(myUrl)
-  .apply(sharedOptions)
-  .into(imageView2);
+GlideApp.with(fragment)
+   .load(myUrl)
+   .placeholder(placeholder)
+   .fitCenter()
+   .into(imageView);
 ```
 
-Glide's API can be further extended to include custom options using Glide's [generated API][7] for advanced use cases.
+See Glide's [generated API page][7] for more information.
 
 ### ListView and RecyclerView
 
@@ -107,16 +98,10 @@

 ```java
 Glide.with(context
   .load(url)
-  .into(new CustomTarget<Drawable>() {
+  .into(new SimpleTarget<Drawable>() {
     @Override
     public void onResourceReady(Drawable resource, Transition<Drawable> transition) {
       // Do something with the Drawable here.
-    }
-
-    @Override
-    public void onLoadCleared(@Nullable Drawable placeholder) {
-      // Remove the Drawable provided in onResourceReady from any Views and ensure 
-      // no references to it remain.
     }
   });
 ```
--- 

+++ 

@@ -19,8 +19,10 @@

 #### Placeholder
 Placeholders are Drawables that are shown while a request is in progress. When a request completes successfully, the placeholder is replaced with the requested resource. If the requested resource is loaded from memory, the placeholder may never be shown. If the request fails and an error Drawable is not set, the placeholder will continue to be displayed. Similarly if the requested url/model is ``null`` and neither an error Drawable nor a fallback Drawable are set, the placeholder will also continue to be displayed.
 
+With the [generated API][4]:
+
 ```java
-Glide.with(fragment)
+GlideApp.with(fragment)
   .load(url)
   .placeholder(R.drawable.placeholder)
   .into(view);
@@ -29,7 +31,7 @@

 Or:
 
 ```java
-Glide.with(fragment)
+GlideApp.with(fragment)
   .load(url)
   .placeholder(new ColorDrawable(Color.BLACK))
   .into(view);
@@ -38,8 +40,10 @@

 #### Error
 Error Drawables are shown when a request permanently fails. Error Drawables are also shown if the requested url/model is ``null`` and no fallback Drawable is set
 
+With the [generated API][4]:
+
 ```java
-Glide.with(fragment)
+GlideApp.with(fragment)
   .load(url)
   .error(R.drawable.error)
   .into(view);
@@ -48,7 +52,7 @@

 Or:
 
 ```java
-Glide.with(fragment)
+GlideApp.with(fragment)
   .load(url)
   .error(new ColorDrawable(Color.RED))
   .into(view);
@@ -57,8 +61,10 @@

 #### Fallback
 Fallback Drawables are shown when the requested url/model is ``null``. The primary purpose of fallback Drawables is to allow users to indicate whether or not ``null`` is expected. For example, a ``null`` profile url may indicate that the user has not set a profile photo and that a default should be used. However, ``null`` may also indicate that meta-data is invalid or couldn't be retrieved. By default Glide treats ``null`` urls/models as errors, so users who expect ``null`` should set a fallback Drawable.
 
+With the [generated API][4]:
+
 ```java
-Glide.with(fragment)
+GlideApp.with(fragment)
   .load(url)
   .fallback(R.drawable.fallback)
   .into(view);
@@ -67,7 +73,7 @@

 Or:
 
 ```java
-Glide.with(fragment)
+GlideApp.with(fragment)
   .load(url)
   .fallback(new ColorDrawable(Color.GREY))
   .into(view);
@@ -89,3 +95,4 @@

 [1]: {{ site.baseurl }}/javadocs/400/com/bumptech/glide/request/RequestOptions.html#placeholder-int-
 [2]: {{ site.baseurl }}/javadocs/400/com/bumptech/glide/request/RequestOptions.html#error-int-
 [3]: {{ site.baseurl }}/javadocs/400/com/bumptech/glide/request/RequestOptions.html#fallback-int-
+[4]: generatedapi.html
--- 

+++ 

@@ -45,13 +45,13 @@

 
 ```groovy
 implementation com.squareup.okhttp3:okhttp:3.9.1
-implementation com.github.bumptech.glide:okhttp-integration:4.9.0
+implementation com.github.bumptech.glide:okhttp-integration:4.8.0
 ```
 
 For more control, you can also exclude the OkHttp from the transitive dependencies of the ``okhttp-integration`` library:
 
 ```groovy
-implementation (com.github.bumptech.glide:okhttp-integration:4.9.0) {
+implementation (com.github.bumptech.glide:okhttp-integration:4.8.0) {
   exclude group: com.squareup.okhttp3, module: okhttp
 }
 ```
@@ -59,7 +59,7 @@

 Or you could simply exclude all transitive dependencies of the ``okhttp-integration`` library:
 
 ```groovy
-implementation (com.github.bumptech.glide:okhttp-integration:4.9.0) {
+implementation (com.github.bumptech.glide:okhttp-integration:4.8.0) {
   transitive = false
 }
 ```
--- 

+++ 

@@ -20,7 +20,7 @@

 
 ```groovy
 dependencies {
-  implementation ("com.github.bumptech.glide:glide:4.9.0") {
+  implementation ("com.github.bumptech.glide:glide:4.8.0") {
     exclude group: "com.android.support"
   }
   implementation "com.android.support:support-fragment:26.1.0"
@@ -57,9 +57,8 @@

 }
 
 dependencies {
-    compile 'com.github.bumptech.glide:glide:4.9.0'
-    // Skip this if you don't want to use integration libraries or configure Glide.
-    annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
+    compile 'com.github.bumptech.glide:glide:4.8.0'
+    annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
 }
 ```
 
@@ -67,7 +66,7 @@

 
 ```groovy
 dependencies {
-    implementation ("com.github.bumptech.glide:glide:4.9.0@aar") {
+    implementation ("com.github.bumptech.glide:glide:4.8.0@aar") {
         transitive = true
     }
 }
@@ -99,7 +98,7 @@

 <dependency>
   <groupId>com.github.bumptech.glide</groupId>
   <artifactId>glide</artifactId>
-  <version>4.9.0</version>
+  <version>4.8.0</version>
   <type>aar</type>
 </dependency>
 <dependency>
@@ -110,7 +109,7 @@

 <dependency>
   <groupId>com.github.bumptech.glide</groupId>
   <artifactId>compiler</artifactId>
-  <version>4.9.0</version>
+  <version>4.8.0</version>
   <optional>true</optional>
 </dependency>
 ```
@@ -235,7 +234,7 @@

 
 ```groovy
 dependencies {
-  kapt 'com.github.bumptech.glide:compiler:4.9.0'
+  kapt 'com.github.bumptech.glide:compiler:4.8.0'
 }
 ```
 Note that you must also include the ``kotlin-kapt`` plugin in your ``build.gradle`` file:
--- 

+++ 

@@ -28,12 +28,12 @@

 
 In Glide 4, all cache keys contain at least two elements:
 
-1. The model the load is requested for (File, Uri, Url). If you are using a custom model, it needs to correctly implements ``hashCode()`` and ``equals()``
+1. The model the load is requested for (File, Uri, Url) (If you are using a custom model, it needs to correctly implements ``hashCode()`` and ``equals()``
 2. An optional [``Signature``][1]
 
 In fact, the cache keys for steps 1-3 (Active resources, memory cache, resource disk cache) also include a number of other pieces of data including:
 
-1. The width and height
+1. The width and height 
 2. The optional ``Transformation``
 3. Any added [``Options``][2]
 4. The requested data type (Bitmap, GIF, etc)
@@ -55,7 +55,7 @@

 To apply a [``DiskCacheStrategy``][10]:
 
 ```java
-Glide.with(fragment)
+GlideApp.with(fragment)
   .load(url)
   .diskCacheStrategy(DiskCacheStrategy.ALL)
   .into(imageView);
@@ -66,7 +66,7 @@

 In some circumstances you may want a load to fail if an image is not already in cache. To do so, you can use the [``onlyRetrieveFromCache``][8] method on a per request basis:
 
 ```java
-Glide.with(fragment)
+GlideApp.with(fragment)
   .load(url)
   .onlyRetrieveFromCache(true)
   .into(imageView);
@@ -81,7 +81,7 @@

 To skip the memory cache only, use [``skipMemoryCache()``][15]:
 
 ```java
-Glide.with(fragment)
+GlideApp.with(fragment)
   .load(url)
   .skipMemoryCache(true)
   .into(view);
@@ -90,7 +90,7 @@

 To skip the disk cache only, use [``DiskCacheStrategy.NONE``][16]:
 
 ```java
-Glide.with(fragment)
+GlideApp.with(fragment)
   .load(url)
   .diskCacheStrategy(DiskCacheStrategy.NONE)
   .into(view);
@@ -99,7 +99,7 @@

 These options can be used together:
 
 ```java
-Glide.with(fragment)
+GlideApp.with(fragment)
   .load(url)
   .diskCacheStrategy(DiskCacheStrategy.NONE)
   .skipMemoryCache(true)
@@ -129,7 +129,7 @@

 Passing in signatures to loads is simple:
 
 ```java
-Glide.with(yourFragment)
+GlideApp.with(yourFragment)
     .load(yourFileDataModel)
     .signature(new ObjectKey(yourVersionMetadata))
     .into(yourImageView);
@@ -137,7 +137,7 @@

 
 The media store signature is also straightforward data from the MediaStore:
 ```java
-Glide.with(fragment)
+GlideApp.with(fragment)
     .load(mediaStoreUri)
     .signature(new MediaStoreSignature(mimeType, dateModified, orientation))
     .into(view);
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant