ViewTooltip
ViewTooltip copied to clipboard
Add Margin to the Tooltip
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.
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);
})