I want to add an overlay to the application rootView or BaseActivity without permission.
And it should be displayed on top of BottomSheetDialog
or on top of Copy Cut Paste ContextMenu
in EditText
I have tried multiple ways but didn't successed.
val rootLayout = findViewById(android.R.id.content) as ViewGroup
val viewToAdd = View.inflate(this,R.layout.fragment_maintenance,rootLayout)
///val viewToAdd = layoutInflater.inflate(R.layout.fragment_maintenance,null)
val params = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
viewToAdd.layoutParams = params
///params.gravity = Gravity.BOTTOM or Gravity.CENTER
///rootLayout.addView(viewToAdd)
///val rootLayout = window.decorView.rootView
//val rootLayout = window.decorView.findViewById<ViewGroup>(android.R.id.content)
///View.inflate(this, R.layout.fragment_maintenance, rootLayout)
And can we add any view using WindowManager without permission.