1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 06:33:20 +08:00

Apply review suggestions.

This commit is contained in:
Lucas A 2020-02-13 20:08:14 +01:00
parent b9e10cb498
commit dac0148c94
2 changed files with 7 additions and 11 deletions

View File

@ -32,7 +32,7 @@ namespace osu.Game.Tests.Visual.Online
{ {
public new LoadingAnimation LoadingAnimation => base.LoadingAnimation; public new LoadingAnimation LoadingAnimation => base.LoadingAnimation;
public CompositeDrawable ViewTarget => base.Content.Parent; public CompositeDrawable ViewTarget => base.Content;
public TestOnlineViewContainer() public TestOnlineViewContainer()
: base(@"Please sign in to view dummy test content") : base(@"Please sign in to view dummy test content")

View File

@ -21,8 +21,8 @@ namespace osu.Game.Online
protected const double TRANSFORM_TIME = 300.0; protected const double TRANSFORM_TIME = 300.0;
private readonly Container viewTarget; private Container viewContent;
protected override Container<Drawable> Content { get; } protected override Container<Drawable> Content => viewContent;
[Resolved] [Resolved]
protected IAPIProvider API { get; private set; } protected IAPIProvider API { get; private set; }
@ -31,13 +31,9 @@ namespace osu.Game.Online
{ {
InternalChildren = new Drawable[] InternalChildren = new Drawable[]
{ {
viewTarget = new Container viewContent = new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Child = Content = new Container
{
RelativeSizeAxes = Axes.Both,
}
}, },
placeholder = new LoginPlaceholder(placeholderMessage), placeholder = new LoginPlaceholder(placeholderMessage),
LoadingAnimation = new LoadingAnimation LoadingAnimation = new LoadingAnimation
@ -52,21 +48,21 @@ namespace osu.Game.Online
switch (state) switch (state)
{ {
case APIState.Offline: case APIState.Offline:
PopContentOut(viewTarget); PopContentOut(viewContent);
placeholder.ScaleTo(0.8f).Then().ScaleTo(1, 3 * TRANSFORM_TIME, Easing.OutQuint); placeholder.ScaleTo(0.8f).Then().ScaleTo(1, 3 * TRANSFORM_TIME, Easing.OutQuint);
placeholder.FadeInFromZero(2 * TRANSFORM_TIME, Easing.OutQuint); placeholder.FadeInFromZero(2 * TRANSFORM_TIME, Easing.OutQuint);
LoadingAnimation.Hide(); LoadingAnimation.Hide();
break; break;
case APIState.Online: case APIState.Online:
PopContentIn(viewTarget); PopContentIn(viewContent);
placeholder.FadeOut(TRANSFORM_TIME / 2, Easing.OutQuint); placeholder.FadeOut(TRANSFORM_TIME / 2, Easing.OutQuint);
LoadingAnimation.Hide(); LoadingAnimation.Hide();
break; break;
case APIState.Failing: case APIState.Failing:
case APIState.Connecting: case APIState.Connecting:
PopContentOut(viewTarget); PopContentOut(viewContent);
LoadingAnimation.Show(); LoadingAnimation.Show();
placeholder.FadeOut(TRANSFORM_TIME / 2, Easing.OutQuint); placeholder.FadeOut(TRANSFORM_TIME / 2, Easing.OutQuint);
break; break;