File tree Expand file tree Collapse file tree 3 files changed +27
-0
lines changed
java/br/com/simplepass/loadingbuttonsample
loading-button-android/src/main/java/br/com/simplepass/loadingbutton/utils Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ class MainActivity : AppCompatActivity() {
20
20
super .onCreate(savedInstanceState)
21
21
setContentView(R .layout.activity_main)
22
22
23
+ imgBtnTest0.run { setOnClickListener { morphDoneAndRevert(this @MainActivity) } }
24
+
23
25
imgBtnTest1.run { setOnClickListener { morphDoneAndRevert(this @MainActivity) } }
24
26
buttonTest1.run { setOnClickListener { morphDoneAndRevert(this @MainActivity) } }
25
27
Original file line number Diff line number Diff line change 16
16
android : paddingBottom =" @dimen/activity_vertical_margin"
17
17
tools : context =" br.com.simplepass.loadingbuttonsample.MainActivity" >
18
18
19
+ <TextView
20
+ android : layout_width =" match_parent"
21
+ android : layout_height =" wrap_content"
22
+ android : padding =" 8dp"
23
+ android : text =" Test 0" />
24
+
25
+ <br .com.simplepass.loadingbutton.customViews.CircularProgressButton
26
+ style =" @style/Widget.AppCompat.Button.Colored"
27
+ android : id =" @+id/imgBtnTest0"
28
+ android : layout_width =" match_parent"
29
+ android : layout_height =" 50dp"
30
+ android : layout_marginLeft =" 18dp"
31
+ android : layout_marginRight =" 18dp"
32
+ android : layout_marginBottom =" 10dp"
33
+ android : text =" Test 0"
34
+ app : finalCornerAngle =" 50dp"
35
+ app : initialCornerAngle =" 0dp"
36
+ app : spinning_bar_color =" #FFFFFF"
37
+ app : spinning_bar_padding =" 0dp"
38
+ app : spinning_bar_width =" 3dp" />
39
+
19
40
<TextView
20
41
android : layout_width =" match_parent"
21
42
android : layout_height =" wrap_content"
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import android.graphics.drawable.ColorDrawable
5
5
import android.graphics.drawable.Drawable
6
6
import android.graphics.drawable.GradientDrawable
7
7
import android.graphics.drawable.InsetDrawable
8
+ import android.graphics.drawable.LayerDrawable
8
9
import android.graphics.drawable.RippleDrawable
9
10
import android.graphics.drawable.StateListDrawable
10
11
import android.os.Build
@@ -42,6 +43,9 @@ internal fun parseGradientDrawable(drawable: Drawable): GradientDrawable =
42
43
throw RuntimeException (" Error reading background... Use a shape or a color in xml!" )
43
44
}
44
45
}
46
+ is LayerDrawable -> {
47
+ parseGradientDrawable(drawable.getDrawable(0 ))
48
+ }
45
49
else -> throw RuntimeException (" Error reading background... Use a shape or a color in xml!" )
46
50
}
47
51
You can’t perform that action at this time.
0 commit comments