Skip to content

fix(android): enable hardware acceleration for IAM transparency#855

Merged
fadi-george merged 8 commits intomainfrom
fg/iam-styling-android
Mar 6, 2026
Merged

fix(android): enable hardware acceleration for IAM transparency#855
fadi-george merged 8 commits intomainfrom
fg/iam-styling-android

Conversation

@fadi-george
Copy link
Collaborator

@fadi-george fadi-george commented Mar 6, 2026

Description

One Line Summary

Enable hardware acceleration on the Android Activity window so in-app message WebViews render with transparent backgrounds.
Screenshot 2026-03-05 at 8 02 03 PM
Screenshot 2026-03-05 at 8 02 22 PM
Screenshot 2026-03-05 at 8 02 31 PM
Screenshot 2026-03-05 at 8 03 58 PM
Screenshot 2026-03-05 at 8 08 16 PM

Details

Motivation

Unity sets android:hardwareAccelerated="false" on its Activity, which prevents WebView transparent backgrounds from rendering. The native SDK displays in-app messages via a PopupWindow whose window inherits this setting, causing IAMs to render with an opaque white background instead of the expected transparent overlay.

Scope

Enables the FLAG_HARDWARE_ACCELERATED flag at the window level during SDK initialization. This restores WebView transparency without affecting Unity's own GL/Vulkan rendering surface. The flag is set on the Android UI thread via runOnUiThread.

Testing

Manual testing

Built and ran the demo app on an Android 16 emulator (Pixel, API 36). Verified all IAM types (top banner, bottom banner, center modal, full screen) render with correct transparency.

Affected code checklist

  • In-App Messaging

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

This change is Reviewable

@fadi-george fadi-george changed the title fix(android): run hardware acceleration on UI thread fix(android): enable hardware acceleration for IAM transparency Mar 6, 2026
Made-with: Cursor
Copy link

@abdulraqeeb33 abdulraqeeb33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question around cursor/rules and pr-assets checkedi n

@fadi-george fadi-george merged commit 9589874 into main Mar 6, 2026
5 checks passed
@fadi-george fadi-george deleted the fg/iam-styling-android branch March 6, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants