All Projects → Commit451 → coil-imagegetter

Commit451 / coil-imagegetter

Licence: other
Html.ImageGetter which uses Coil to load images

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to coil-imagegetter

libbra
A currency tracker app demonstration. It refreshes currency list every single second based on the main currency. In addition to that, main currency is selectable.
Stars: ✭ 45 (+150%)
Mutual labels:  coil
MovieBox
TMDb + Kotlin + Coroutines + Retrofit2 + Moshi + Clean Architecture + Koin 2 + Glide
Stars: ✭ 46 (+155.56%)
Mutual labels:  coil
ComposeMovie
Movie app that built with Jetpack Compose
Stars: ✭ 96 (+433.33%)
Mutual labels:  coil
Jetpack Kotlin Eyepetizer
一款基于Kotlin + Jetpack核心组件 + 协程 + 组件化实现的精美仿开眼视频App(提供Flutter、React Native、小程序版本 😁 )
Stars: ✭ 82 (+355.56%)
Mutual labels:  coil
WanAndroidMVVM
WanAndroid 客户端,采用 Kotlin 语言编写,项目使用 JetPack-MVVM 架构,采用 Retrofit + Coroutines + Coil 等开源框架开发。
Stars: ✭ 21 (+16.67%)
Mutual labels:  coil

coil-imagegetter

Loads images for Html rendering in Android using Coil

Dependency

Add this in your root build.gradle file (not your module build.gradle file):

allprojects {
	repositories {
		...
		maven { url "https://jitpack.io" }
	}
}

Then, add the library to your project build.gradle

dependencies {
    implementation("com.github.Commit451:CoilImageGetter:latest.version.here")
}

Usage

When rendering HTML, you will need to provide an Html.ImageGetter, which you can use CoilImageGetter or a subclass in order to load image references:

val imageGetter = CoilImageGetter(textView)
val html = ...
val spanned = Html.fromHtml(this, Html.FROM_HTML_MODE_LEGACY, imageGetter)
textView.text = spanned

For advanced usage, you can also specify your own ImageLoader and source modifier. See the class docs for more.

License

Copyright 2020 Commit 451

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].