1

enter image description here

enter image description here

i was trying to show popupwindow above the view to the right corner i have used the below code

    val minusY = UiUtil.pxFromDp(requireContext(), -300f) // this is the height of the popupwindow 300dp
    popupWindow?.showAsDropDown(achorView, 0,-minusY, Gravity.TOP or Gravity.END)
    
    
     fun pxFromDp(context: Context, dp: Float): Int {
            return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, context.resources.displayMetrics).toInt()
        }

but it gives variation from device to device.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.