File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 30
30
31
31
- Create an application class and initialize the cache in the onCreate() method.
32
32
33
+ ``` kotlin
33
34
import android.app.Application
34
35
import com.arcane.coldstoragecache.cache.Cache
35
36
41
42
}
42
43
43
44
}
45
+ ```
44
46
45
47
- Register your application in the android manifest file by providing the ** android: name ** attribute
46
48
47
- ```
49
+ ``` xml
48
50
<application
49
51
android : allowBackup =" true"
50
52
android : icon =" @mipmap/ic_launcher"
59
61
## @Refrigerate Annotation
60
62
Annotate your functions using this to keep the output of the function in the cache for a given set of inputs .
61
63
64
+ ### For releases > 2.1.0
65
+
66
+ Now you can use @CacheKey annotation to declare parameters as the keys of the cache
67
+
68
+ ``` kotlin
69
+ @Refrigerate(timeToLive : 2000 , operation = " cacheImage" )
70
+ fun downloadImage (@CacheKey url : String , @CacheKey someOtherVariable : String , variableThatIsNotAKey : String ) : Bitmap {
71
+ .... .
72
+ }
73
+ ```
74
+
62
75
Usage:-
63
76
64
77
``` kotlin
You can’t perform that action at this time.
0 commit comments