armcha / Space-Navigation-View

Space Navigation is a library allowing easily integrate fully customizable Google Spaces like navigation to your app.
1.99k stars 378 forks source link

Fix badge trimming of second icon #78

Open irfaan008 opened 6 years ago

irfaan008 commented 6 years ago

When you add 4 icons in bottom navigation and set badges on second icon (which is left to center icon), the badge text gets trim due to the padding assigned to center button. This update fixes that issue. This update also adds another screen on sample project to demonstrate how badge can be assigned to the icons. Irrespective of interest Gradle has been updated as well to version 4.1 to make the compilation successful.

Please merge to main repository and update the dependency version.

FireZenk commented 6 years ago

I've tried your solution, but in this case, is not working as expected: device-2018-03-21-173259

irfaan008 commented 6 years ago

Yes, proceeding this way distorts the shape of center button shadow. This is beneficial if one is not using that shadow.

On investigating the code of main repository I identified that the width of second and third element (message and search) in above screenshot has been calculated with the assumption that center button doesn't have any left , right margin/padding. This is why when we show the badge to 2nd menu item. It gets trimmed on rendering.

FireZenk commented 6 years ago

Fixed here: https://github.com/armcha/Space-Navigation-View/pull/79