Privacy Masking - XML Views
Mark sensitive Views on their owning UI thread, before exposing sensitive content. A marked View is masked in UI captures and excluded from automatic Screen Text collection.
- Kotlin API
- Kotlin extension
- Java
import ai.coryn.replay.api.core.main.Coryn
import ai.coryn.replay.shared.uicapture.CorynPadding
Coryn.hideFromUiCapture(binding.creditCardNumber)
Coryn.hideFromUiCapture(
view = binding.address,
padding = CorynPadding.horizontal(16f)
)
import ai.coryn.replay.api.core.main.Coryn.corynHideFromUiCapture
binding.creditCardNumber.corynHideFromUiCapture()
binding.address.corynHideFromUiCapture(padding = CorynPadding.vertical(12f))
Java callers supply the Boolean before the padding:
Coryn.hideFromUiCapture(creditCardNumber, true, CorynPadding.horizontal(16f));
hide defaults to true, and padding defaults to null. To reveal a previously hidden View:
Coryn.hideFromUiCapture(view = binding.creditCardNumber, hide = false)
// Alternatively:
binding.creditCardNumber.corynHideFromUiCapture(hide = false)
Attachment, recycling and repeated declarations
You can mark a View before attaching it to a window. Masking also supports recycled RecyclerView rows. When rebinding a row, set its hiding flag and padding before displaying sensitive content.
For shared behavior, see padding, moving hidden content, overscroll strategies and secure windows. Normal scrolling and layout movement do not require manual notifications; only the exceptional manual position changes described there do.
For a View hosted in an AndroidView, use Modifier.corynHideFromUiCapture() on the Composable. Masking the hosted View directly is not supported.