Apply review suggestions.

This commit is contained in:
Lucas A
2020-10-16 19:21:51 +02:00
parent e823575751
commit b60dfc55b6
2 changed files with 4 additions and 4 deletions

View File

@ -17,14 +17,14 @@ namespace osu.Android
private void load(OsuGame game) private void load(OsuGame game)
{ {
localUserPlaying = game.LocalUserPlaying.GetBoundCopy(); localUserPlaying = game.LocalUserPlaying.GetBoundCopy();
localUserPlaying.BindValueChanged(_ => updateLock()); localUserPlaying.BindValueChanged(userPlaying => updateLock(userPlaying));
} }
private void updateLock() private void updateLock(ValueChangedEvent<bool> userPlaying)
{ {
OsuGameActivity.Activity.RunOnUiThread(() => OsuGameActivity.Activity.RunOnUiThread(() =>
{ {
OsuGameActivity.Activity.RequestedOrientation = localUserPlaying.Value ? ScreenOrientation.Locked : ScreenOrientation.FullUser; OsuGameActivity.Activity.RequestedOrientation = userPlaying.NewValue ? ScreenOrientation.Locked : ScreenOrientation.FullUser;
}); });
} }
} }

View File

@ -12,7 +12,7 @@ namespace osu.Android
[Activity(Theme = "@android:style/Theme.NoTitleBar", MainLauncher = true, ScreenOrientation = ScreenOrientation.FullUser, SupportsPictureInPicture = false, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize, HardwareAccelerated = false)] [Activity(Theme = "@android:style/Theme.NoTitleBar", MainLauncher = true, ScreenOrientation = ScreenOrientation.FullUser, SupportsPictureInPicture = false, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize, HardwareAccelerated = false)]
public class OsuGameActivity : AndroidGameActivity public class OsuGameActivity : AndroidGameActivity
{ {
internal static Activity Activity; internal static Activity Activity { get; private set; }
protected override Framework.Game CreateGame() => new OsuGameAndroid(); protected override Framework.Game CreateGame() => new OsuGameAndroid();