Skip to content

Conversation

DhanarajRajendran
Copy link
Collaborator

@DhanarajRajendran DhanarajRajendran commented Sep 9, 2025

Bug Description

Chart rendering throws exceptions on Android devices related to animation settings. This occurs when Developer Options have never been enabled, making animation scale settings inaccessible.

Discussion link: #221

Root Cause of the Issue

The exception was caused by attempting to retrieve the animation scale setting using Settings.Global.GetFloat, which fails if Developer Options were never enabled. This results in a FirstChanceException being logged even though the exception is handled.

Description of Change

To avoid unnecessary exception logging during chart rendering, we replaced the try-catch block with a direct call to Settings.Global.GetFloat using a default value. This ensures smooth behavior even when Developer Options are disabled. The chart now renders with or without animation based on the retrieved scale value, without triggering exceptions.

Screenshots

Before:

image

After:

image

Here SettingsNotFound Exception does not occur in the console while triggering the FirstChanceException

Device Name: Redmi Note 11 Pro 5G
With Animator duration Scale as 1.5x

image

With Animator duration Scale as off

image

Here SettingsNotFound Exception does not occur in the console while triggering the FirstChanceException

Test cases

  • Test case for chart rendering with animation enabled
  • Test case for chart rendering with animation disabled
  • Test case for chart rendering when Developer Options are not enabled

…efault value to avoid the exception occurs while triggering FirstChanceException of MAUI App
Copy link
Collaborator

@Saravanan-Madhesh Saravanan-Madhesh left a comment

Choose a reason for hiding this comment

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

Changes approved.

@Saravanan-Madhesh Saravanan-Madhesh added the chart Chart and graph related issues label Sep 12, 2025
@Saravanan-Madhesh Saravanan-Madhesh added this to the v1.0.7 milestone Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chart Chart and graph related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants