public void setup(AttributeSet attrs) {
paint = new Paint(Paint.ANTI_ALIAS_FLAG);
paint.setStyle(Style.FILL);
paint.setStrokeCap(Cap.ROUND);
springSystem = SpringSystem.create();
spring = springSystem.createSpring();
spring.setSpringConfig(SpringConfig.fromOrigamiTensionAndFriction(50, 7));
this.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
toggle();
}
});
TypedArray typedArray = getContext().obtainStyledAttributes(attrs, R.styleable.IOSToggleButton);
offBorderColor = typedArray.getColor(R.styleable.IOSToggleButton_btnOffBorderColor, offBorderColor);
onColor = typedArray.getColor(R.styleable.IOSToggleButton_btnOnColor, onColor);
spotColor = typedArray.getColor(R.styleable.IOSToggleButton_btnSpotColor, spotColor);
offColor = typedArray.getColor(R.styleable.IOSToggleButton_btnOffColor, offColor);
borderWidth = typedArray.getDimensionPixelSize(R.styleable.IOSToggleButton_btnBorderWidth, borderWidth);
typedArray.recycle();
}
IOSToggleButton.java 文件源码
java
阅读 23
收藏 0
点赞 0
评论 0
项目:Incubators
作者:
评论列表
文章目录