Created
April 17, 2017 19:02
-
-
Save Cassie-von-Clausewitz/67a6f3bbf15da506e8565dd9d9add5eb to your computer and use it in GitHub Desktop.
Clean up the state of the NestedScrollView inside the CoordinatorLayout. Use to test if this would work before subclassing CoordinatorLayout and calling the protected method directly.
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
try { | |
Class c = parent.getClass().getSuperclass(); | |
Method cleanupLayoutState = c.getDeclaredMethod("cleanupLayoutState", View.class); | |
if(!cleanupLayoutState.isAccessible()) { | |
cleanupLayoutState.setAccessible(true); | |
} | |
cleanupLayoutState.invoke(parent, this); | |
Log.i("BottomSheet", "invoked method"); | |
} catch (Exception ignored) { | |
Log.e("BottomSheet", ignored.getMessage()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment