Created
March 25, 2019 18:02
-
-
Save amitpatelx/4c5a7b11ae1546c7f87590c1f1840cc1 to your computer and use it in GitHub Desktop.
Interface Segration Examples from https://medium.com/mindorks/solid-principles-explained-with-examples-79d1ce114ace
This file contains hidden or 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 interface MyOnClickListener { | |
void onClick(View v); | |
boolean onLongClick(View v); | |
} |
This file contains hidden or 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
/** | |
* Interface definition for a callback to be invoked when a view is clicked. | |
*/ | |
public interface OnClickListener { | |
/** | |
* Called when a view has been clicked. | |
* | |
* @param v The view that was clicked. | |
*/ | |
void onClick(View v); | |
} |
This file contains hidden or 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
/** | |
* Interface definition for a callback to be invoked when a view has been clicked and held. | |
*/ | |
public interface OnLongClickListener { | |
/** | |
* Called when a view has been clicked and held. | |
* | |
* @param v The view that was clicked and held. | |
* | |
* @return true if the callback consumed the long click, false otherwise. | |
*/ | |
boolean onLongClick(View v); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment