Tapadoo / Alerter

An Android Alerting Library
MIT License
5.52k stars 633 forks source link

Custom Layout padding and margin #241

Closed manyunyu7 closed 3 years ago

manyunyu7 commented 3 years ago

Hello i just want to ask how to set margin for custom layout, because the original view has a margin that i think uncustomizable, or maybe i missed a words in documentation ? Thank You

kpmmmurphy commented 3 years ago

Hey @henryaugusta! I think this is one for @minibugdev to answer, as he implemented custom layouts!

minibugdev commented 3 years ago

Hi @henryaugusta,

You are right, this library isn't support to customize custom layout margin because of Alerter inflated alerter_alert_view.xml to alert view layout which compose with parent container, content container, button container.

For custom layout, it was inflated to content container with id vAlertContentContainer which inside parent container with id llAlertBackground. Unfortunately, the parent have padding so that's why it doesn't support to customize the margin/padding.

For workaround solution, I think you can override parent paddings by override @dimen/alerter_padding_default and @dimen/alerter_alert_view_padding_top on your dimens.xml.

manyunyu7 commented 3 years ago

Thanks in advance @minibugdev @kpmmmurphy , really appreciate for the suggested solution 👍