Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Fix: IllegalArgumentException in drawableToBitmap function and Additional Enhancements #35

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

leywino
Copy link
Contributor

@leywino leywino commented Oct 15, 2024

Problem:

Encountered an issue in the DrawableUtil.kt file where the drawableToBitmap function would throw the following error:

image

This error occurred when attempting to convert a drawable with invalid width and height values.

Changes:

1. Bug Fix in drawableToBitmap Function:

  • Modified the drawableToBitmap function in DrawableUtil.kt to handle cases where the width and height of the drawable are less than or equal to 0.
  • Added checks to ensure that the width and height are greater than 0 before proceeding with the bitmap conversion, preventing the IllegalArgumentException from being thrown.

2. Enhancements to AppInfo and getInstalledApps:

  • Added a new boolean property isSystemApp to the AppInfo model to indicate whether an application is a system app.
  • Updated the getInstalledApps function to include a new parameter only_apps_with_launch_intent, allowing filtering of apps to only those that have a launch intent.

Additional Details:

  • This bug fix resolves the issue of crashes due to improper handling of drawable dimensions.
  • The added properties and parameters provide more flexibility in handling app data, specifically filtering system apps and apps with launch intents.
  • Ensured backward compatibility with the previous functionality of the plugin.

@leywino leywino changed the title Bug Fix: IllegalArgumentException in drawableToBitmap function Bug Fix: IllegalArgumentException in drawableToBitmap function and Additional Enhancements Oct 15, 2024
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.

None yet

2 participants