File tree Expand file tree Collapse file tree
java/com/github/nikartm/stripedprocessbutton Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ android {
2727 targetCompatibility rootProject. ext. javaVersion
2828 sourceCompatibility rootProject. ext. javaVersion
2929 }
30+
31+ buildFeatures {
32+ viewBinding = true
33+ }
3034}
3135
3236dependencies {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ package com.github.nikartm.stripedprocessbutton
2+
3+ import android.os.Bundle
4+ import androidx.appcompat.app.AppCompatActivity
5+ import com.github.nikartm.stripedprocessbutton.databinding.ActivityMainBinding
6+
7+ class MainActivity : AppCompatActivity () {
8+
9+ private lateinit var binding: ActivityMainBinding
10+
11+ override fun onCreate (savedInstanceState : Bundle ? ) {
12+ super .onCreate(savedInstanceState)
13+ binding = ActivityMainBinding .inflate(layoutInflater)
14+ setContentView(binding.root)
15+ bindView()
16+ }
17+
18+ private fun bindView () = with (binding) {
19+ initStartStripedButton()
20+ btnStart.setOnClickListener {
21+ btnStart.start()
22+ btn2.start()
23+ btn3.start()
24+ btn4.start()
25+ }
26+ btnStop.setOnClickListener {
27+ btnStart.stop()
28+ btn2.stop()
29+ btn3.stop()
30+ btn4.stop()
31+ }
32+ }
33+
34+ private fun initStartStripedButton () = with (binding.btnStart) {
35+ text = " Start process"
36+ setCornerRadius(50f )
37+ setStripeAlpha(0.7f )
38+ setStripeRevert(true )
39+ setStripeGradient(false )
40+ setTilt(15f )
41+ }
42+ }
Original file line number Diff line number Diff line change 22<shape xmlns : android =" http://schemas.android.com/apk/res/android"
33 android : shape =" rectangle" >
44
5- <solid android : color =" #FF9800 " />
5+ <solid android : color =" #F44336 " />
66 <corners android : radius =" 24dp" />
77
88</shape >
You can’t perform that action at this time.
0 commit comments