private void setupContextMenuInitialPosition(View openingView) { final int[] openingViewLocation = new int[2]; openingView.getLocationOnScreen(openingViewLocation); int additionalBottomMargin = Utils.dpToPx(16); contextMenuView.setTranslationX(openingViewLocation[0] - additionalBottomMargin * 3); contextMenuView.setTranslationY( openingViewLocation[1] - contextMenuView.getHeight() - additionalBottomMargin); }