mirror of
https://github.com/wasabeef/glide-transformations.git
synced 2025-10-04 18:03:21 +08:00
bump up 1.2.1
This commit is contained in:
@@ -75,7 +75,7 @@ public class MainAdapter extends RecyclerView.Adapter<MainAdapter.ViewHolder> {
|
||||
|
||||
@Override public void onBindViewHolder(MainAdapter.ViewHolder holder, int position) {
|
||||
switch (mDataSet.get(position)) {
|
||||
case Mask:
|
||||
case Mask: {
|
||||
int width = Utils.dip2px(mContext, 133.33f);
|
||||
int height = Utils.dip2px(mContext, 126.33f);
|
||||
Glide.with(mContext)
|
||||
@@ -85,9 +85,10 @@ public class MainAdapter extends RecyclerView.Adapter<MainAdapter.ViewHolder> {
|
||||
new MaskTransformation(mContext, R.drawable.mask_starfish))
|
||||
.into(holder.image);
|
||||
break;
|
||||
case NinePatchMask:
|
||||
width = Utils.dip2px(mContext, 150.0f);
|
||||
height = Utils.dip2px(mContext, 100.0f);
|
||||
}
|
||||
case NinePatchMask: {
|
||||
int width = Utils.dip2px(mContext, 150.0f);
|
||||
int height = Utils.dip2px(mContext, 100.0f);
|
||||
Glide.with(mContext)
|
||||
.load(R.drawable.check)
|
||||
.override(width, height)
|
||||
@@ -95,6 +96,7 @@ public class MainAdapter extends RecyclerView.Adapter<MainAdapter.ViewHolder> {
|
||||
new MaskTransformation(mContext, R.drawable.mask_chat_right))
|
||||
.into(holder.image);
|
||||
break;
|
||||
}
|
||||
case CropTop:
|
||||
Glide.with(mContext)
|
||||
.load(R.drawable.demo)
|
||||
|
@@ -20,8 +20,8 @@ import android.content.Context;
|
||||
|
||||
public class Utils {
|
||||
|
||||
public static int dip2px(Context context, float dp) {
|
||||
float scale = context.getResources().getDisplayMetrics().density;
|
||||
return (int) (dp * scale + 0.5f);
|
||||
}
|
||||
public static int dip2px(Context context, float dp) {
|
||||
float scale = context.getResources().getDisplayMetrics().density;
|
||||
return (int) (dp * scale + 0.5f);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user