Skip to content

Commit d2e6387

Browse files
committed
Added ability to disable the switch programmatically with setSwitchEnabled(boolean)
1 parent 643b21d commit d2e6387

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

expandablecardview/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apply plugin: 'kotlin-android-extensions'
55
ext {
66
PUBLISH_GROUP_ID = 'host.stjin'
77
PUBLISH_ARTIFACT_ID = 'expandable-cardview'
8-
PUBLISH_VERSION = '1.2.0-beta03'
8+
PUBLISH_VERSION = '1.2.0-beta04'
99
}
1010

1111
android {
@@ -14,7 +14,7 @@ android {
1414
defaultConfig {
1515
minSdkVersion 18
1616
targetSdkVersion 29
17-
versionCode 8
17+
versionCode 9
1818
versionName PUBLISH_VERSION
1919

2020
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

expandablecardview/src/main/java/host/stjin/expandablecardview/ExpandableCardView.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,10 @@ class ExpandableCardView @JvmOverloads constructor(context: Context, attrs: Attr
382382
card_switch.isChecked = boolean
383383
}
384384

385+
fun setSwitchEnabled(boolean: Boolean){
386+
card_switch.isEnabled = boolean
387+
}
388+
385389
private fun setInnerView(resId: Int) {
386390
card_stub.layoutResource = resId
387391
innerView = card_stub.inflate()

0 commit comments

Comments
 (0)