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

related to [issue #96], Suggestion for an easier way to apply foreground inset #563

Merged
merged 3 commits into from
Sep 21, 2024

Conversation

LOCKEDFILE
Copy link
Contributor

@LOCKEDFILE LOCKEDFILE commented Jun 12, 2024

I requested a PR for those who find it bothersome to change it manually every time. The default value for the inset is 16.

how to use:

flutter_launcher_icons:
  android: true
  ios: true
  remove_alpha_ios: true
  image_path: "assets/app_icon/icon.png"
  adaptive_icon_background: "assets/app_icon/adaptive_icon_background.png"
  adaptive_icon_foreground: "assets/app_icon/adaptive_icon_foreground.png"
  adaptive_icon_foreground_inset: 16  # default value is 16

before:

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
  <background android:drawable="@drawable/ic_launcher_background"/>
  <foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

after:

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
  <background android:drawable="@drawable/ic_launcher_background"/>
  <foreground>
    <inset
      android:drawable="@drawable/ic_launcher_foreground"
      android:inset="16%" />
  </foreground>
</adaptive-icon>

@iakdis
Copy link

iakdis commented Aug 9, 2024

Hi there, this is a great new feature. Is there anything preventing this PR from being merged? @MarkOSullivan94 @RatakondalaArun

This would be by the way a solution for this issue: #96.

@martinbutt
Copy link

Just tested this and it works perfectly.

lib/android.dart Outdated Show resolved Hide resolved
Copy link
Collaborator

@MarkOSullivan94 MarkOSullivan94 left a comment

Choose a reason for hiding this comment

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

I tried this out and it's working for normal icons but not for monochrome icons

Add the same functionality for monochrome icons and fix the styling so it's not too wide on one line

@MarkOSullivan94
Copy link
Collaborator

Thank you for your contribution @LOCKEDFILE and thank you for testing @martinbutt

@LOCKEDFILE
Copy link
Contributor Author

@MarkOSullivan94, thanks you for your comments.

i fixed monochorome insets and multi line styling.

Copy link
Collaborator

@MarkOSullivan94 MarkOSullivan94 left a comment

Choose a reason for hiding this comment

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

I've tested the inset and monochrome icons and it's working as expected

flutter_launcher_icons v0.13.1

This PR

These screenshots were taken on Pixel 8 Pro emulator with API VanillaIceCream

@MarkOSullivan94
Copy link
Collaborator

Thanks for making the requested changes @LOCKEDFILE

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.

Adaptive Icon Foreground needs to have padding otherwise ends up stretching
4 participants