static HumanEffortComputer() { BySpeed = new EffortComputer( new List <EffortSpan> { new EffortSpan(0f, ResourcesHelper.GetResourceColor("ColorEffortSpeedMin"), /*Functions.Resources.GetLocalisedRes(typeof(Resx.resources),nameof(Resx.resources.PaceVeryLight)*/ "VERY LIGHT"), new EffortSpan(0.7f, ResourcesHelper.GetResourceColor("ColorEffortAnaerobic"), /*Functions.Resources.GetLocalisedRes(typeof(Resx.resources),nameof(Resx.resources.PaceAnaerobic)*/ "ANAEROBIC"), new EffortSpan(0.95f, ResourcesHelper.GetResourceColor("ColorEffortMax"), /*Functions.Resources.GetLocalisedRes(typeof(Resx.resources),nameof(Resx.resources.PaceMax)*/ "MAX"), }, 40); }
private async Task AnimateTabButton() { double sourceScale = TabButton.Scale; Color sourceColor = TabButton.ButtonBackgroundColor; Color targetColor = _currentAppTheme == AppTheme.Light ? ResourcesHelper.GetResourceColor("DarkSurface") : Color.White; await TabButton.ScaleTo(3); await TabButton.ScaleTo(sourceScale); TabButton.IconImageSource = null; var bigScaleTask = TabButton.ScaleTo(30, length: 500); var colorChangeTask = TabButton.ColorTo( sourceColor, targetColor, callback: c => TabButton.ButtonBackgroundColor = c, length: 500); await Task.WhenAll(bigScaleTask, colorChangeTask); if (_currentAppTheme == AppTheme.AcrylicBlur) { _currentAppTheme = AppTheme.Light; } else { _currentAppTheme += 1; } ApplyTheme(); var reverseBigScaleTask = TabButton.ScaleTo(sourceScale, length: 500); var reverseColorChangeTask = TabButton.ColorTo( targetColor, sourceColor, c => TabButton.ButtonBackgroundColor = c, length: 500); await Task.WhenAll(reverseBigScaleTask, reverseColorChangeTask); TabButton.IconImageSource = "theme_96.png"; }
private void BlurStyleButtonOnClicked(object sender, EventArgs e) { var selectedButton = (Button)sender; if (selectedButton == LightButton) { _blurStyle = Sharpnado.MaterialFrame.MaterialFrame.BlurStyle.Light; } else if (selectedButton == DarkButton) { _blurStyle = Sharpnado.MaterialFrame.MaterialFrame.BlurStyle.Dark; } else { _blurStyle = Sharpnado.MaterialFrame.MaterialFrame.BlurStyle.ExtraLight; } ResourcesHelper.SetBlurStyle(_blurStyle); selectedButton.TextColor = _blurStyle != Sharpnado.MaterialFrame.MaterialFrame.BlurStyle.ExtraLight ? ResourcesHelper.GetResourceColor("TextPrimaryColor") : ResourcesHelper.GetResourceColor("TextPrimaryDarkColor"); selectedButton.BackgroundColor = ResourcesHelper.GetResourceColor(ResourcesHelper.DynamicPrimaryColor); foreach (var button in _blurStyleButtons) { if (button == selectedButton) { continue; } button.TextColor = _blurStyle != Sharpnado.MaterialFrame.MaterialFrame.BlurStyle.ExtraLight ? ResourcesHelper.GetResourceColor("TextPrimaryDarkColor") : ResourcesHelper.GetResourceColor("TextPrimaryColor"); button.BackgroundColor = Color.Transparent; } }
static HumanEffortComputer() { ByHeartBeat = new EffortComputer( new List <EffortSpan> { new EffortSpan(0f, ResourcesHelper.GetResourceColor("ColorEffortUnknown"), AppResources.PaceUnknown), new EffortSpan(0.3f, ResourcesHelper.GetResourceColor("ColorEffortLightest"), AppResources.PaceVeryLight), new EffortSpan(0.6f, ResourcesHelper.GetResourceColor("ColorEffortLight"), AppResources.PaceLight), new EffortSpan(0.7f, ResourcesHelper.GetResourceColor("ColorEffortAerobic"), AppResources.PaceAerobic), new EffortSpan(0.8f, ResourcesHelper.GetResourceColor("ColorEffortAnaerobic"), AppResources.PaceAnaerobic), new EffortSpan(0.9f, ResourcesHelper.GetResourceColor("ColorEffortMax"), AppResources.PaceMax), }, 180); BySpeed = new EffortComputer( new List <EffortSpan> { new EffortSpan(0f, ResourcesHelper.GetResourceColor("ColorEffortSpeedMin"), AppResources.PaceVeryLight), new EffortSpan(0.7f, ResourcesHelper.GetResourceColor("ColorEffortAnaerobic"), AppResources.PaceAnaerobic), new EffortSpan(0.95f, ResourcesHelper.GetResourceColor("ColorEffortMax"), AppResources.PaceMax), }, 40); }