Skip to content

Commit 0b4be4f

Browse files
committed
Bug fixed
Menu in and out animation bug fixed
1 parent 0bb5947 commit 0b4be4f

File tree

5 files changed

+56
-9
lines changed

5 files changed

+56
-9
lines changed

ArcMenuLibrary/src/main/java/com/bvapp/arcmenulibrary/ArcMenu.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -441,14 +441,7 @@ public void run() {
441441
bindItemAnimation(item, false, 200);
442442
}
443443
}
444-
if(isMenuClicked){
445-
isMenuClicked = false;
446-
if(!isDoubleIconSet && !isOneIconSet){
447-
ViewAnim.rotateAnimation(mIcon, false);
448-
}else if(isDoubleIconSet && !isOneIconSet){
449-
fabMenu.setIcon(iconClose, true);
450-
}
451-
}
444+
retFirstStatus();
452445
mArcLayout.invalidate();
453446
mArcLayout.setExpandDone(false);
454447
if (listener != null) {
@@ -459,6 +452,16 @@ public void run() {
459452
};
460453
}
461454

455+
private void retFirstStatus(){
456+
if(isMenuClicked){
457+
isMenuClicked = false;
458+
if(!isDoubleIconSet && !isOneIconSet){
459+
ViewAnim.rotateAnimation(mIcon, false);
460+
}else if(isDoubleIconSet && !isOneIconSet){
461+
fabMenu.setIcon(iconClose, true);
462+
}
463+
}
464+
}
462465
/**
463466
*
464467
* @param child
@@ -825,6 +828,7 @@ private void setDefaultAnim(){
825828
public void menuOut(){
826829
if(mArcLayout.isExpanded()){
827830
mArcLayout.switchState(true);
831+
retFirstStatus();
828832
}
829833
this.startAnimation(menuTranslateOut);
830834
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.bvapp.arcmenu;
2+
3+
import android.content.Context;
4+
import android.support.test.InstrumentationRegistry;
5+
import android.support.test.runner.AndroidJUnit4;
6+
7+
import org.junit.Test;
8+
import org.junit.runner.RunWith;
9+
10+
import static org.junit.Assert.*;
11+
12+
/**
13+
* Instrumentation test, which will execute on an Android device.
14+
*
15+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
16+
*/
17+
@RunWith(AndroidJUnit4.class)
18+
public class ExampleInstrumentedTest {
19+
@Test
20+
public void useAppContext() throws Exception {
21+
// Context of the app under test.
22+
Context appContext = InstrumentationRegistry.getTargetContext();
23+
24+
assertEquals("com.bvapp.arcmenu", appContext.getPackageName());
25+
}
26+
}

app/src/main/java/com/bvapp/arcmenu/ActivityFragment.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
122122
menu.setToolTipPadding(4f);
123123
menu.setToolTipTextSize(14);
124124
menu.setToolTipTextColor(Color.BLUE);
125+
//menu.setIcon(R.mipmap.facebook_w, R.mipmap.github_w);
125126
menu.setAnim(300,300, ArcMenu.ANIM_MIDDLE_TO_RIGHT, ArcMenu.ANIM_MIDDLE_TO_RIGHT,
126127
ArcMenu.ANIM_INTERPOLATOR_ACCELERATE_DECLERATE, ArcMenu.ANIM_INTERPOLATOR_ACCELERATE_DECLERATE);
127128

app/src/main/res/layout/fragment_recyclerview.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
arc:menuChildAnim="false"
2424
arc:menuShadowElevation="true"
2525
arc:menuNormalColor="@color/colorAccent"
26-
arc:menuImage="@mipmap/tools"
2726
android:layout_gravity="center_horizontal|right"
2827
android:layout_marginRight="6dp"
2928
android:layout_marginBottom="6dp"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.bvapp.arcmenu;
2+
3+
import org.junit.Test;
4+
5+
import static org.junit.Assert.*;
6+
7+
/**
8+
* Example local unit test, which will execute on the development machine (host).
9+
*
10+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
11+
*/
12+
public class ExampleUnitTest {
13+
@Test
14+
public void addition_isCorrect() throws Exception {
15+
assertEquals(4, 2 + 2);
16+
}
17+
}

0 commit comments

Comments
 (0)