DragAndDropListener.java 文件源码

java
阅读 29 收藏 0 点赞 0 评论 0

项目:droidar 作者:
private ImageView getImageView(View source, Activity activity,
        RelativeLayout c, LayoutParams params) {
    if (imageView == null) {
        final Bitmap bitmap = IO.loadBitmapFromView(source);
        final Paint shadowPaint = new Paint();
        shadowPaint.setAlpha(180);
        // http://stackoverflow.com/questions/7048941/how-to-use-the-lightingcolorfilter-to-make-the-image-form-dark-to-light
        shadowPaint.setColorFilter(new LightingColorFilter(0x11333333,
                0x00000000));

        imageView = new ImageView(activity) {

            @Override
            protected void onDraw(Canvas canvas) {
                // First draw shadow
                float dist = 2;
                canvas.drawBitmap(bitmap, dist, dist, shadowPaint);
                // then draw normal image view
                super.onDraw(canvas);
            }
        };
        imageView.setImageBitmap(bitmap);
        c.addView(imageView);
    }
    return imageView;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号