Skip to content

Commit 1626937

Browse files
committed
set toggle text programmatically
1 parent 23c3d58 commit 1626937

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

switchsegmentedcontrol/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ android {
88
defaultConfig {
99
minSdkVersion 17
1010
targetSdkVersion 30
11-
versionCode 3
12-
versionName "1.0.2"
11+
versionCode 4
12+
versionName "1.0.3"
1313

1414
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
1515

switchsegmentedcontrol/src/main/java/com/zires/switchsegmentedcontrol/ZiresSwitchSegmentedControl.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,14 @@ open class ZiresSwitchSegmentedControl : LinearLayout {
174174
return transitionStart
175175
}
176176

177+
fun setRightToggleText(text: String) {
178+
switchFirstItem.text = text
179+
}
180+
181+
fun setLeftToggleText(text: String) {
182+
switchSecondItem.text = text
183+
}
184+
177185
private fun initOnClick() {
178186
transitionStart = true
179187
motionLayoutContainer.setOnClickListener {

0 commit comments

Comments
 (0)