Skip to content

Commit 059a8c2

Browse files
committed
fun setButtonText(text:String) added
1 parent ddb5319 commit 059a8c2

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

ProgressButton/src/main/java/com/shashifreeze/progressbutton/ProgressButton.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,9 @@ class ProgressButton @JvmOverloads constructor(
134134
buttonProgressbar?.animation = anim
135135
}
136136

137+
fun setButtonText(text:String)
138+
{
139+
buttonTextView?.text= text
140+
}
141+
137142
}

ProgressButton/src/main/java/com/shashifreeze/progressbutton/ProgressLoadingButton.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,9 @@ class ProgressLoadingButton @JvmOverloads constructor(
130130
buttonProgressbar?.animation = anim
131131
}
132132

133+
fun setButtonText(text:String)
134+
{
135+
buttonTextView?.text= text
136+
}
137+
133138
}

app/src/main/java/com/shashifreeze/progressbuttonlib/MainActivity.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ class MainActivity : AppCompatActivity() {
3030
plBtn.startProgress(bgColor = Color.YELLOW)
3131
Handler(mainLooper).postDelayed(
3232
{
33-
plBtn.stopProgress("Completed")
34-
33+
plBtn.stopProgress("Completed",Color.BLUE)
3534
}, 1000
3635
)
3736
}

app/src/main/res/layout/activity_main.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
app:plb_text_gravity = "1"
3333
app:plb_progress_color = "@color/black"
3434
app:plb_text_size = "6sp"
35-
app:plb_before_progress_text = "@string/app_name"
35+
app:plb_before_progress_text = "ProgressLoadingButton"
3636
android:layout_height="wrap_content" />
3737

3838
</LinearLayout>

0 commit comments

Comments
 (0)