Take windows setting into account to Disable/Enable animations (#748)
This commit is contained in:
@@ -195,7 +195,8 @@ void Calculator::UpdateViewState()
|
||||
|
||||
void Calculator::AnimateCalculator(bool resultAnimate)
|
||||
{
|
||||
if (App::IsAnimationEnabled())
|
||||
static auto uiSettings = ref new UISettings();
|
||||
if (uiSettings->AnimationsEnabled)
|
||||
{
|
||||
m_doAnimate = true;
|
||||
m_resultAnimate = resultAnimate;
|
||||
|
||||
@@ -46,7 +46,6 @@ static const long long DURATION_500_MS = 10000 * 500;
|
||||
|
||||
UnitConverter::UnitConverter()
|
||||
: m_meteredConnectionOverride(false)
|
||||
, m_isAnimationEnabled(false)
|
||||
{
|
||||
m_layoutDirection = LocalizationService::GetInstance()->GetFlowDirection();
|
||||
m_FlowDirectionHorizontalAlignment = m_layoutDirection == ::FlowDirection::RightToLeft ? ::HorizontalAlignment::Right : ::HorizontalAlignment::Left;
|
||||
@@ -60,9 +59,6 @@ UnitConverter::UnitConverter()
|
||||
bool preferRight = LocalizationSettings::GetInstance().GetCurrencySymbolPrecedence() == 0;
|
||||
VisualStateManager::GoToState(this, preferRight ? "CurrencySymbolRightState" : "CurrencySymbolLeftState", false);
|
||||
|
||||
auto userSettings = ref new UISettings();
|
||||
m_isAnimationEnabled = userSettings->AnimationsEnabled;
|
||||
|
||||
auto resLoader = AppResourceProvider::GetInstance();
|
||||
m_chargesMayApplyText = resLoader->GetResourceString(L"DataChargesMayApply");
|
||||
m_failedToRefreshText = resLoader->GetResourceString(L"FailedToRefresh");
|
||||
@@ -250,7 +246,8 @@ void UnitConverter::OnPasteMenuItemClicked(_In_ Object ^ sender, _In_ RoutedEven
|
||||
|
||||
void UnitConverter::AnimateConverter()
|
||||
{
|
||||
if (App::IsAnimationEnabled())
|
||||
static auto uiSettings = ref new UISettings();
|
||||
if (uiSettings->AnimationsEnabled)
|
||||
{
|
||||
AnimationStory->Begin();
|
||||
}
|
||||
@@ -332,7 +329,7 @@ void UnitConverter::OnIsDisplayVisibleChanged()
|
||||
|
||||
if (Model->IsCurrencyCurrentCategory && !Model->CurrencyTimestamp->IsEmpty())
|
||||
{
|
||||
VisualStateManager::GoToState(this, L"CurrencyLoadedState", m_isAnimationEnabled);
|
||||
VisualStateManager::GoToState(this, L"CurrencyLoadedState", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,6 @@ namespace CalculatorApp
|
||||
|
||||
Windows::UI::Xaml::DispatcherTimer ^ m_delayTimer;
|
||||
|
||||
bool m_isAnimationEnabled;
|
||||
void SupplementaryResultsPanelInGrid_SizeChanged(Platform::Object ^ sender, Windows::UI::Xaml::SizeChangedEventArgs ^ e);
|
||||
void OnVisualStateChanged(Platform::Object ^ sender, Windows::UI::Xaml::VisualStateChangedEventArgs ^ e);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user