@@ -61,6 +61,12 @@ class ListItem @JvmOverloads constructor(
61
61
leadingViewContainerFrameLayout.setChildAndUpdateVisibility(value)
62
62
}
63
63
64
+ var leadingViewIsVisible: Boolean
65
+ get() = leadingViewContainerFrameLayout.isVisible
66
+ set(value) {
67
+ leadingViewContainerFrameLayout.updateVisibility(value)
68
+ }
69
+
64
70
var headlineText: CharSequence?
65
71
get() = headlineTextView.text
66
72
set(value) {
@@ -91,6 +97,12 @@ class ListItem @JvmOverloads constructor(
91
97
trailingViewContainerFrameLayout.setChildAndUpdateVisibility(value)
92
98
}
93
99
100
+ var trailingViewIsVisible: Boolean
101
+ get() = trailingViewContainerFrameLayout.isVisible
102
+ set(value) {
103
+ leadingViewContainerFrameLayout.updateVisibility(value)
104
+ }
105
+
94
106
init {
95
107
inflate(context, R .layout.list_item, this )
96
108
@@ -103,6 +115,7 @@ class ListItem @JvmOverloads constructor(
103
115
}?.let {
104
116
setLeadingView(it)
105
117
}
118
+ leadingViewIsVisible = getBoolean(R .styleable.ListItem_leadingViewIsVisible , true )
106
119
headlineText = getString(R .styleable.ListItem_headlineText )
107
120
supportingText = getString(R .styleable.ListItem_supportingText )
108
121
trailingIconImage = getDrawable(R .styleable.ListItem_trailingIconImage )
@@ -112,6 +125,7 @@ class ListItem @JvmOverloads constructor(
112
125
}?.let {
113
126
setTrailingView(it)
114
127
}
128
+ trailingViewIsVisible = getBoolean(R .styleable.ListItem_trailingViewIsVisible , true )
115
129
} finally {
116
130
recycle()
117
131
}
0 commit comments