·您现在的位置: 云翼网络 >> 文章中心 >> 网站建设 >> app软件开发 >> Android开发 >> 超酷炫的Android碎纸机效果推荐

超酷炫的Android碎纸机效果推荐

作者:佚名      Android开发编辑:admin      更新时间:2022-07-23

在Android开发中,有时候可能会要用到碎纸机的效果,今天小编为大家整理好代码,一起来看看吧。

首先来看下效果图

实例代码

xml

<com.ldoublem.PaperShredderlib.PaperShredderView
  android:layout_width="200dp"
  android:id="@+id/ps_delete2"
  android:layout_height="220dp"
  paper:sherderBgColor="#f4c600"
  paper:sherderText="清理中"
  paper:sherderType="0"
  paper:sherderPaperEnterColor="#56abe4"
  paper:sherderTextShadow="false"
  paper:sherderTextColor="#99101010"
  paper:sherderPaperColor="#dbdbdb"
  paper:sherderProgress="false"
  />

java

mPaperShredderView.setShrededType(PaperShredderView.SHREDEDTYPE.Piece);//纸片效果和纸条效果
  mPaperShredderView.setSherderProgress(false);
  mPaperShredderView.setTitle("清除数据");
  mPaperShredderView.setTextColor(Color.BLACK);
  mPaperShredderView.setPaperColor(Color.BLACK);
  mPaperShredderView.setBgColor(Color.WHITE);
  mPaperShredderView.setTextShadow(false);
  mPaperShredderView.setPaperEnterColor(Color.BLACK);
  mPaperShredderView.startAnim(1000);
  mPaperShredderView.stopAnim();

学会利用上面的两段代码,Android开发者就可以轻松实现碎纸机的动画效果,希望本文对大家的学习有所帮助,谢谢大家支持脚本之家。