https://github.com/dsiner/cache
Cache ——Level 3 cache(memory, sdcard, network), abstract asynchronous time-consuming operation for any object, main thread callback, chained call. Get the first frame of the video, audio duration, imageloader, image compress; 3级缓存(内存, 本地, 网络), 针对任意对象,抽象异步耗时操作,主线程回调,链式调用. 获取视频第一帧/缩略图,音频时长, 图片加载,图片压缩等
https://github.com/dsiner/cache
cache cache-control cache-storage duration imagecompress imageloader thumbnail
Last synced: about 1 month ago
JSON representation
Cache ——Level 3 cache(memory, sdcard, network), abstract asynchronous time-consuming operation for any object, main thread callback, chained call. Get the first frame of the video, audio duration, imageloader, image compress; 3级缓存(内存, 本地, 网络), 针对任意对象,抽象异步耗时操作,主线程回调,链式调用. 获取视频第一帧/缩略图,音频时长, 图片加载,图片压缩等
- Host: GitHub
- URL: https://github.com/dsiner/cache
- Owner: Dsiner
- License: apache-2.0
- Created: 2017-10-23T05:58:13.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-08-10T08:36:51.000Z (over 4 years ago)
- Last Synced: 2025-05-21T13:14:35.440Z (9 months ago)
- Topics: cache, cache-control, cache-storage, duration, imagecompress, imageloader, thumbnail
- Homepage:
- Size: 906 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README-zh.md
- License: LICENSE
Awesome Lists containing this project
README
# Cache for Android
[](https://www.apache.org/licenses/LICENSE-2.0)
[](https://android-arsenal.com/api?level=10)
> 3级缓存( `内存`, `本地`, `网络` ) ——针对任意对象,抽象异步耗时操作,主线程回调,链式调用
## Demo
## Implementation list
- [x] `FrameCache` - 获取本地或网络视频第一帧和时长
- [x] `DurationCache` - 获取本地或网络音频时长
- [x] `ImageCache` - 获取本地或网络图片
## Usage
```java
FrameCache.with(context).load(url).placeholder(R.color.colorAccent).into(view);
DurationCache.with(context).load(url).placeholder(0L).into(view);
ImageCache.with(context).load(url).into(ivImage);
...
```
More usage see [Demo](app/src/main/java/com/d/cache/MainActivity.java)
## Licence
```txt
Copyright 2017 D
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```