单手控制图片 镜像、置顶、缩放、移动的贴纸控件项目地址:https://github.com/nimengbo/StickerView 效果图:如何使用:即如何创建贴纸(sticker):StickerView stickerView = new StickerView(this);//创建贴纸实例
stickerView.setImageResource(R.drawable.ic_cat);//设置贴纸上的图片
stickerView.setOperationListener(new StickerView.OperationListener() {
@Override
public void onDeleteClick() {//删除贴纸
System.out.println("stickerView:onDeleteClick");
mContentRootView.removeView(stickerView);
}
@Override
public void onEdit(StickerView stickerView) {//缩放贴纸
System.out.println("stickerView:onEdit");
}
@Override
public void onTop(StickerView stickerView) {//置顶贴纸
System.out.println("stickerView:onTop");
}
});
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
mContentRootView.addView(stickerView, lp);//添加到父容器中
2022-04-02 22:50:15
7.09MB
开源项目
1