1.Glide
说明:非常出名好用的图片加载框架
repositories {
mavenCentral()
google()
}
dependencies {
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
}
2.Luban
说明:Luban(鲁班) —— Android图片压缩工具,仿微信朋友圈压缩策略
implementation 'top.zibin:Luban:1.1.8'
3.uCrop
说明:图片裁剪
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
// lightweight general solution
compile 'com.github.yalantis:ucrop:2.2.2'
//get power of the native code to preserve image quality (+ about 1.5 MB to an apk size)
compile 'com.github.yalantis:ucrop:2.2.2-native'
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
UCrop.of(sourceUri, destinationUri)
.withAspectRatio(16, 9)
.withMaxResultSize(maxWidth, maxHeight)
.start(context);
网友评论