Browse Source

Ensure all Android entry points are called MainActivity

Dominique Louis 3 tuần trước cách đây
mục cha
commit
4d66891287

+ 1 - 1
BackgroundThreadTester/Platforms/Android/Program.cs → BackgroundThreadTester/Platforms/Android/MainActivity.cs

@@ -7,7 +7,7 @@ using Microsoft.Xna.Framework;
 namespace BackgroundThreadTester
 {
     [Activity(Label = "BackgroundThreadTester", MainLauncher = true, Icon = "@drawable/icon", Theme = "@style/Theme.Splash", AlwaysRetainTaskState = true, LaunchMode = LaunchMode.SingleInstance, ScreenOrientation = ScreenOrientation.FullUser, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize | ConfigChanges.ScreenLayout)]
-    public class Activity1 : AndroidGameActivity
+    public class MainActivity : AndroidGameActivity
     {
         protected override void OnCreate(Bundle bundle)
         {

+ 0 - 0
CatapultWars/Platforms/Android/Activity1.cs → CatapultWars/Platforms/Android/MainActivity.cs


+ 1 - 1
CatapultWars/README.md

@@ -63,7 +63,7 @@ dotnet build Platforms/iOS/CatapultWars.iOS.csproj
 ## Supported Platforms
 - Windows (DirectX)
 - DesktopGL (cross-platform)
-- Android (entry point: `Activity1.cs`)
+- Android (entry point: `MainActivity.cs`)
 - iOS (Info.plist included, not tested)
 
 ---

+ 1 - 1
CollisionSample/Platforms/Android/Activity1.cs → CollisionSample/Platforms/Android/MainActivity.cs

@@ -16,7 +16,7 @@ namespace CollisionSample
         ScreenOrientation = ScreenOrientation.FullSensor,
         ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize
     )]
-    public class Activity1 : AndroidGameActivity
+    public class MainActivity : AndroidGameActivity
     {
         private CollisionGame _game;
         private View _view;

+ 1 - 1
Draw2D/Platforms/Android/Activity1.cs → Draw2D/Platforms/Android/MainActivity.cs

@@ -12,7 +12,7 @@ namespace Draw2D
         ScreenOrientation = ScreenOrientation.SensorLandscape,
         ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize
     )]
-    public class Activity1 : AndroidGameActivity
+    public class MainActivity : AndroidGameActivity
     {
         private Game1 _game;
 

+ 1 - 1
FarseerPhysics/FarseerSamples/Platforms/Android/Activity1.cs → FarseerPhysics/FarseerSamples/Platforms/Android/MainActivity.cs

@@ -15,7 +15,7 @@ namespace FarseerPhysics
         ScreenOrientation = ScreenOrientation.Landscape,
         ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize
     )]
-    public class Activity1 : Microsoft.Xna.Framework.AndroidGameActivity
+    public class MainActivity : AndroidGameActivity
     {
         private FarseerPhysicsGame _game;
         private View _view;

+ 1 - 1
Flocking/Platforms/Android/Activity1.cs → Flocking/Platforms/Android/MainActivity.cs

@@ -15,7 +15,7 @@ namespace Flocking.Android
         ScreenOrientation = ScreenOrientation.Landscape,
         ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize
     )]
-    public class Activity1 : AndroidGameActivity
+    public class MainActivity : AndroidGameActivity
     {
         private FlockingSample _game;
         private View _view;

+ 1 - 1
GameComponents/Platforms/Android/Activity1.cs → GameComponents/Platforms/Android/MainActivity.cs

@@ -15,7 +15,7 @@ namespace GameComponents.Android
         ScreenOrientation = ScreenOrientation.FullUser,
         ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize
     )]
-    public class Activity1 : AndroidGameActivity
+    public class MainActivity : AndroidGameActivity
     {
         private Game1 game;
         private View gameView;

+ 1 - 1
GameDevelopmentbyExample/GemstoneHunter/Platforms/Android/Program.cs → GameDevelopmentbyExample/GemstoneHunter/Platforms/Android/MainActivity.cs

@@ -8,7 +8,7 @@ namespace GemstoneHunter.Android
 {
     [Activity(Label = "Gemstone Hunter", MainLauncher = true, Icon = "@drawable/icon", 
               ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden)]
-    public class Activity1 : AndroidGameActivity
+    public class MainActivity : AndroidGameActivity
     {
         private GemstoneHunterGame _game;
 

+ 1 - 1
Input/README.md

@@ -84,7 +84,7 @@ dotnet run --project Input.DesktopGL.csproj
 - `Program.Windows.cs` - Windows platform entry point
 - `Program.DesktopGL.cs` - DesktopGL platform entry point
 - `Program.iOS.cs` - iOS platform entry point
-- `Activity1.cs` - Android activity
+- `MainActivity.cs` - Android activity
 - `Content/` - Game assets (sprite fonts, textures)
 - `Properties/AndroidManifest.xml` - Android app configuration
 - `Info.iOS.plist` - iOS app configuration

+ 1 - 2
MultiTouch/Platforms/Android/MainActivity.cs

@@ -1,4 +1,3 @@
-// ...existing code from Activity1.cs will be moved here...
 using Android.App;
 using Android.Content.PM;
 using Android.OS;
@@ -16,7 +15,7 @@ namespace Microsoft.Xna.Samples.MultiTouch
         LaunchMode = LaunchMode.SingleInstance,
         ScreenOrientation = ScreenOrientation.FullUser,
         ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize | ConfigChanges.ScreenLayout)]
-    public class Activity1 : AndroidGameActivity
+    public class MainActivity : AndroidGameActivity
     {
         private Game1 _game;
 

+ 1 - 1
MultiTouch/README.md

@@ -95,7 +95,7 @@ Or use the launch configurations in `.vscode/launch.json` for debugging.
         Program.cs
     /Android
         MultiTouch.Android.csproj
-        Activity1.cs
+        MainActivity.cs
     /iOS
         MultiTouch.iOS.csproj
         Program.cs

+ 1 - 1
Orientation/Platforms/Android/MainActivity.cs

@@ -16,7 +16,7 @@ namespace OrientationSample.Android
 	           Theme = "@style/Theme.Splash",
 	           ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden,
 	           ScreenOrientation = ScreenOrientation.Landscape)]
-	public class Activity1 : AndroidGameActivity
+	public class MainActivity : AndroidGameActivity
 	{
 	protected override void OnCreate (Bundle bundle)
 	{

+ 1 - 1
Peer2PeerSample/README.md

@@ -104,7 +104,7 @@ No Content.mgcb file is needed as the project uses the existing compiled content
 ```
 ├── PeerToPeerGame.cs          # Main game class
 ├── Program.cs                 # Platform-specific entry points
-├── Activity1.cs               # Android activity
+├── MainActivity.cs            # Android activity
 ├── Tank.cs                    # Tank game object
 ├── Content/                   # Game assets (.xnb files)
 ├── Properties/                # Platform manifests

+ 1 - 1
RenderTarget2DSample/README.md

@@ -72,7 +72,7 @@ dotnet build RenderTarget2D.iOS.csproj
 
 - `Game1.cs` - Main game class with render target logic
 - `Program.cs` - Entry points for different platforms
-- `Activity1.cs` - Android-specific activity
+- `MainActivity.cs` - Android-specific activity
 - `Content/` - Game assets (.xnb files)
 - `Properties/` - Platform-specific manifests and settings
 - `Resources/` - Android-specific resources