Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Code for Article on Medium 1
...
getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
try {
getViewTreeObserver().removeGlobalOnLayoutListener(this);
int w = getWidth();
addItemDecoration(new EndOffsetDecoration(w - 50));
}catch (Exception e){
e.printStackTrace();
}
}
});
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.