@@ -139,7 +139,7 @@ class ComposeFragment : Fragment() {
139139 * Expand the recipient [chip] into a popup with a list of contact addresses to choose from.
140140 */
141141 private fun expandChip (chip : View ) {
142- val transform = MaterialContainerTransform ().apply {
142+ val transform = MaterialContainerTransform ().apply {
143143 startView = chip
144144 endView = binding.recipientCardView
145145 scrimColor = Color .TRANSPARENT
@@ -157,6 +157,7 @@ class ComposeFragment : Fragment() {
157157 // scrim) is clicked, or when the back button is pressed.
158158 binding.run {
159159 recipientCardView.setOnClickListener { collapseChip(chip) }
160+ recipientCardScrim.visibility = View .VISIBLE
160161 recipientCardScrim.setOnClickListener { collapseChip(chip) }
161162 }
162163 closeRecipientCardOnBackPressed.expandedChip = chip
@@ -173,7 +174,7 @@ class ComposeFragment : Fragment() {
173174 * Collapse the recipient card back into its [chip] form.
174175 */
175176 private fun collapseChip (chip : View ) {
176- val transform = MaterialContainerTransform ().apply {
177+ val transform = MaterialContainerTransform ().apply {
177178 startView = binding.recipientCardView
178179 endView = chip
179180 scrimColor = Color .TRANSPARENT
@@ -183,12 +184,8 @@ class ComposeFragment : Fragment() {
183184 addTarget(chip)
184185 }
185186
186- // Clear the scrim listener and on back pressed callbacks
187- binding.recipientCardScrim.run {
188- setOnClickListener { }
189- isClickable = false
190- isFocusable = false
191- }
187+ // Remove the scrim view and on back pressed callbacks
188+ binding.recipientCardScrim.visibility = View .GONE
192189 closeRecipientCardOnBackPressed.expandedChip = null
193190 closeRecipientCardOnBackPressed.isEnabled = false
194191
0 commit comments