Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Design UI/UX for Android 9 & 10

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Designing for Android 9 (Pie) and Android 10 means embracing gesture navigation, dark theme, and adaptive icons. This guide walks you through the key UI/UX patterns and settings you need to implement, so your app feels native on both versions. You'll need Android Studio with the latest SDK, a test device or emulator running Android 9 or 10, and a basic understanding of XML layouts and Material Design.

What You'll Need

  • Android Studio (latest stable version)
  • SDK Platform for Android 9 (API 28) and Android 10 (API 29)
  • A physical device or emulator running Android 9 or 10
  • Figma, Sketch, or similar design tool (optional but helpful)
  • Material Design Components library (version 1.2.0 or later)

Step-by-Step

  1. Set your target SDK to 29 (Android 10) – In your app's build.gradle file, set compileSdkVersion 29 and targetSdkVersion 29. This ensures you're using the latest APIs and behavior changes.
  2. Enable edge-to-edge display – On Android 10, the system handles gestural navigation. To make your app look modern, draw behind the system bars. In your theme, set android:windowLayoutInDisplayCutoutMode to shortEdges (for notches) and use WindowCompat.setDecorFitsSystemWindows(window, false) in your activity. Then add padding to your layouts using ViewCompat.setOnApplyWindowInsetsListener to avoid content being obscured.
  3. Implement gesture navigation support – Android 10 introduced full gesture navigation. Ensure your interactive elements (buttons, sliders) are not placed too close to the bottom edge (within 32dp of the bottom) or the left/right edges where the back gesture is active. Use the system's WindowInsets to detect the gesture inset and add appropriate margins.
  4. Add dark theme support – Android 10 added a system-wide dark theme. To support it, create a values-night folder in your res directory. Place your dark theme styles and colors there. Use Theme.MaterialComponents.DayNight as your base theme. For example, define your color palette in colors.xml and override it in colors-night.xml.
  5. Use adaptive icons – Android 8.0 and later support adaptive icons, but Android 9 and 10 make them more prominent. Create a mipmap-anydpi-v26 folder with an ic_launcher.xml file that defines a background layer (a solid color or drawable) and a foreground layer (your icon graphic, 108x108dp with a 72dp safe zone). This ensures your icon looks good on all launchers and in themes.
  6. Handle display cutouts (notches) – Android 9 and 10 support cutouts. In your theme, set android:windowLayoutInDisplayCutoutMode to shortEdges for apps that want to draw edge-to-edge. For content that must not be obscured, use WindowInsets.getDisplayCutout() to get the safe insets and apply padding to your root view.
  7. Test with gesture navigation – On your test device or emulator, enable gesture navigation (Settings > System > Gestures > System navigation > Gesture navigation). Walk through your app's main flows. Check that bottom sheets, tabs, and buttons are not overlapped by the gesture bar. Adjust any fixed bottom elements to use the navigation bar inset.
  8. Use Material Design components – For Android 9 and 10, the Material Components library (com.google.android.material:material:1.2.0+) provides updated styles for buttons, cards, text fields, and more that align with the latest design language. Replace any old AppCompat widgets with their Material counterparts (e.g., Button becomes MaterialButton).
  9. Optimize for dark theme – When dark theme is enabled, ensure your app's surfaces use dark gray (like #121212) instead of pure black. Use elevation overlays to differentiate surfaces. Test all text, icons, and images for contrast. Use ?attr/colorSurface and ?attr/colorOnSurface in your layouts.
  10. Update your manifest for the back gesture – Android 10's back gesture can conflict with in-app back navigation. To avoid issues, ensure your app handles the system back button properly. If you use a custom back handler, make sure it works with the predictive back gesture (which is optional but recommended).

Common Mistakes

  • Not handling the bottom inset – content gets hidden behind the gesture bar.
  • Using fixed heights for bottom navigation bars instead of insets.
  • Ignoring dark theme – app looks jarring when system switches to dark mode.
  • Using outdated adaptive icon formats – icons appear as white squares on some launchers.
  • Placing interactive elements too close to screen edges, making them hard to tap with gesture navigation.

Tips

  • Use the Android Studio layout inspector to see how your app renders with system insets.
  • Test on multiple devices with different notch sizes and aspect ratios.
  • Use the ViewTreeObserver.OnWindowFocusChangeListener to detect when the system UI changes (like when the keyboard opens) and adjust insets accordingly.
  • For dark theme, use semantic colors (like colorSurface) rather than hard-coded hex values.
  • Consider using the WindowInsetsController API to control system bar appearance (e.g., light status bar icons) for better contrast.

Troubleshooting

If your app doesn't look right on Android 9 or 10, try these in order:

  1. Restart your app and device – Sometimes the system needs a refresh.
  2. Check your SDK and dependencies – Ensure you've updated to the latest stable versions of Android Studio, SDK Platform, and Material Components.
  3. Verify your manifest – Make sure you've set targetSdkVersion to 29 and that your theme inherits from a DayNight theme.
  4. Clear app data – On the device, go to Settings > Apps > Your App > Storage > Clear Data. This resets any cached settings. Note: this deletes local app data like login tokens or saved preferences.
  5. Reinstall the app – Uninstall and reinstall to ensure you're using the latest build.
  6. Check for system updates – On your test device, go to Settings > System > System update to ensure you're on the latest Android 9 or 10 patch, as some UI behaviors have changed.

Frequently Asked Questions

Do I need to support both Android 9 and 10 separately?

No, you can target Android 10 (API 29) and still support Android 9. Most features like dark theme and gesture navigation are backward-compatible via the AndroidX libraries. Just ensure your minimum SDK is set appropriately (e.g., 21 or higher).

How do I detect if the user has gesture navigation enabled?

You can use WindowInsets.getSystemGestureInsets() to get the gesture inset. If the bottom inset is greater than zero, gesture navigation is likely enabled. However, this is not a direct API; it's a heuristic. For most cases, you don't need to detect it – just respect the insets.

What's the difference between dark theme and night mode?

Dark theme is a system-wide setting that apps can opt into. Night mode is a broader concept that includes dark theme but also adjusts other aspects like brightness. In Android 10, the system dark theme toggles the app's night mode. You implement it using the values-night resource qualifier.

How do I make my app's icon look good on Android 9 and 10?

Use adaptive icons. Create a mipmap-anydpi-v26 folder with an XML file that references a background drawable and a foreground drawable. This works on Android 8.0 and above, including 9 and 10.

Can I still use the old navigation bar (three buttons) on Android 10?

Yes, users can choose between gesture navigation and the traditional 3-button navigation in Settings. Your app should work with both. The insets will differ, so always use the system insets to position your UI.

My app's status bar icons are hard to see in dark theme. What do I do?

Use WindowInsetsControllerCompat to set the appearance of the status bar icons. In dark theme, you want light icons (white). In light theme, you want dark icons. Use isAppearanceLightStatusBars to toggle.