1 Star 2 Fork 0

Arcns / glide-extension

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

glide-extension

English | 中文

Introduction

Glide extension project

  • progress:Glide loading progress monitoring callback
  • sample:Use Cases

Integration tutorial

allprojects {
	repositories {
		...
		maven { url 'https://www.jitpack.io' }
	}
}
dependencies {
	 implementation 'com.github.bumptech.glide:glide:4.11.0'
	 implementation "com.github.bumptech.glide:okhttp3-integration:4.11.0"
	 implementation 'com.gitee.arcns:glide-extension:Tag'
}

Use tutorial

  • Kotlin
Glide.with(this)
            .loadWithProgress(
                context = this,// Context
                networkUrl = "https://data.1freewallpapers.com/download/surreal-landscape-4k.jpg", // Picture network address
                progressBar = binding.pbTest, // Progress bar, can be empty
                progressTextView = binding.tvTest,// Progress text view(x%), can be empty
                lifecycleOwner = this,// Life cycle awareness, automatically release monitoring at the end of the life cycle, can be empty
                listener = object : com.arcns.glide.grogress.GlideProgressListener<Drawable>() {
                    override fun onProgress(current: Long, total: Long, percent: Float) {
                        Log.e("GlideProgress", "current:$current,total:$total,percent:$percent")
                    }
                } // Progress monitoring callback, can be empty
            )
            .skipMemoryCache(true)
            .diskCacheStrategy(DiskCacheStrategy.NONE)
            .into(binding.ivTest)
  • Java
 GlideProgressExtensionKt.loadWithProgress(
                Glide.with(context), // Glide RequestManager或RequestBuilder
                context, // Context
                "", // Picture network address
                new GlideProgressListener<Drawable>() {
                    @Override
                    public void onProgress(long current, long total, float percent) {

                    }
                }, // Progress monitoring callback, can be empty
                null, // Life cycle awareness, automatically release monitoring at the end of the life cycle, can be empty
                null, //  Progress bar, can be empty
                null // Progress text view(x%), can be empty
        ).into(imageView);

Comments ( 0 )

Sign in for post a comment

About

Glide扩展项目,实现Glide加载进度监听回调 spread retract
Android
MulanPSL-2.0
Cancel

Releases (5)

All
0.4

Gitee Metrics

Contributors

All

Activities

load more
can not load any more
Android
1
https://gitee.com/arcns/glide-extension.git
git@gitee.com:arcns/glide-extension.git
arcns
glide-extension
glide-extension
master

Search