Skip to content

Commit

Permalink
front: Removed unnatural transition animations between Menu and Play.
Browse files Browse the repository at this point in the history
None of the other preference screens are animated when the user nav-
igates up and down the hierarchy. So we remove it here as well. (The
reason it's animated in the first place is because the Play menu
resides in its own activity.)
  • Loading branch information
littleguy77 committed Jan 14, 2013
1 parent 86f0c73 commit ae1d820
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<activity
android:name=".PlayMenuActivity"
android:label="@string/app_name"
android:theme="@style/playTheme" >
android:exported="false" >
<intent-filter>
<action android:name=".PlayMenuActivity" />
Expand Down
4 changes: 4 additions & 0 deletions res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

<style name="appTheme" parent="@android:style/Theme" />

<style name="playTheme" parent="@style/appTheme">
<item name="android:windowAnimationStyle">@null</item>
</style>

<style name="btnMappable" parent="@android:style/Widget.Button">
<item name="android:layout_width">@dimen/inputMapPreferenceButtonSize</item>
<item name="android:layout_height">@dimen/inputMapPreferenceButtonSize</item>
Expand Down
16 changes: 10 additions & 6 deletions src/paulscode/android/mupen64plusae/PlayMenuActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,19 +135,23 @@ protected void onPause()
}

@TargetApi( 5 )
@Override
public void finish()
{
// Disable transition animation to behave like any other screen in the menu hierarchy
super.finish();
if( AppData.IS_ECLAIR )
overridePendingTransition( 0, 0 );
}

@Override
public void onSharedPreferenceChanged( SharedPreferences sharedPreferences, String key )
{
if( key.equals( PLAY_SHOW_CHEATS ) )
{
// Rebuild the menu; the easiest way is to simply restart the activity
// We disable the transition animation since it's confusing in this case
Intent intent = getIntent();
intent.setFlags( Intent.FLAG_ACTIVITY_NO_ANIMATION );
startActivity( intent );
startActivity( getIntent() );
finish();
if( AppData.IS_ECLAIR)
overridePendingTransition(0, 0);
}
}

Expand Down

0 comments on commit ae1d820

Please sign in to comment.