Skip to content

Commit c8ba6db

Browse files
committed
add attr
1 parent 7e4ecc1 commit c8ba6db

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

swipebottomview/src/main/java/id/co/edtslib/swipebottomview/SwipeBottomView.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ class SwipeBottomView: FrameLayout {
103103
TextViewCompat.setTextAppearance(tvTitle, textStyle)
104104
}
105105

106+
val backgroundColor = a.getColor(R.styleable.SwipeBottomView_backgroundColor, 0)
107+
if (backgroundColor != 0) {
108+
val slidingUpPanel = findViewById<View>(R.id.slidingUpPanel)
109+
slidingUpPanel.setBackgroundColor(backgroundColor)
110+
}
111+
106112
val contentPadding = a.getDimension(R.styleable.SwipeBottomView_contentPadding, -1f)
107113
if (contentPadding >= 0) {
108114
val clContent = findViewById<ConstraintLayout>(R.id.clContent)

swipebottomview/src/main/res/values/attrs.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
<attr name="bottom" format="reference" />
99
<attr name="initialHeightPct" format="float" />
1010
<attr name="contentPadding" format="dimension" />
11+
<attr name="backgroundColor" format="color" />
1112
</declare-styleable>
1213
</resources>

0 commit comments

Comments
 (0)