File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
kotlinyan-appcompat-support/src/main/kotlin/moe/feng/kotlinyan/common Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 11BUILD_TOOLS_VERSION =25.0.3
22org.gradle.jvmargs =-Xmx1536m
3- VERSION_NAME =0.1.4.2
3+ VERSION_NAME =0.1.5
44TARGET_SDK_VERSION =25
5- VERSION_CODE =2
5+ VERSION_CODE =3
66MIN_SDK_VERSION =19
Original file line number Diff line number Diff line change 11package moe.feng.kotlinyan.common
22
3+ import android.content.res.ColorStateList
34import android.support.design.widget.Snackbar
45import android.view.View
56
@@ -18,6 +19,8 @@ interface SupportDesignExtensions {
1819 var message : String? = null
1920 var messageRes : Int = 0
2021 var duration : Int = Snackbar .LENGTH_SHORT
22+ var actionTextColor : Int = - 1
23+ var actionTextColorStateList : ColorStateList ? = null
2124
2225 fun action (textRes : Int , callback : (View ) -> Unit ) {
2326 snackbar.setAction(textRes, callback)
@@ -33,6 +36,12 @@ interface SupportDesignExtensions {
3336 } else if (message != null ) {
3437 snackbar.setText(message!! )
3538 }
39+ if (actionTextColor != - 1 ) {
40+ snackbar.setActionTextColor(actionTextColor)
41+ } else if (actionTextColorStateList != null ) {
42+ snackbar.setActionTextColor(actionTextColorStateList!! )
43+ }
44+
3645 snackbar.duration = duration
3746 return snackbar
3847 }
You can’t perform that action at this time.
0 commit comments