Permalink
Browse files

Merge branch 'material-design-part2'

  • Loading branch information...
littleguy77 committed May 8, 2015
2 parents 88d8ce8 + e9fdd09 commit 066f730175e672a403eb6b310044c9bf90d4971d
View
@@ -66,7 +66,8 @@
<activity
android:name="paulscode.android.mupen64plusae.persistent.GamePrefsActivity"
android:exported="false"
- android:label="@string/PlayMenuActivity_title" >
+ android:label="@string/PlayMenuActivity_title"
+ android:theme="@style/Theme.AppCompat" >
<intent-filter>
<action android:name=".persistent.GamePrefsActivity" />
@@ -76,7 +77,8 @@
<activity
android:name="paulscode.android.mupen64plusae.persistent.GlobalPrefsActivity"
android:exported="false"
- android:label="@string/SettingsGlobalActivity_title" >
+ android:label="@string/SettingsGlobalActivity_title"
+ android:theme="@style/Theme.AppCompat" >
<intent-filter>
<action android:name=".persistent.GlobalPrefsActivity" />
@@ -86,7 +88,8 @@
<activity
android:name="paulscode.android.mupen64plusae.profile.ManageControllerProfilesActivity"
android:exported="false"
- android:label="@string/ManageControllerProfilesActivity_title" >
+ android:label="@string/ManageControllerProfilesActivity_title"
+ android:theme="@style/Theme.AppCompat" >
<intent-filter>
<action android:name=".profile.ManageControllerProfilesActivity" />
@@ -107,7 +110,8 @@
<activity
android:name="paulscode.android.mupen64plusae.profile.ManageEmulationProfilesActivity"
android:exported="false"
- android:label="@string/ManageEmulationProfilesActivity_title" >
+ android:label="@string/ManageEmulationProfilesActivity_title"
+ android:theme="@style/Theme.AppCompat" >
<intent-filter>
<action android:name=".profile.ManageEmulationProfilesActivity" />
@@ -117,7 +121,8 @@
<activity
android:name="paulscode.android.mupen64plusae.profile.EmulationProfileActivity"
android:exported="false"
- android:label="@string/EmulationProfileActivity_title" >
+ android:label="@string/EmulationProfileActivity_title"
+ android:theme="@style/Theme.AppCompat" >
<intent-filter>
<action android:name=".profile.EmulationProfileActivity" />
@@ -127,7 +132,8 @@
<activity
android:name="paulscode.android.mupen64plusae.profile.ManageTouchscreenProfilesActivity"
android:exported="false"
- android:label="@string/ManageTouchscreenProfilesActivity_title" >
+ android:label="@string/ManageTouchscreenProfilesActivity_title"
+ android:theme="@style/Theme.AppCompat" >
<intent-filter>
<action android:name=".profile.ManageTouchscreenProfilesActivity" />
@@ -159,7 +165,8 @@
<activity
android:name="paulscode.android.mupen64plusae.cheat.CheatEditorActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
- android:label="@string/CheatEditorActivity_title" >
+ android:label="@string/CheatEditorActivity_title"
+ android:theme="@style/Theme.AppCompat" >
<intent-filter>
<action android:name=".cheat.CheatEditorActivity" />
@@ -29,6 +29,7 @@
import paulscode.android.mupen64plusae.ActivityHelper;
import paulscode.android.mupen64plusae.cheat.CheatUtils.Cheat;
+import paulscode.android.mupen64plusae.compat.AppCompatListActivity;
import paulscode.android.mupen64plusae.dialog.Prompt;
import paulscode.android.mupen64plusae.dialog.Prompt.PromptTextListener;
import paulscode.android.mupen64plusae.persistent.AppData;
@@ -37,7 +38,6 @@
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
-import android.app.ListActivity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
@@ -57,7 +57,7 @@
import android.widget.TextView;
import android.widget.Toast;
-public class CheatEditorActivity extends ListActivity implements View.OnClickListener, OnItemLongClickListener
+public class CheatEditorActivity extends AppCompatListActivity implements View.OnClickListener, OnItemLongClickListener
{
private static class CheatListAdapter extends ArrayAdapter<Cheat>
{
@@ -0,0 +1,140 @@
+/**
+ * Mupen64PlusAE, an N64 emulator for the Android platform
+ *
+ * Copyright (C) 2013 Paul Lamb
+ *
+ * This file is part of Mupen64PlusAE.
+ *
+ * Mupen64PlusAE is free software: you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * Mupen64PlusAE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Mupen64PlusAE. If
+ * not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: littleguy77
+ */
+package paulscode.android.mupen64plusae.compat;
+
+import android.app.ListActivity;
+import android.content.res.Configuration;
+import android.os.Bundle;
+import android.support.v7.app.ActionBar;
+import android.support.v7.app.AppCompatDelegate;
+import android.support.v7.widget.Toolbar;
+import android.view.MenuInflater;
+import android.view.View;
+import android.view.ViewGroup.LayoutParams;
+
+public class AppCompatListActivity extends ListActivity
+{
+ // Material Design theming (since we cannot inherit from AppCompatActivity)
+ protected AppCompatDelegate mDelegate;
+
+ public AppCompatDelegate getDelegate()
+ {
+ if( mDelegate == null )
+ mDelegate = AppCompatDelegate.create( this, null );
+ return mDelegate;
+ }
+
+ @Override
+ public void addContentView( View view, LayoutParams params )
+ {
+ getDelegate().addContentView( view, params );
+ }
+
+ @Override
+ public MenuInflater getMenuInflater()
+ {
+ return getDelegate().getMenuInflater();
+ }
+
+ public ActionBar getSupportActionBar()
+ {
+ return getDelegate().getSupportActionBar();
+ }
+
+ @Override
+ public void invalidateOptionsMenu()
+ {
+ getDelegate().invalidateOptionsMenu();
+ }
+
+ @Override
+ public void onConfigurationChanged( Configuration newConfig )
+ {
+ super.onConfigurationChanged( newConfig );
+ getDelegate().onConfigurationChanged( newConfig );
+ }
+
+ @Override
+ protected void onCreate( Bundle savedInstanceState )
+ {
+ getDelegate().installViewFactory();
+ getDelegate().onCreate( savedInstanceState );
+ super.onCreate( savedInstanceState );
+ }
+
+ @Override
+ protected void onDestroy()
+ {
+ super.onDestroy();
+ getDelegate().onDestroy();
+ }
+
+ @Override
+ protected void onPostCreate( Bundle savedInstanceState )
+ {
+ super.onPostCreate( savedInstanceState );
+ getDelegate().onPostCreate( savedInstanceState );
+ }
+
+ @Override
+ protected void onPostResume()
+ {
+ super.onPostResume();
+ getDelegate().onPostResume();
+ }
+
+ @Override
+ protected void onStop()
+ {
+ super.onStop();
+ getDelegate().onStop();
+ }
+
+ @Override
+ protected void onTitleChanged( CharSequence title, int color )
+ {
+ super.onTitleChanged( title, color );
+ getDelegate().setTitle( title );
+ }
+
+ @Override
+ public void setContentView( int layoutResID )
+ {
+ getDelegate().setContentView( layoutResID );
+ }
+
+ @Override
+ public void setContentView( View view )
+ {
+ getDelegate().setContentView( view );
+ }
+
+ @Override
+ public void setContentView( View view, LayoutParams params )
+ {
+ getDelegate().setContentView( view, params );
+ }
+
+ public void setSupportActionBar( Toolbar toolbar )
+ {
+ getDelegate().setSupportActionBar( toolbar );
+ }
+}
@@ -0,0 +1,140 @@
+/**
+ * Mupen64PlusAE, an N64 emulator for the Android platform
+ *
+ * Copyright (C) 2013 Paul Lamb
+ *
+ * This file is part of Mupen64PlusAE.
+ *
+ * Mupen64PlusAE is free software: you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * Mupen64PlusAE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Mupen64PlusAE. If
+ * not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: littleguy77
+ */
+package paulscode.android.mupen64plusae.compat;
+
+import android.content.res.Configuration;
+import android.os.Bundle;
+import android.preference.PreferenceActivity;
+import android.support.v7.app.ActionBar;
+import android.support.v7.app.AppCompatDelegate;
+import android.support.v7.widget.Toolbar;
+import android.view.MenuInflater;
+import android.view.View;
+import android.view.ViewGroup.LayoutParams;
+
+public class AppCompatPreferenceActivity extends PreferenceActivity
+{
+ // Material Design theming (since we cannot inherit from AppCompatActivity)
+ protected AppCompatDelegate mDelegate;
+
+ public AppCompatDelegate getDelegate()
+ {
+ if( mDelegate == null )
+ mDelegate = AppCompatDelegate.create( this, null );
+ return mDelegate;
+ }
+
+ @Override
+ public void addContentView( View view, LayoutParams params )
+ {
+ getDelegate().addContentView( view, params );
+ }
+
+ @Override
+ public MenuInflater getMenuInflater()
+ {
+ return getDelegate().getMenuInflater();
+ }
+
+ public ActionBar getSupportActionBar()
+ {
+ return getDelegate().getSupportActionBar();
+ }
+
+ @Override
+ public void invalidateOptionsMenu()
+ {
+ getDelegate().invalidateOptionsMenu();
+ }
+
+ @Override
+ public void onConfigurationChanged( Configuration newConfig )
+ {
+ super.onConfigurationChanged( newConfig );
+ getDelegate().onConfigurationChanged( newConfig );
+ }
+
+ @Override
+ protected void onCreate( Bundle savedInstanceState )
+ {
+ getDelegate().installViewFactory();
+ getDelegate().onCreate( savedInstanceState );
+ super.onCreate( savedInstanceState );
+ }
+
+ @Override
+ protected void onDestroy()
+ {
+ super.onDestroy();
+ getDelegate().onDestroy();
+ }
+
+ @Override
+ protected void onPostCreate( Bundle savedInstanceState )
+ {
+ super.onPostCreate( savedInstanceState );
+ getDelegate().onPostCreate( savedInstanceState );
+ }
+
+ @Override
+ protected void onPostResume()
+ {
+ super.onPostResume();
+ getDelegate().onPostResume();
+ }
+
+ @Override
+ protected void onStop()
+ {
+ super.onStop();
+ getDelegate().onStop();
+ }
+
+ @Override
+ protected void onTitleChanged( CharSequence title, int color )
+ {
+ super.onTitleChanged( title, color );
+ getDelegate().setTitle( title );
+ }
+
+ @Override
+ public void setContentView( int layoutResID )
+ {
+ getDelegate().setContentView( layoutResID );
+ }
+
+ @Override
+ public void setContentView( View view )
+ {
+ getDelegate().setContentView( view );
+ }
+
+ @Override
+ public void setContentView( View view, LayoutParams params )
+ {
+ getDelegate().setContentView( view, params );
+ }
+
+ public void setSupportActionBar( Toolbar toolbar )
+ {
+ getDelegate().setSupportActionBar( toolbar );
+ }
+}
Oops, something went wrong.

0 comments on commit 066f730

Please sign in to comment.