shadow4android icon indicating copy to clipboard operation
shadow4android copied to clipboard

Use Dp as size and generate shadows for all DPI?

Open molikto opened this issue 7 years ago • 4 comments

molikto avatar May 22 '17 03:05 molikto

Seconded. A workaround is to manually calculate the blur for your dpi but..

tomblenz avatar Aug 17 '17 21:08 tomblenz

Thanks for the suggestion. I am not sure about this one to be honest. Could you please provide steps how do you do It manually? Do I need change blur too or only change the dimensions of the rectangle?

yuraj11 avatar Feb 23 '18 15:02 yuraj11

The main dpi buckets in use today are mdpi (1x), hdpi (1.5x), xhdpi (2x), xxhdpi (3x), xxxhdpi (4x). This tool generates a single image, so I assume that the image is mdpi. To generate the higher resolutions you only need to make everything larger. So if the user has chosen a box size of 200x200 with 20 blur your hdpi version will have 1.5x the size of everything (300x300 with 30 blur), xhdpi will have 2x (400x400 with 40 blur), etc. I'd imagine it should be pretty simple.

Then just provide a .zip as the download with each version in their corresponding drawable-mdpi\%filename%, drawable-hdpi\%filename% etc folders.

tomblenz avatar Feb 23 '18 21:02 tomblenz

https://developer.android.com/training/multiscreen/screendensities.html#TaskProvideAltBmp is a great resource and should make the task nice and clear.

tomblenz avatar Feb 23 '18 21:02 tomblenz