public void sendUpdate(Clock clock) { float blendPercent = currentTime / animationDuration; if (showing) { if (blendPercent > 1.0f) { childLayout.setAlpha(1.0f); unsubscribeFromUpdates(); } else { childLayout.setAlpha(blendPercent); } } else { if (blendPercent > 1.0f) { childLayout.setAlpha(0.0f); unsubscribeFromUpdates(); if (animationComplete != null) { animationComplete.Invoke(null); } } childLayout.setAlpha(1.0f - blendPercent); } }