1
0
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:
wasabeef
2015-09-18 15:32:51 +09:00
parent 113200de55
commit 4629d5e375
4 changed files with 12 additions and 10 deletions

View File

@@ -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)

View File

@@ -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);
}
}