<PropertyGroup>
<OutputType>Exe</OutputType>
- <TargetFramework>tizen90</TargetFramework>
+ <TargetFramework>tizen10.0</TargetFramework>
<TargetFrameworkIdentifier>Tizen</TargetFrameworkIdentifier>
<CodeAnalysisRuleSet>Settings.StyleCop</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Tizen.NET.Sdk" Version="1.1.2" />
- <PackageReference Include="Tizen.NET" Version="9.0.0.16751" />
+ <PackageReference Include="Tizen.NET" Version="10.0.0.17007" />
<PackageReference Include="Tizen.NUI.XamlBuild" Version="1.0.11" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<EmbeddedResource Include="res\layout\*.xaml" />
</ItemGroup>
+ <PropertyGroup>
+ <NeedInjection>False</NeedInjection>
+ </PropertyGroup>
+
</Project>
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-using System;
-using Tizen.NUI;
-
-namespace Fitness.Views
-{
- /// <summary>
- /// Utils for converting dp pixels.
- /// </summary>
- public static class DpUtils
- {
- private const float DpPixelDivider = 1.48125f;
-
- /// <summary>
- /// Converts dp pixels into pixels.
- /// </summary>
- /// <param name="pixels">The number of dp pixels.</param>
- /// <returns>The number of pixels.</returns>
- public static int DpToPixels(int pixels)
- {
- return (int)Math.Round(DpTypeConverter.Instance.ConvertToPixel(pixels / DpPixelDivider), MidpointRounding.AwayFromZero);
- }
-
- /// <summary>
- /// Converts dp pixels into pixels.
- /// </summary>
- /// <param name="pixels">The number of dp pixels.</param>
- /// <returns>The number of pixels.</returns>
- public static ushort DpToPixels(ushort pixels)
- {
- return (ushort)Math.Round(DpTypeConverter.Instance.ConvertToPixel(pixels / DpPixelDivider), MidpointRounding.AwayFromZero);
- }
-
- /// <summary>
- /// Converts dp pixels into pixels.
- /// </summary>
- /// <param name="pixels">The number of dp pixels.</param>
- /// <returns>The number of pixels.</returns>
- public static float DpToPixels(float pixels)
- {
- return DpTypeConverter.Instance.ConvertToPixel(pixels / DpPixelDivider);
- }
-
- /// <summary>
- /// Converts dp pixels into pixels.
- /// </summary>
- /// <param name="size">The size to be converted to pixels.</param>
- /// <returns>The number of pixels.</returns>
- public static Size2D DpToPixels(Size2D size)
- {
- return new Size2D(DpToPixels(size.Width), DpToPixels(size.Height));
- }
-
- /// <summary>
- /// Converts dp pixels into pixels.
- /// </summary>
- /// <param name="extents">The extents collection to be converted to pixels.</param>
- /// <returns>The number of pixels.</returns>
- public static Extents DpToPixels(Extents extents)
- {
- return new Extents(DpToPixels(extents.Start), DpToPixels(extents.End), DpToPixels(extents.Top), DpToPixels(extents.Bottom));
- }
- }
-}
/// <inheritdoc/>
public object ProvideValue(IServiceProvider serviceProvider)
{
- return new Extents(DpUtils.DpToPixels(Start), DpUtils.DpToPixels(End), DpUtils.DpToPixels(Top), DpUtils.DpToPixels(Bottom));
+ return new Extents(SpUtils.SpToPixels(Start), SpUtils.SpToPixels(End), SpUtils.SpToPixels(Top), SpUtils.SpToPixels(Bottom));
}
}
}
/// <inheritdoc/>
public object ProvideValue(IServiceProvider serviceProvider)
{
- return DpUtils.DpToPixels(DpSize);
+ return SpUtils.SpToPixels(DpSize);
}
}
}
/// <inheritdoc/>
public object ProvideValue(IServiceProvider serviceProvider)
{
- return new Position(DpUtils.DpToPixels(X), DpUtils.DpToPixels(Y));
+ return new Position(SpUtils.SpToPixels(X), SpUtils.SpToPixels(Y));
}
}
}
/// <inheritdoc/>
public object ProvideValue(IServiceProvider serviceProvider)
{
- return new Size2D(DpUtils.DpToPixels(Width), DpUtils.DpToPixels(Height));
+ return new Size2D(SpUtils.SpToPixels(Width), SpUtils.SpToPixels(Height));
}
}
}
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using Tizen.NUI;
+
+namespace Fitness.Views
+{
+ /// <summary>
+ /// Utils for converting sp pixels.
+ /// </summary>
+ public static class SpUtils
+ {
+ private const float SpPixelDivider = 1.48125f;
+
+ /// <summary>
+ /// Converts sp pixels into pixels.
+ /// </summary>
+ /// <param name="pixels">The number of sp pixels.</param>
+ /// <returns>The number of pixels.</returns>
+ public static int SpToPixels(int pixels)
+ {
+ return (int)Math.Round(SpTypeConverter.Instance.ConvertToPixel(pixels / SpPixelDivider), MidpointRounding.AwayFromZero);
+ }
+
+ /// <summary>
+ /// Converts sp pixels into pixels.
+ /// </summary>
+ /// <param name="pixels">The number of sp pixels.</param>
+ /// <returns>The number of pixels.</returns>
+ public static ushort SpToPixels(ushort pixels)
+ {
+ return (ushort)Math.Round(SpTypeConverter.Instance.ConvertToPixel(pixels / SpPixelDivider), MidpointRounding.AwayFromZero);
+ }
+
+ /// <summary>
+ /// Converts sp pixels into pixels.
+ /// </summary>
+ /// <param name="pixels">The number of sp pixels.</param>
+ /// <returns>The number of pixels.</returns>
+ public static float SpToPixels(float pixels)
+ {
+ return SpTypeConverter.Instance.ConvertToPixel(pixels / SpPixelDivider);
+ }
+
+ /// <summary>
+ /// Converts sp pixels into pixels.
+ /// </summary>
+ /// <param name="size">The size to be converted to pixels.</param>
+ /// <returns>The number of pixels.</returns>
+ public static Size2D SpToPixels(Size2D size)
+ {
+ return new Size2D(SpToPixels(size.Width), SpToPixels(size.Height));
+ }
+
+ /// <summary>
+ /// Converts sp pixels into pixels.
+ /// </summary>
+ /// <param name="extents">The extents collection to be converted to pixels.</param>
+ /// <returns>The number of pixels.</returns>
+ public static Extents SpToPixels(Extents extents)
+ {
+ return new Extents(SpToPixels(extents.Start), SpToPixels(extents.End), SpToPixels(extents.Top), SpToPixels(extents.Bottom));
+ }
+ }
+}
{
public BigLightButtonStyle()
{
- Text.PixelSize = DpUtils.DpToPixels(40.0f);
+ Text.PixelSize = SpUtils.SpToPixels(40.0f);
}
}
}
public DirectionButtonStyle(Direction direction)
{
Text.TextColor.Disabled = new Color("#C3CAD2");
- Text.PixelSize = DpUtils.DpToPixels(24.0f);
+ Text.PixelSize = SpUtils.SpToPixels(24.0f);
NinePatchBackgroundColor.Disabled = NinePatchBackgroundColor.Normal;
NinePatchFrameColor.Disabled = NinePatchFrameColor.Normal;
{
case Direction.Previous:
Text.HorizontalAlignment = HorizontalAlignment.Begin;
- TextPadding = new Extents(DpUtils.DpToPixels((ushort)20), 0, 0, 0);
+ TextPadding = new Extents(SpUtils.SpToPixels((ushort)20), 0, 0, 0);
IconRelativeOrientation = Button.IconOrientation.Left;
break;
case Direction.Next:
Text.HorizontalAlignment = HorizontalAlignment.End;
- IconPadding = new Extents(DpUtils.DpToPixels((ushort)20), 0, 0, 0);
+ IconPadding = new Extents(SpUtils.SpToPixels((ushort)20), 0, 0, 0);
IconRelativeOrientation = Button.IconOrientation.Right;
break;
Icon = new ImageViewStyle
{
ResourceUrl = GetArrowIconPaths(direction),
- Size = new Size2D(DpUtils.DpToPixels(80), DpUtils.DpToPixels(80)),
+ Size = new Size2D(SpUtils.SpToPixels(80), SpUtils.SpToPixels(80)),
};
}
Text = new TextLabelStyle
{
- PixelSize = DpUtils.DpToPixels(32.0f),
+ PixelSize = SpUtils.SpToPixels(32.0f),
FontFamily = "BreezeSans",
};