Last active
October 22, 2018 16:21
-
-
Save renaudcerrato/a94e34dce323f8b150633764d542c85d to your computer and use it in GitHub Desktop.
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
public class NastyCustomView extends View implements InteractiveViewHelper.Callback { | |
private final InteractiveViewHelper mInteractiveViewHelper = | |
new InteractiveViewHelper(this, this); | |
@Override | |
protected void onAttachedToWindow() { | |
super.onAttachedToWindow(); | |
mInteractiveViewHelper.onAttachedToWindow(); | |
} | |
@Override | |
protected void onDetachedFromWindow() { | |
super.onDetachedFromWindow(); | |
mInteractiveViewHelper.onDetachedFromWindow(); | |
} | |
@Override | |
protected void onVisibilityChanged(@NonNull View changedView, int visibility) { | |
super.onVisibilityChanged(changedView, visibility); | |
mInteractiveViewHelper.onVisibilityChanged(changedView, visibility); | |
} | |
@Override | |
protected void onWindowVisibilityChanged(int visibility) { | |
super.onWindowVisibilityChanged(visibility); | |
mInteractiveViewHelper.onWindowVisibilityChanged(visibility); | |
} | |
@Override | |
public void onInteractivityChanged(boolean isInteractive) { | |
enableNastyThings(isInteractive); // be greener! | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment