You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
--- +++ @@ -31,7 +31,7 @@
Using the [``@GlideModule``][5] annotation requires a dependency on Glide's annotations:
```groovy
-compile 'com.github.bumptech.glide:annotations:4.2.0'+compile 'com.github.bumptech.glide:annotations:4.1.1'
```
#### Applications
@@ -55,8 +55,8 @@
Including Glide's annotation processor requires dependencies on Glide's annotations and the annotation processor:
```groovy
-compile 'com.github.bumptech.glide:annotations:4.2.0'-annotationProcessor 'com.github.bumptech.glide:compiler:4.2.0'+compile 'com.github.bumptech.glide:annotations:4.1.1'+annotationProcessor 'com.github.bumptech.glide:compiler:4.1.1'
```
Finally, you should keep AppGlideModule implementations in your ``proguard.cfg``:
@@ -193,7 +193,7 @@
.disallowHardwareBitmaps());
```
-[``RequestManager``][34] also has a [``setDefaultRequestOptions``][36] that will completely replace any default [``RequestOptions``][33] previously set either via the ``GlideBuilder`` in an [``AppGlideModule``][1] or via the [``RequestManager``][34]. Use caution with [``setDefaultRequestOptions``][36] because it's easy to accidentally override important defaults you've set elsewhere. Typically [``applyDefaultRequestOptions``][35] is safer and more intuitive to use.+[``RequestManager``][34] also has a [``setDefaultRequestOptions``][36] that will completely replace any default [``RequestOptions``][33] previously set either via the ``GlideBuilder`` in an [``AppGlideModule``][1] or via the [``RequestManager``][34]. Use caution with [``setDefaultRequestOptions``][36] because it's easy to accidentally override important defaults you've set elsewhere. Typically [``applyDefaultRequstOptions``][35] is safer and more intuitive to use.
#### UncaughtThrowableStrategy
--- +++ @@ -86,7 +86,7 @@
#### Excessively large allocations.
If opening a single page or loading a single image causes an OOM, your applications is probably loading an unnecessarily large image.
-The amount of memory required to display an image in a Bitmap is width * height * bytes per pixel. The number of bytes per pixel depends on the ``Bitmap.Config`` used to display the image, but typically four bytes per pixel are required for ``ARGB_8888`` Bitmaps. As a result, even a 1080p image requires 8mb of ram. The larger the image, the more ram required, so a 12 megapixel image requires a fairly massive 48mb.+The amount of memory required to display an image in a Bitmap is width * height * bytes per pixel. The number of bytes per pixel depends on the ``Bitmap.Config`` used to display the image, but typically four bytes per pixel are required for ``ARGB_8888`` Bitmaps. As a result, even a 080p image requires 8mb of ram. The larger the image, the more ram required, so a 12 megapixel image requires a fairly massive 48mb.
Glide will downsample images automatically based on the size provided by the ``Target``, ``ImageView`` or ``override()`` request option provided. If you're seeing excessively large allocations in Glide, usually that means that the size of your ``Target`` or ``override()`` is too large or you're using ``Target.SIZE_ORIGINAL`` in conjunction with a large image.
--- +++ @@ -97,7 +97,7 @@
### DecodeFormat
-In Glide v3, the default [``DecodeFormat``][30] was [``DecodeFormat.PREFER_RGB_565``][31], which used [``Bitmap.Config.RGB_565``][32] unless the image contained or might have contained transparent pixels. ``RGB_565`` uses half the memory of [``Bitmap.Config.ARGB_8888``][33] for a given image size, but it has noticeable quality issues for certain images, including banding and tinting. To avoid the quality issues with ``RGB_565``, Glide defaults to ``ARGB_8888``. As a result, image quality is higher, but memory usage may increase.+In Glide v3, the default [``DecodeFormat``][30] was [``DecodeFormat.PREFER_RGB_565``][31], which used [``Bitmap.Config.RGB_565``][32] unless the image contained or might have contained transparent pixels. ``RGB_565`` uses half the memory of [``Bitmap.Config.ARGB_8888``][33] for a given image size, but it has noticeable quality issues for certain images, including banding and tinting. To avoid the quality issues with ``RGB_565``, Glide defaults to ``ARGB_8888``. As a result, image quality is higher, but memory usage my increase.
To change Glide's default [``DecodeFormat``][30] back to [``DecodeFormat.PREFER_RGB_565``][31] in Glide v4, apply the ``RequestOption`` in an [``AppGlideModule``][2]:
@@ -111,7 +111,7 @@
}
```
-For more on using [``AppGlideModules``][2], see the [configuration page][4]. Note that you will have to make sure to add a dependency on Glide's annotation processor to ensure that Glide picks up your [``AppGlideModule``][2] implementation. For more information on how to set up the library, see the [download and setup page][34].+For more on using [``AppGlideModuless``][2], see the [configuration page][4]. Note that you will have to make sure to add a dependency on Glide's annotation processor to ensure that Glide picks up your [``AppGlideModule``][2] implementation. For more information on how to set up the library, see the [download and setup page][34].
### TransitionOptions
--- +++ @@ -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.2.0") {+compile ("com.github.bumptech.glide:recyclerview-integration:4.1.1") {
// Excludes the support library because it's already included by Glide.
transitive = false
}
@@ -70,7 +70,7 @@
The next step is to implement your [``PreloadModelProvider``][6]. The [``PreloadModelProvider``][6] performs two actions. First it collects and returns a list of ``Models`` (the items you pass in to Glide's ``load(Object)`` method, like URLs or file paths) for a given position. Second it takes a ``Model`` and produces a Glide ``RequestBuilder`` that will be used to preload the given ``Model`` into memory.
-For example, let's say that we have a ``RecyclerView`` that contains a list of image urls where each position in the ``RecyclerView`` displays a single URL. Then, let's say that you load your images in your ``RecyclerView.Adapter``'s ``onBindViewHolder`` method like this:+For example, let's say that we have a ``RecyclerView`` that contains a list of image urls where each position in the ``RecyclerView`` displays a single URL. Then, let's say that you load your images in your ``RecyclerView.Adapter``'s ``onBindViewHolderMethod`` like this:
```java
@@ -142,7 +142,7 @@
Glide.with(this), modelProvider, sizeProvider, 10 /*maxPreload*/);
```
-Using 10 for maxPreload is just a placeholder, for a detailed discussion on how to pick a number, see the section immediately below this one.+Using 10 for maxPreload is just a placeholder, for a detailed discussion on how to pick a unmber, see the section immediately below this one.
##### maxPreload
@@ -158,7 +158,7 @@
```java
RecyclerView myRecyclerView = (RecyclerView) findViewById(R.id.recycler_view);
-myRecyclerView.addOnScrollListener(preloader);+myRecyclerView.addOnScrolLListener(preloader);
```
Adding the [``RecyclerViewPreloader``][2] as a scroll listener allows the [``RecyclerViewPreloader``][2] to automatically load images ahead of the direction the user is scrolling in and detect changes of direction or velocity.
@@ -191,7 +191,7 @@
Glide.with(this), modelProvider, sizeProvider, 10 /*maxPreload*/);
RecyclerView myRecyclerView = (RecyclerView) result.findViewById(R.id.recycler_view);
- myRecyclerView.addOnScrollListener(preloader);+ myRecyclerView.addOnScrolLListener(preloader);
// Finish setting up your RecyclerView etc.
myRecylerView.setLayoutManager(...);
@@ -231,7 +231,7 @@
1. [FlickrPhotoGrid][12], uses a [``FixedPreloadSizeProvider``][5] to preload in the flickr sample's two smaller photo grid views.
2. [FlickrPhotoList][13] uses a [``ViewPreloadSizeProvider``][4] to preload in the flickr sample's larger list view.
-3. [MainActivity][14] in the Giphy sample uses a [``ViewPreloadSizeProvider``][4] to preload GIFs while scrolling.+3. [MainActivity][14] in the Giphy sample uses a [``ViewPreloadSizeProvider``][4] to preload gifs while scrolling.
4. [HorizontalGalleryFragment][15] in the Gallery sample uses a custom ``PreloadSizeProvider`` to preload local images while scrolling horizontally.
### Tips and tricks
--- +++ @@ -22,8 +22,6 @@
If all four steps fail to find the image, then Glide will go back to the original source to retrieve the data (the original File, Uri, Url etc).
-For details on default sizes and locations of Glide's caches or to configure those parameters, see the [configuration][24] page.-
### Cache Keys
In Glide 4, all cache keys contain at least two elements:
@@ -186,7 +184,7 @@
#### Memory Cache
-By default Glide's memory cache and [``BitmapPool``][18] respond to [``ComponentCallbacks2``][20] and automatically evict their contents to varying degrees depending on the level the framework provides. As a result, you typically don't need to try to dynamically monitor or clear your cache or [``BitmapPool``][18]. However, should the need arise, Glide does provide a couple of manual options.+By default Glide's memory cache and [``BitmapPool``][18] respond to [``ComponentCallbacks2``][20] and automatically evict their contents to varrying degrees depending on the level the framework provides. As a result, you typically don't need to try to dynamically monitor or clear your cache or [``BitmapPool``][18]. However, should the need arise, Glide does provide a couple of manual options.
##### Permanent size changes
@@ -242,6 +240,9 @@
}
}
```
+++
[1]: {{ site.baseurl }}/javadocs/400/com/bumptech/glide/request/RequestOptions.html#signature-com.bumptech.glide.load.Key-
[2]: {{ site.baseurl }}/javadocs/400/com/bumptech/glide/load/Option.html
概述
此 Issue 由 Sync Robot 自动创建,详情请参见 #6 。
本次扫描结果: 新增:0 , 修改: 10, 删除: 1。
文件变化列表
文件具体变更信息如下(仅展示UPDATED):
The text was updated successfully, but these errors were encountered: