Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jun 10, 2025

This PR implements comprehensive Android edge-to-edge support across all activities in the syntax highlighter app to address compatibility issues with Android 15.

Changes Made

Theme Updates

  • Updated base AppTheme with windowLayoutInDisplayCutoutMode for edge-to-edge display
  • Added API 23+ theme variation (values-v23/) with transparent status bar and light status bar support
  • Added API 29+ theme variation (values-v29/) with enhanced edge-to-edge support including:
    • Transparent navigation bar
    • Light navigation bar support
    • Disabled status bar and navigation bar contrast enforcement

Activity Updates

All activities now properly support edge-to-edge display:

View-based Activities (MainActivity, HighlightJsDemoActivity, PrismJsDemoActivity):

  • Added enableEdgeToEdge() call before setContentView()
  • Implemented proper window insets handling using ViewCompat.setOnApplyWindowInsetsListener()
  • Added necessary imports for androidx.activity.enableEdgeToEdge and androidx.core.view APIs

Compose-based Activity (PrismJsComposeDemoActivity):

  • Added enableEdgeToEdge() call before setContent()
  • Updated composable to use windowInsetsPadding(WindowInsets.systemBars) modifier

Layout Updates

  • Added root container IDs to all activity layouts to enable proper insets handling
  • Maintained existing layout structure while ensuring compatibility with system bars

Implementation Details

The implementation follows Google's official edge-to-edge guidelines and ensures:

  1. System bars are transparent - Content can draw behind status and navigation bars
  2. Proper inset handling - UI elements don't overlap with system bars
  3. API level compatibility - Progressive enhancement across different Android versions
  4. Minimal visual changes - Maintains existing app appearance while adding edge-to-edge support

Testing

The changes maintain backward compatibility and should work seamlessly across all supported Android versions (API 29+). The app will now properly utilize the full screen real estate on Android 15 while respecting system bars.

Fixes #87.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.11.1-bin/bpt9gzteqjrbo1mjrsomdt32c/gradle-8.11.1/lib/gradle-daemon-main-8.11.1.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.11.1-bin/bpt9gzteqjrbo1mjrsomdt32c/gradle-8.11.1/lib/agents/gradle-instrumentation-agent-8.11.1.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.11.1 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI and others added 2 commits June 10, 2025 20:56
Co-authored-by: hossain-khan <99822+hossain-khan@users.noreply.github.com>
…ent API levels

Co-authored-by: hossain-khan <99822+hossain-khan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add android edge-to-edge support Add Android edge-to-edge support for all activities Jun 10, 2025
Copilot AI requested a review from hossain-khan June 10, 2025 20:59
Copy link
Owner

@hossain-khan hossain-khan left a comment

Choose a reason for hiding this comment

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

Changes look good

@hossain-khan hossain-khan marked this pull request as ready for review June 10, 2025 21:18
Copilot finished work on behalf of hossain-khan June 10, 2025 21:19
@hossain-khan hossain-khan merged commit cfc0cf0 into main Jun 10, 2025
2 checks passed
@hossain-khan hossain-khan deleted the copilot/fix-87 branch June 10, 2025 21:20
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.

Add android edge-to-edge support

2 participants