| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using Android.App;
- using Android.Content.PM;
- using Android.Views;
- using Android.Widget;
- using Android.OS;
- using Urho.Droid;
- namespace $safeprojectname$
- {
- [Activity(Label = "$safeprojectname$", 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 = UrhoSurface.CreateSurface<MyGame>(this);
- mLayout.AddView(surface);
- SetContentView(mLayout);
- }
- protected override void OnResume()
- {
- UrhoSurface.OnResume();
- base.OnResume();
- }
- protected override void OnPause()
- {
- UrhoSurface.OnPause();
- base.OnPause();
- }
- public override void OnLowMemory()
- {
- UrhoSurface.OnLowMemory();
- base.OnLowMemory();
- }
- protected override void OnDestroy()
- {
- UrhoSurface.OnDestroy();
- base.OnDestroy();
- }
- public override bool DispatchKeyEvent(KeyEvent e)
- {
- if (!UrhoSurface.DispatchKeyEvent(e))
- return false;
- return base.DispatchKeyEvent(e);
- }
- public override void OnWindowFocusChanged(bool hasFocus)
- {
- UrhoSurface.OnWindowFocusChanged(hasFocus);
- base.OnWindowFocusChanged(hasFocus);
- }
- }
- }
|