| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- using Android.App;
- using Android.Content.PM;
- using Android.Widget;
- using Android.OS;
- using Android.Views;
- using AtomicEngine;
- namespace AtomicPlayer
- {
- [Activity(Label = "AtomicPlayer", MainLauncher = true,
- Icon = "@drawable/icon", Theme = "@android:style/Theme.NoTitleBar.Fullscreen",
- ConfigurationChanges = ConfigChanges.KeyboardHidden | ConfigChanges.Orientation,
- ScreenOrientation = ScreenOrientation.Landscape)]
- public class MainActivity : Activity
- {
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
- var mLayout = new AbsoluteLayout(this);
- var surface = AndroidSDLSurface.CreateSurface(this, false, typeof(AtomicMain));
- mLayout.AddView(surface);
- SetContentView(mLayout);
- }
- protected override void OnResume()
- {
- AndroidSDLSurface.OnResume();
- base.OnResume();
- }
- protected override void OnPause()
- {
- AndroidSDLSurface.OnPause();
- base.OnPause();
- }
- public override void OnLowMemory()
- {
- AndroidSDLSurface.OnLowMemory();
- base.OnLowMemory();
- }
- protected override void OnDestroy()
- {
- AndroidSDLSurface.OnDestroy();
- base.OnDestroy();
- }
- public override bool DispatchKeyEvent(KeyEvent e)
- {
- if (!AndroidSDLSurface.DispatchKeyEvent(e))
- return false;
- return base.DispatchKeyEvent(e);
- }
- public override void OnWindowFocusChanged(bool hasFocus)
- {
- AndroidSDLSurface.OnWindowFocusChanged(hasFocus);
- base.OnWindowFocusChanged(hasFocus);
- }
- }
- }
|