ViewTooltip icon indicating copy to clipboard operation
ViewTooltip copied to clipboard

Add Margin to the Tooltip

Open rahulagrawal13 opened this issue 4 years ago • 1 comments

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.

rahulagrawal13 avatar Aug 20 '19 10:08 rahulagrawal13

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);
	})

Phocacius avatar May 13 '20 14:05 Phocacius