Last active
June 27, 2017 14:04
-
-
Save chemickypes/0cfa4f235b0e00df1b5e7e01cb2c56da to your computer and use it in GitHub Desktop.
Code for Article on Medium 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
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