2019-01-31 00:07:32 +00:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2019-01-06 04:15:09 +00:00
|
|
|
|
|
|
|
|
|
using Android.App;
|
|
|
|
|
using Android.Content.PM;
|
2019-01-31 00:07:32 +00:00
|
|
|
|
using Android.OS;
|
|
|
|
|
using Android.Views;
|
2019-01-06 04:15:09 +00:00
|
|
|
|
using osu.Framework.Android;
|
|
|
|
|
|
|
|
|
|
namespace osu.Android
|
|
|
|
|
{
|
2019-06-25 22:54:14 +00:00
|
|
|
|
[Activity(Theme = "@android:style/Theme.NoTitleBar", MainLauncher = true, ScreenOrientation = ScreenOrientation.FullSensor, SupportsPictureInPicture = false, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize, HardwareAccelerated = true)]
|
2019-01-06 04:15:09 +00:00
|
|
|
|
public class OsuGameActivity : AndroidGameActivity
|
|
|
|
|
{
|
2019-03-17 14:39:07 +00:00
|
|
|
|
protected override Framework.Game CreateGame() => new OsuGameAndroid();
|
2019-01-31 00:07:32 +00:00
|
|
|
|
|
|
|
|
|
protected override void OnCreate(Bundle savedInstanceState)
|
|
|
|
|
{
|
2019-10-14 19:46:01 +00:00
|
|
|
|
// The default current directory on android is '/'.
|
|
|
|
|
// On some devices '/' maps to the app data directory. On others it maps to the root of the internal storage.
|
2019-10-20 20:29:29 +00:00
|
|
|
|
// In order to have a consistent current directory on all devices the full path of the app data directory is set as the current directory.
|
2019-10-14 19:46:01 +00:00
|
|
|
|
System.Environment.CurrentDirectory = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
|
|
|
|
|
|
2019-01-31 00:07:32 +00:00
|
|
|
|
base.OnCreate(savedInstanceState);
|
|
|
|
|
|
|
|
|
|
Window.AddFlags(WindowManagerFlags.Fullscreen);
|
|
|
|
|
Window.AddFlags(WindowManagerFlags.KeepScreenOn);
|
|
|
|
|
}
|
2019-01-06 04:15:09 +00:00
|
|
|
|
}
|
|
|
|
|
}
|