chore: 更换依赖
This commit is contained in:
parent
43634f05c4
commit
a8fd662898
|
|
@ -1,7 +1,7 @@
|
|||
# <p align="center">Tieba Lite</p>
|
||||
<p align="center">
|
||||
<a href="https://circleci.com/gh/HuanCheng65/TiebaLite">
|
||||
<img alt="CircleCI" src="https://circleci.com/gh/HuanCheng65/TiebaLite.svg?style=svg">
|
||||
<img alt="CircleCI" src="https://build.appcenter.ms/v0.1/apps/11fb9a7c-fef2-4fd3-b150-167d30fc089d/branches/4.0-dev/badge">
|
||||
</a>
|
||||
<a href="#">
|
||||
<img alt="Status" src="https://img.shields.io/badge/%E7%8A%B6%E6%80%81-%EF%BC%9F%EF%BC%9F%EF%BC%9F-gray?style=flat-square&labelColor=gray&color=gray">
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ import com.huanchengfly.tieba.post.adapters.TranslucentThemeColorAdapter
|
|||
import com.huanchengfly.tieba.post.adapters.WallpaperAdapter
|
||||
import com.huanchengfly.tieba.post.api.LiteApi
|
||||
import com.huanchengfly.tieba.post.api.retrofit.doIfSuccess
|
||||
import com.huanchengfly.tieba.post.components.MyImageEngine
|
||||
import com.huanchengfly.tieba.post.components.MyLinearLayoutManager
|
||||
import com.huanchengfly.tieba.post.components.dividers.HorizontalSpacesDecoration
|
||||
import com.huanchengfly.tieba.post.components.transformations.BlurTransformation
|
||||
|
|
@ -52,6 +51,7 @@ import com.yanzhenjie.permission.Action
|
|||
import com.yanzhenjie.permission.runtime.Permission
|
||||
import com.zhihu.matisse.Matisse
|
||||
import com.zhihu.matisse.MimeType
|
||||
import com.zhihu.matisse.engine.impl.GlideEngine
|
||||
import kotlinx.coroutines.Dispatchers.IO
|
||||
import kotlinx.coroutines.launch
|
||||
import java.io.File
|
||||
|
|
@ -457,9 +457,9 @@ class TranslucentThemeActivity : BaseActivity(), View.OnClickListener, OnSeekBar
|
|||
}
|
||||
R.id.select_pic -> askPermission {
|
||||
Matisse.from(this)
|
||||
.choose(MimeType.ofImage())
|
||||
.theme(if (ThemeUtil.isNightMode(this)) R.style.Matisse_Dracula else R.style.Matisse_Zhihu)
|
||||
.imageEngine(MyImageEngine())
|
||||
.choose(MimeType.ofImage())
|
||||
.theme(if (ThemeUtil.isNightMode(this)) R.style.Matisse_Dracula else R.style.Matisse_Zhihu)
|
||||
.imageEngine(GlideEngine())
|
||||
.forResult(REQUEST_CODE_CHOOSE)
|
||||
}
|
||||
R.id.custom_color -> {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import com.bumptech.glide.Glide;
|
|||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.huanchengfly.tieba.post.R;
|
||||
import com.huanchengfly.tieba.post.activities.ReplyActivity;
|
||||
import com.huanchengfly.tieba.post.components.MyImageEngine;
|
||||
import com.huanchengfly.tieba.post.components.MyViewHolder;
|
||||
import com.huanchengfly.tieba.post.components.transformations.RadiusTransformation;
|
||||
import com.huanchengfly.tieba.post.models.PhotoInfoBean;
|
||||
|
|
@ -26,6 +25,7 @@ import com.yanzhenjie.permission.Action;
|
|||
import com.yanzhenjie.permission.runtime.Permission;
|
||||
import com.zhihu.matisse.Matisse;
|
||||
import com.zhihu.matisse.MimeType;
|
||||
import com.zhihu.matisse.engine.impl.GlideEngine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
|
@ -97,7 +97,7 @@ public class InsertPhotoAdapter extends RecyclerView.Adapter<MyViewHolder> {
|
|||
.countable(true)
|
||||
.maxSelectable(10 - fileList.size())
|
||||
.theme(ThemeUtil.isNightMode(mContext) ? R.style.Matisse_Dracula : R.style.Matisse_Zhihu)
|
||||
.imageEngine(new MyImageEngine())
|
||||
.imageEngine(new GlideEngine())
|
||||
.forResult(ReplyActivity.REQUEST_CODE_CHOOSE));
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,66 +0,0 @@
|
|||
package com.huanchengfly.tieba.post.components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.Priority;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.zhihu.matisse.engine.ImageEngine;
|
||||
|
||||
public class MyImageEngine implements ImageEngine {
|
||||
|
||||
@Override
|
||||
public void loadThumbnail(Context context, int resize, Drawable placeholder, ImageView imageView, Uri uri) {
|
||||
Glide.with(context)
|
||||
.asBitmap()
|
||||
.load(uri)
|
||||
.apply(new RequestOptions()
|
||||
.centerCrop()
|
||||
.placeholder(placeholder)
|
||||
.override(resize, resize))
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadGifThumbnail(Context context, int resize, Drawable placeholder, ImageView imageView,
|
||||
Uri uri) {
|
||||
Glide.with(context)
|
||||
.asBitmap()
|
||||
.load(uri)
|
||||
.apply(new RequestOptions()
|
||||
.placeholder(placeholder)
|
||||
.override(resize, resize)
|
||||
.centerCrop())
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadImage(Context context, int resizeX, int resizeY, ImageView imageView, Uri uri) {
|
||||
Glide.with(context)
|
||||
.load(uri)
|
||||
.apply(new RequestOptions()
|
||||
.override(resizeX, resizeY)
|
||||
.priority(Priority.HIGH)
|
||||
.fitCenter())
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadGifImage(Context context, int resizeX, int resizeY, ImageView imageView, Uri uri) {
|
||||
Glide.with(context)
|
||||
.asGif()
|
||||
.load(uri)
|
||||
.apply(new RequestOptions()
|
||||
.override(resizeX, resizeY)
|
||||
.priority(Priority.HIGH))
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportAnimatedGif() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue