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 @@ private class TestOnlineViewContainer : OnlineViewContainer
{
public new LoadingAnimation LoadingAnimation => base.LoadingAnimation;
public CompositeDrawable ViewTarget => base.Content.Parent;
public CompositeDrawable ViewTarget => base.Content;
public TestOnlineViewContainer()
: base(@"Please sign in to view dummy test content")

View File

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