Engineering

Implementing Field-Level UI Masking for Sensitive Career Data

A technical walkthrough of how we use conditional UI masking in Employ Ready to keep specific salary or personal identifiers private during mentorship.

Amin Shekh · November 8, 2026
Share

When a user prepares for a career pivot, they often need external feedback. In our upcoming app, Employ Ready, users rehearse interviews and track their professional development. However, career data is inherently sensitive. A user might want a mentor to review their interview performance scores or skill gap analysis, but they almost certainly do not want that same mentor to see their current salary, home address, or private notes about a specific manager. Traditionally, privacy is handled at the document or account level—you either share the file or you don't. At AIA Innovations, we believe that 'all or nothing' privacy is a barrier to professional growth. To solve this, we implemented field-level masking: a UI pattern that allows users to toggle visibility on specific data points within a shared view.

The Architecture of Granular Privacy

Designing for granular privacy requires moving away from simple boolean visibility flags (e.g., isPublic: true) and toward a state-driven UI where the view layer respects the sensitivity level of each individual field. In the context of Employ Ready, we treat every data point—be it a 'Years of Experience' integer or a 'Current Salary' double—as an object that carries its own privacy metadata.

In our Jetpack Compose implementation, we use a custom state wrapper. Instead of passing a raw String or Int to a component, we pass a SecurableField<T>. This object contains the value, a privacy level (Public, Protected, or Private), and the current masking state. This allows the UI to decide whether to render the actual text, a blurred placeholder, or a generic redacted string (like "••••") based on who is viewing the screen.

Why Redaction Beats Omission

One of the most important lessons we learned during the development of Mindful Assistant is that layout stability matters for focus. If you simply hide a field when it is private, the entire layout shifts, causing a jarring experience for the viewer. In a career context, if a mentor is looking at a resume layout and the 'Salary Expectation' field disappears entirely, the visual balance is lost.

By using UI masking—specifically field-level redaction—we maintain the structure of the data. The viewer knows a piece of information exists, but they cannot see the content. This builds trust by showing the user exactly what is being obscured. It also allows for 'Selective Reveal'—a feature where a user can tap a masked field to temporarily unmask it during a live screen-sharing session, giving them total control over the flow of sensitive information.

Implementing the Masking Layer in Jetpack Compose

To implement this effectively, we avoided hard-coding masking logic into every single Text or TextField component. Instead, we built a PrivacyWrapper composable. This higher-order component wraps any UI element and applies a visual filter based on the data's privacy state.

Here is a simplified look at the logic we use to determine how a field should be displayed:

Privacy StateUI TreatmentUse Case
PublicStandard RenderingGeneral bio, skills, and publicly available certifications.
ProtectedRedacted (••••)Specific dates of employment or project names under NDA.
PrivateHigh-Gaussian BlurCurrent salary, internal performance ratings, or manager names.
HiddenOmittedPersonal identification numbers (SSN/National ID) or home addresses.

Worked Example: The Career Progress Dashboard

Consider the Employ Ready dashboard. It displays a user’s current interview readiness score, a list of targeted job roles, and their expected salary range. When a user enters 'Mentor Mode', the app triggers a state change across the entire navigation graph.

  1. 1.State Initialization: The PrivacyManager detects the change in context. It queries the local database for the user's field-level preferences.
  2. 2.Field Evaluation: The 'Readiness Score' is flagged as Public (sharing progress is the goal). The 'Targeted Roles' are flagged as Public. The 'Expected Salary' is flagged as Private.
  3. 3.UI Transformation: The PrivacyWrapper around the salary text detects the Private flag. Instead of rendering "$120,000", it renders a box of the same width and height filled with a subtle shimmer effect or a series of dots.
  4. 4.Interaction Layer: If the mentor asks about the salary range, the user can long-press the masked area. A biometric prompt (fingerprint or face unlock) appears on the user's device. Upon successful authentication, the field unmasks for 30 seconds before re-locking.

This approach respects the user's agency. It moves privacy from a static setting hidden in a menu to a dynamic, interactive part of the interface.

Handling Data at the Repository Level

Engineering granular privacy isn't just a UI challenge; it's a data integrity challenge. We ensure that masked data is never accidentally leaked through logging or analytics. Our privacy-first analytics policy dictates that any field marked as Private or Protected is automatically excluded from event tracking.

In our repository layer, we use a transformation pattern. When data is fetched from the local SQLite database, it is mapped into a UIModel where sensitive strings are already obscured if the current app session is in a 'Restricted' state. This ensures that even if a UI bug occurs and the PrivacyWrapper fails to render, the underlying string being passed to the view is already redacted. You cannot display what isn't there.

The Trade-offs of Granular Masking

Implementing field-level masking is more complex than a standard UI. During development, we encountered three main trade-offs:

  • Performance Overhead: Wrapping every text element in a PrivacyWrapper adds to the composition tree depth. We mitigated this by using Modifier.drawWithContent for blurring rather than adding additional layout nodes, keeping the UI snappy even on lower-end Android devices.
  • User Education: Users need to understand why their own data looks 'broken' (redacted) when they are in certain modes. We solved this by using distinct visual languages—a clear 'lock' icon and a specific color palette (often deep greys or blues) to indicate active privacy protection.
  • Testing Complexity: We had to write specific UI tests (using Compose Test Rule) to verify that sensitive fields failed to show their real values when the privacy toggle was active. A test that passes when it sees the correct data is standard; a test that passes only when it sees "••••" is a unique requirement of this architecture.

Privacy as a Product Feature

In the competitive landscape of productivity tools, privacy is often treated as a compliance checkbox. At AIA Innovations, we treat it as a core part of the user experience. By giving users the tools to mask their salary or personal identifiers while still benefiting from mentorship in Employ Ready, we remove the anxiety associated with professional transparency.

This granular approach mirrors how we handle sensitive information in other apps. For instance, in ShariahSignal, we ensure that financial data is presented clearly but without exposing unnecessary personal portfolio details to the view layer unless explicitly requested. The principle remains the same: the user should always be in the driver's seat of their own data.

Practical Implementation Checklist

If you are implementing similar masking in your own productivity apps, use this checklist to ensure you haven't missed a vulnerability:

  • [ ] Identify Sensitive Atoms: Break your data models down. Instead of a 'User Profile' object, identify which specific strings (Salary, Address, Manager Name) require masking.
  • [ ] Define Redaction Styles: Use '••••' for short identifiers, Gaussian blur for longer text blocks, and full omission for highly sensitive IDs.
  • [ ] Implement Biometric Re-auth: For 'Selective Reveal' features, always require a system-level biometric check before unmasking data.
  • [ ] Audit Logging/Analytics: Ensure your logging framework is aware of the privacy metadata so it never accidentally captures raw sensitive strings.
  • [ ] Visual Feedback: Provide a clear 'Privacy Active' indicator in the UI so the user knows exactly which mode they are in.

What to do next

  1. 1.Audit your data models: Review your current app’s data structures and categorize fields into Public, Protected, and Private tiers.
  2. 2.Prototype a PrivacyWrapper: Create a simple Jetpack Compose wrapper that toggles between content() and a redacted Box() based on a boolean state.
  3. 3.Test with real users: Observe how users react to masked data. Does it make them feel more secure, or does it cause confusion? Adjust your visual cues based on this feedback.
#android development#ui design#privacy#engineering

One email per launch. No spam, unsubscribe any time.