Skip to content

Commit

Permalink
front: Removed animation when showing/hiding cheats category.
Browse files Browse the repository at this point in the history
  • Loading branch information
littleguy77 committed Jan 14, 2013
1 parent 6e27cf1 commit de40958
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions src/paulscode/android/mupen64plusae/PlayMenuActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@
import paulscode.android.mupen64plusae.util.TaskHandler;
import paulscode.android.mupen64plusae.util.TaskHandler.Task;
import paulscode.android.mupen64plusae.util.Utility;
import android.annotation.TargetApi;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.os.Bundle;
import android.preference.Preference;
Expand Down Expand Up @@ -133,16 +134,20 @@ protected void onPause()
sharedPreferences.unregisterOnSharedPreferenceChangeListener( this );
}

@TargetApi( 5 )
@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 );
finish();
if( AppData.IS_ECLAIR)
overridePendingTransition(0, 0);
}
}

Expand Down Expand Up @@ -226,9 +231,9 @@ private void build( final String crc )
}

// Set the title of the menu to the game name, if available
String ROM_name = configSection.get( "Name" );
if( !TextUtils.isEmpty( ROM_name ) )
setTitle( ROM_name );
// String ROM_name = configSection.get( "Name" );
// if( !TextUtils.isEmpty( ROM_name ) )
// setTitle( ROM_name );

// Layout the menu, populating it with appropriate cheat options
PreferenceCategory cheatsCategory = (PreferenceCategory) findPreference( CATEGORY_CHEATS );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
*/
public class AppData
{
/** True if device is running Eclair or later (4 - Android 2.0.x) */
/** True if device is running Eclair or later (5 - Android 2.0.x) */
public static final boolean IS_ECLAIR = Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR;

/** True if device is running Gingerbread or later (9 - Android 2.3.x) */
Expand Down

0 comments on commit de40958

Please sign in to comment.