Skip to content

Commit

Permalink
add rippleEnable property
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangdong.cheng committed Apr 9, 2019
1 parent 35878ad commit 53e445d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/src/main/java/com/dx/dxloadingbutton/DemoActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ class DemoActivity : AppCompatActivity(), View.OnClickListener {
loading_btn.cancelLoading()
startActivity(Intent(this@DemoActivity, LoginDemoActivity::class.java))
}
R.id.btn_enable -> loading_btn.isEnabled = !loading_btn.isEnabled
R.id.btn_enable -> {
loading_btn.isEnabled = !loading_btn.isEnabled
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ class LoadingButton @JvmOverloads constructor(
var animationEndAction: ((AnimationType) -> Unit)? = null

var rippleEnable = true
set(value) {
invalidate()
field = value
}

var rippleColor = Color.BLACK
set(value){
Expand Down Expand Up @@ -171,6 +175,7 @@ class LoadingButton @JvmOverloads constructor(
mTextColor = ta.getColor(R.styleable.LoadingButton_lb_textColor, Color.WHITE)
resetAfterFailed = ta.getBoolean(R.styleable.LoadingButton_lb_resetAfterFailed, true)
rippleColor = ta.getColor(R.styleable.LoadingButton_lb_btnRippleColor, Color.BLACK)
rippleEnable = ta.getBoolean(R.styleable.LoadingButton_lb_rippleEnable, true)
mRippleAlpha = ta.getFloat(R.styleable.LoadingButton_lb_btnRippleAlpha, 0.3f)
mButtonCorner = ta.getFloat(R.styleable.LoadingButton_lb_cornerRadius, 2 * mDensity)
ta.recycle()
Expand Down

0 comments on commit 53e445d

Please sign in to comment.