Last active
November 24, 2016 06:09
-
-
Save kevalpatel2106/924b1b95aac4fe8ecb9ed92def5f6c48 to your computer and use it in GitHub Desktop.
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
case MotionEvent.ACTION_UP: | |
int Xdiff = (int) (event.getRawX() - initialTouchX); | |
int Ydiff = (int) (event.getRawY() - initialTouchY); | |
//The check for Xdiff <10 && YDiff< 10 because sometime elements moves a little while clicking. | |
//So that is click event. | |
if (Xdiff < 10 && Ydiff < 10) { | |
if (isViewCollapsed()) { | |
//When user clicks on the image view of the collapsed layout, | |
//visibility of the collapsed layout will be changed to "View.GONE" | |
//and expanded view will become visible. | |
collapsedView.setVisibility(View.GONE); | |
expandedView.setVisibility(View.VISIBLE); | |
} | |
} | |
return true; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment