https://github.com/ackeecz/resizin-android-sdk
Library providing URL generator for Ackee's resizin.com image server
https://github.com/ackeecz/resizin-android-sdk
ackee-resizin android
Last synced: 11 days ago
JSON representation
Library providing URL generator for Ackee's resizin.com image server
- Host: GitHub
- URL: https://github.com/ackeecz/resizin-android-sdk
- Owner: AckeeCZ
- License: apache-2.0
- Created: 2018-04-23T12:47:24.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-06-14T15:06:08.000Z (over 2 years ago)
- Last Synced: 2025-02-25T07:47:19.087Z (8 months ago)
- Topics: ackee-resizin, android
- Language: Kotlin
- Size: 148 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[ ](https://maven-badges.herokuapp.com/maven-central/io.github.ackeecz/resizin-sdk)
# Resizin.com Android SDK
Library providing URL generator for Ackee's resizin.com image server
## Dependencies
```groovy
implementation 'io.github.ackeecz:resizin-sdk:x.x.x'
```
You can find latest version name in lib.properties or in the badge above## Usages
### Initialization```kotlin
val appId: String = ...
val resizin = Resizin(appId);
```### Url generator
Url generator has multiple options you can set. All of them are optional.
Values and meaning of Gravity and Crop options are available at https://github.com/AckeeCZ/resizin-android-sdk#examples
```kotlin
fun loadImage(imageId: String, img: ImageView) {
val url = resizin.url()
.width(img.getWidth())
.height(img.getHeight())
.gravity(Gravity.CENTER)
.crop(Crop.SE)
.grayscale(true)
.generate(imageId)
Picasso.with(context).load(url).into(img)
}
```### Parsing of urls
If you have full url, for example from server, and you want to parse it again to Resizin.UrlGenerator instance, you can do```kotlin
fun parseUrl(url: String) {
resizin.url()
.withUrl(url)
.background("#ffffff")
.generate()
}
```## License
Copyright 2021 Ackee, s.r.o.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 athttp://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.