Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Add Margin to the Tooltip #80

Open
rahulagrawal13 opened this issue Aug 20, 2019 · 1 comment
Open

Add Margin to the Tooltip #80

rahulagrawal13 opened this issue Aug 20, 2019 · 1 comment

Comments

@rahulagrawal13
Copy link

Hi, I need to set the give margin to the complete tooltip. Using padding is shifting the content inside the view. Currently the Tooltip is taking up the complete width of the screen.

@Phocacius
Copy link

A workaround for applying margins while there's no api method:

ViewTooltip
	.onDisplay(view -> {
	    ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
	    params.leftMargin = getResources().getDimensionPixelSize(R.dimen.padding_main);
	    params.rightMargin = getResources().getDimensionPixelSize(R.dimen.padding_main);
	    view.setLayoutParams(params);
	})

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants