@@ -15,48 +15,23 @@ benefits while leveraging Firebase Storage's authenticated storage capabilities.
15
15
To load an image from a ` StorageReference ` , simply use the ` FirebaseImageLoader ` class:
16
16
17
17
``` java
18
- // Reference to an image file in Firebase Storage
19
- StorageReference storageReference = ... ;
18
+ // Reference to an image file in Firebase Storage
19
+ StorageReference storageReference = ... ;
20
20
21
- // ImageView in your Activity
22
- ImageView imageView = ... ;
21
+ // ImageView in your Activity
22
+ ImageView imageView = ... ;
23
23
24
- // Load the image using Glide
25
- Glide . with(this /* context */ )
26
- .using(new FirebaseImageLoader ())
27
- .load(storageReference)
28
- .into(imageView);
24
+ // Load the image using Glide
25
+ Glide . with(this /* context */ )
26
+ .using(new FirebaseImageLoader ())
27
+ .load(storageReference)
28
+ .into(imageView);
29
29
```
30
30
31
31
Images displayed using ` FirebaseImageLoader ` are cached by their path in Firebase Storage, so
32
32
repeated loads will be fast and conserve bandwidth. For more information on caching in Glide,
33
33
see [ this guide] [ glide-caching ] .
34
34
35
- ## Known Issues
36
-
37
- There is a bug in ` com.google.firebase:firebase-storage:9.6.1 ` and earlier that results in
38
- excessive logging when downloading images. You may see messages in your logs like this:
39
-
40
- ```
41
- W/StorageTask: unable to change internal state to: INTERNAL_STATE_IN_PROGRESS isUser: false from state:INTERNAL_STATE_SUCCESS
42
- ```
43
-
44
- In production this could slow your app down if you are downloading many images. The suggested
45
- workaround is to disable logging in production by adding the following lines to your
46
- ProGuard configuration (` proguard-rules.pro ` ):
47
-
48
- ```
49
- -assumenosideeffects class android.util.Log {
50
- public static int w(...);
51
- public static int d(...);
52
- public static int v(...);
53
- }
54
- ```
55
-
56
- This will disable calls to ` Log.w() ` , ` Log.d() ` , and ` Log.v() ` but preserve log calls at the
57
- ` INFO ` and ` ERROR ` levels. Note that this will only be effective when using
58
- ` proguard-android-optimize.txt ` as the default ProGuard file in ` build.gradle ` .
59
-
60
35
[ firebase-storage ] : https://firebase.google.com/docs/storage/
61
36
[ glide ] : https://github.com/bumptech/glide
62
37
[ storage-reference ] : https://firebase.google.com/docs/reference/android/com/google/firebase/storage/StorageReference
0 commit comments