My implementation. This might help someone:
Java version:
public static void setAllParentsClip(View v, boolean enabled) { while (v.getParent() != null && v.getParent() instanceof ViewGroup) { ViewGroup viewGroup = (ViewGroup) v.getParent(); viewGroup.setClipChildren(enabled); viewGroup.setClipToPadding(enabled); v = viewGroup; } }
call setAllParentsClip(yourView, false); disable clipping for all parents.
Edited by:
Kotlin version as an extension function:
fun View.setAllParentsClip(enabled: Boolean) { var parent = parent while (parent is ViewGroup) { parent.clipChildren = enabled parent.clipToPadding = enabled parent = parent.parent } }
Call: yourView.setAllParentsClip(false)
ahmed_khan_89 Mar 24 '16 at 16:29 2016-03-24 16:29
source share