Skip to content

Commit

Permalink
It should remove the other menu view while showing a menu. SpecialCyC…
Browse files Browse the repository at this point in the history
  • Loading branch information
SpecialCyCi committed Oct 22, 2014
1 parent e647b28 commit ada0245
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ResideMenu/src/com/special/ResideMenu/ResideMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public void onClick(View view) {
@Override
public void onAnimationStart(Animator animation) {
if (isOpened()){
showScrollViewMenu();
showScrollViewMenu(scrollViewMenu);
if (menuListener != null)
menuListener.openMenu();
}
Expand All @@ -356,7 +356,8 @@ public void onAnimationEnd(Animator animation) {
}else{
viewActivity.setTouchDisable(false);
viewActivity.setOnClickListener(null);
hideScrollViewMenu();
hideScrollViewMenu(scrollViewLeftMenu);
hideScrollViewMenu(scrollViewRightMenu);
if (menuListener != null)
menuListener.closeMenu();
}
Expand Down Expand Up @@ -524,7 +525,7 @@ public boolean dispatchTouchEvent(MotionEvent ev) {
}
} else if(pressedState == PRESSED_MOVE_HORIZANTAL) {
if (currentActivityScaleX < 0.95)
showScrollViewMenu();
showScrollViewMenu(scrollViewMenu);

float targetScale = getTargetScale(ev.getRawX());
ViewHelper.setScaleX(viewActivity, targetScale);
Expand Down Expand Up @@ -592,13 +593,13 @@ public interface OnMenuListener{
public void closeMenu();
}

private void showScrollViewMenu(){
private void showScrollViewMenu(ScrollView scrollViewMenu){
if (scrollViewMenu != null && scrollViewMenu.getParent() == null){
addView(scrollViewMenu);
}
}

private void hideScrollViewMenu(){
private void hideScrollViewMenu(ScrollView scrollViewMenu){
if (scrollViewMenu != null && scrollViewMenu.getParent() != null){
removeView(scrollViewMenu);
}
Expand Down

0 comments on commit ada0245

Please sign in to comment.