From 37e09be243fd8a8e84f9144d157618a2c80e5ce6 Mon Sep 17 00:00:00 2001 From: Special Leung Date: Sun, 13 Apr 2014 17:44:54 +0800 Subject: [PATCH] update DEMO and fixed #5 --- .../src/com/special/ResideMenu/ResideMenu.java | 2 +- ResideMenuDemo/res/layout/main.xml | 10 +++++++++- .../src/com/special/ResideMenuDemo/MenuActivity.java | 12 ++++++++++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/ResideMenu/src/com/special/ResideMenu/ResideMenu.java b/ResideMenu/src/com/special/ResideMenu/ResideMenu.java index 8788fba..9b462b5 100644 --- a/ResideMenu/src/com/special/ResideMenu/ResideMenu.java +++ b/ResideMenu/src/com/special/ResideMenu/ResideMenu.java @@ -245,9 +245,9 @@ private void setViewPadding(){ public void openMenu(int direction){ if (isInDisableDirection(direction)) throw new IllegalArgumentException("You have set this direction disable, but now you want to open menu in this direction."); + setScaleDirection(direction); isOpened = true; - setScaleDirection(direction); AnimatorSet scaleDown_activity = buildScaleDownAnimation(view_activity, 0.5f, 0.5f); AnimatorSet scaleDown_shadow = buildScaleDownAnimation(iv_shadow, 0.5f + shadow_AdjustScaleX, 0.5f + shadow_AdjustScaleY); AnimatorSet alpha_menu = buildMenuAnimation(sv_menu, 1.0f); diff --git a/ResideMenuDemo/res/layout/main.xml b/ResideMenuDemo/res/layout/main.xml index 8b6ff41..029a488 100644 --- a/ResideMenuDemo/res/layout/main.xml +++ b/ResideMenuDemo/res/layout/main.xml @@ -24,7 +24,7 @@ android:layout_width="28dp" android:layout_height="28dp" android:background="@drawable/titlebar_menu_selector" - android:id="@+id/title_bar_menu" + android:id="@+id/title_bar_left_menu" android:layout_gravity="left|center_vertical" android:layout_marginLeft="10dp"/> @@ -36,6 +36,14 @@ android:textSize="24sp" android:textColor="#999999" android:layout_gravity="center"/> + +