| | |
| | |
|
| | | import cn.com.basic.face.discern.query.item.CheckInQueryItem;
|
| | | import cn.com.basic.face.util.AppApi;
|
| | | import cn.com.basic.face.util.BitmapUtil;
|
| | |
|
| | | public class CheckInRightVisitorCell extends LinearLayout{
|
| | |
|
| | |
|
| | | @ViewInject(R.id.fragment_check_in_right_visitor_cell_name)
|
| | | private TextView fragment_check_in_right_visitor_cell_name;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public Bitmap getCroppedBitmap(Bitmap bitmap) {
|
| | | Bitmap output = Bitmap.createBitmap(bitmap.getWidth(),
|
| | | bitmap.getHeight(), Bitmap.Config.ARGB_8888);
|
| | | Canvas canvas = new Canvas(output);
|
| | |
|
| | | final int color = 0xff424242;
|
| | | final Paint paint = new Paint();
|
| | | final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
|
| | |
|
| | | paint.setAntiAlias(true);
|
| | | canvas.drawARGB(0, 0, 0, 0);
|
| | | paint.setColor(color);
|
| | | // canvas.drawRoundRect(rectF, roundPx, roundPx, paint);
|
| | | canvas.drawCircle(bitmap.getWidth() / 2, bitmap.getHeight() / 2,
|
| | | bitmap.getWidth() / 2, paint);
|
| | | paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
|
| | | canvas.drawBitmap(bitmap, rect, rect, paint);
|
| | | //Bitmap _bmp = Bitmap.createScaledBitmap(output, 60, 60, false);
|
| | | //return _bmp;
|
| | | return output;
|
| | | }
|
| | |
|
| | | public void setPhoto(Bitmap photo) {
|
| | |
|
| | | fragment_check_in_right_visitor_cell_photo.setImageBitmap(getCroppedBitmap(photo));
|
| | | fragment_check_in_right_visitor_cell_photo.setImageBitmap(BitmapUtil.getCroppedBitmap(photo));
|
| | | fragment_check_in_right_visitor_cell_photo_placeholder.setVisibility(INVISIBLE);
|
| | | }
|
| | |
|
| | | public CheckInQueryItem getVisitor() {
|