Redth / ResizetizerNT

Add SVG's and PNG's to your shared Xamarin Project
MIT License
318 stars 31 forks source link

[Idea] Custom BaseSize for iOS and Android #7

Closed albilaga closed 4 years ago

albilaga commented 4 years ago

Hello. First of all thanks for this great library. I have some idea that maybe you can consider. Right now if we set BaseSize that will used by Android and iOS. Maybe we can also have custom BaseSize for the each project (different BaseSize for Android and iOS). I know this is some edge case but it nice to have.

Redth commented 4 years ago

Yes this is a useful idea, and the good news is you can totally do this today already with some fancy msbuild logic.

For example:

<ItemGroup Condition="$(_ResizetizerIsiOS) == 'True'">
  <SharedImage Include="image.svg" BaseSize="44,44" />
</ItemGroup>

<ItemGroup Condition="$(_ResizetizerIsAndroid) == 'True'">
  <SharedImage Include="image.svg" BaseSize="50,50" />
</ItemGroup>
albilaga commented 4 years ago

Owh nice. I just knew it. This is based on https://github.com/Redth/ResizetizerNT/blob/master/Resizetizer.NT/Resizetizer.NT.targets this right? Thank you. Might be useful to add in readme.md also I'll add it and you can check if you want to include it or not.

Redth commented 4 years ago

Yeah really I may expose a better public named msbuild property with the platform string in it so you can pivot on that (and it can be documented) instead

albilaga commented 4 years ago

Not sure about better public naming as I am bad at naming also 😅 And I think your msbuild name already good 👍 For me myself, as long as it is documented then user can understand what they need to specify different base size.