diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java index 00501e10d6..e2804de9c9 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java @@ -13,6 +13,9 @@ import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; import android.view.ViewTreeObserver; +import android.view.animation.AccelerateInterpolator; +import android.view.animation.DecelerateInterpolator; +import android.view.animation.Interpolator; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; @@ -41,6 +44,9 @@ public final class EmulationActivity extends AppCompatActivity // So that MainActivity knows which view to invalidate before the return animation. private int mPosition; + private static Interpolator sDecelerator = new DecelerateInterpolator(); + private static Interpolator sAccelerator = new AccelerateInterpolator(); + /** * Handlers are a way to pass a message to an Activity telling it to do something * on the UI thread. This Handler responds to any message, even blank ones, by @@ -241,44 +247,40 @@ public final class EmulationActivity extends AppCompatActivity { if (mMenuVisible) { + mMenuVisible = false; + mMenuLayout.animate() .withLayer() .setDuration(200) + .setInterpolator(sAccelerator) .alpha(0.0f) - .scaleX(1.1f) - .scaleY(1.1f) + .translationX(-400.0f) .withEndAction(new Runnable() { @Override public void run() { - mMenuLayout.setVisibility(View.GONE); - mMenuVisible = false; + if (mMenuVisible) + { + mMenuLayout.setVisibility(View.GONE); + } } }); } else { + mMenuVisible = true; mMenuLayout.setVisibility(View.VISIBLE); - mMenuLayout.setScaleX(1.1f); - mMenuLayout.setScaleY(1.1f); +// mMenuLayout.setTranslationX(-400.0f); mMenuLayout.setAlpha(0.0f); mMenuLayout.animate() .withLayer() .setDuration(300) + .setInterpolator(sDecelerator) .alpha(1.0f) - .scaleX(1.0f) - .scaleY(1.0f) - .withEndAction(new Runnable() - { - @Override - public void run() - { - mMenuVisible = true; - } - }); + .translationX(0.0f); } } diff --git a/Source/Android/app/src/main/res/layout-television/activity_emulation.xml b/Source/Android/app/src/main/res/layout-television/activity_emulation.xml index 5455f0c47f..06fe747c39 100644 --- a/Source/Android/app/src/main/res/layout-television/activity_emulation.xml +++ b/Source/Android/app/src/main/res/layout-television/activity_emulation.xml @@ -20,7 +20,6 @@ android:id="@+id/layout_ingame_menu" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="#af000000" android:orientation="horizontal" android:visibility="gone" tools:visibility="visible" @@ -38,7 +37,7 @@ android:id="@+id/frame_submenu" android:layout_width="0dp" android:layout_height="match_parent" - android:layout_weight="2"/> + android:layout_weight="3"/> diff --git a/Source/Android/app/src/main/res/layout/fragment_ingame_menu.xml b/Source/Android/app/src/main/res/layout/fragment_ingame_menu.xml index 76572112fb..df31f0b69f 100644 --- a/Source/Android/app/src/main/res/layout/fragment_ingame_menu.xml +++ b/Source/Android/app/src/main/res/layout/fragment_ingame_menu.xml @@ -3,62 +3,44 @@ android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" - android:padding="32dp"> + android:background="@color/dolphin_blue_dark" + android:paddingTop="32dp" + android:paddingBottom="32dp" + >