diff options
author | xb.teng <xb.teng@samsung.com> | 2017-08-24 18:59:19 +0800 |
---|---|---|
committer | dongsug.song <dongsug.song@samsung.com> | 2017-09-20 09:48:46 +0900 |
commit | c26f0e521b59ace5addd7c2be3baeaa2d103a0b3 (patch) | |
tree | 258bec136510a4bb57e1d777d26d86871106fd7f | |
parent | 9a392616f218dedd86fcc9ab677c4eb28573f0ec (diff) | |
download | nui-c26f0e521b59ace5addd7c2be3baeaa2d103a0b3.tar.gz nui-c26f0e521b59ace5addd7c2be3baeaa2d103a0b3.tar.bz2 nui-c26f0e521b59ace5addd7c2be3baeaa2d103a0b3.zip |
[Tizen] Add Interval property for Timer
Conflicts:
NUISamples/NUISamples/NUISamples.TizenTV/NUISamples.TizenTV.csproj
Change-Id: I22f83894065752d245150cb1374f6f4f456aa312
-rwxr-xr-x | NUISamples/NUISamples/NUISamples.TizenTV/NUISamples.TizenTV.csproj | 206 | ||||
-rwxr-xr-x | NUISamples/NUISamples/NUISamples.TizenTV/examples/timer-test.cs | 112 | ||||
-rwxr-xr-x | Tizen.NUI/src/public/Timer.cs | 15 |
3 files changed, 333 insertions, 0 deletions
diff --git a/NUISamples/NUISamples/NUISamples.TizenTV/NUISamples.TizenTV.csproj b/NUISamples/NUISamples/NUISamples.TizenTV/NUISamples.TizenTV.csproj new file mode 100755 index 0000000..4901499 --- /dev/null +++ b/NUISamples/NUISamples/NUISamples.TizenTV/NUISamples.TizenTV.csproj @@ -0,0 +1,206 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectTypeGuids>{2F98DAC9-6F16-457B-AED7-D43CAC379341};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <ProjectGuid>{7731BE98-0A68-49A9-877C-A30A0D30D9F6}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>NUISamples.TizenTV</RootNamespace>
+ <AssemblyName>NUISamples.TizenTV</AssemblyName>
+ <FileAlignment>512</FileAlignment>
+ <DefaultLanguage>en-US</DefaultLanguage>
+ </PropertyGroup>
+ <PropertyGroup>
+ <TargetFrameworkIdentifier>DNXCore</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
+ <NuGetTargetMoniker>.NETCoreApp,Version=v1.0</NuGetTargetMoniker>
+ <NoStdLib>true</NoStdLib>
+ <NoWarn>$(NoWarn);1701</NoWarn>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>portable</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>portable</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <None Include="NUISamples.TizenTV.project.json" />
+ <None Include="res\json\control-dashboard.json" />
+ <None Include="res\json\date-picker-template.json" />
+ <None Include="res\json\date-picker-theme.json" />
+ <None Include="res\json\date-picker.json" />
+ <None Include="res\json\spin.json" />
+ <None Include="res\json\style-example-theme-one.json" />
+ <None Include="res\models\Dino.mtl" />
+ <None Include="res\models\Dino.obj" />
+ <None Include="tizen-manifest.xml" />
+ <None Include="shared\res\NUISamples.TizenTV.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="examples\as-is-test-sample.cs" />
+ <Compile Include="examples\control-dashboard.cs" />
+ <Compile Include="examples\custom-control.cs" />
+ <Compile Include="examples\dali-test.cs" />
+ <Compile Include="examples\date-picker-using-json\date-picker-using-json.cs" />
+ <Compile Include="examples\date-picker.cs" />
+ <Compile Include="examples\flex-container.cs" />
+ <Compile Include="examples\gc-test.cs" />
+ <Compile Include="examples\hello-test.cs" />
+ <Compile Include="examples\hello-world.cs" />
+ <Compile Include="examples\image-view.cs" />
+ <Compile Include="examples\Main.cs" />
+ <Compile Include="examples\positionUsesPivotPoint-test.cs" />
+ <Compile Include="examples\relative-vector.cs" />
+ <Compile Include="examples\scroll-view.cs" />
+ <Compile Include="examples\sibling-order-test.cs" />
+ <Compile Include="examples\test1.cs" />
+ <Compile Include="examples\text-test.cs" />
+ <Compile Include="examples\timer-test.cs" />
+ <Compile Include="examples\ttsplayer-test.cs" />
+ <Compile Include="examples\user-alphafunction.cs" />
+ <Compile Include="examples\view-navi-property.cs" />
+ <Compile Include="examples\date-picker-using-json\ViewRegistryHelper.cs" />
+ <Compile Include="examples\visual-animation-test.cs" />
+ <Compile Include="examples\visual-animation-test2.cs" />
+ <Compile Include="examples\visual-animation-test3.cs" />
+ <Compile Include="examples\visual-view-test2.cs" />
+ <Compile Include="examples\visual-view-test.cs" />
+ <Compile Include="examples\visual-view-test3.cs" />
+ <Compile Include="examples\visuals-using-custom-view\ContactData.cs" />
+ <Compile Include="examples\visuals-using-custom-view\ContactView.cs" />
+ <Compile Include="examples\visuals-using-custom-view\visuals-using-custom-view.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="lib\" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\..\Tizen.NUI\Tizen.NUI.csproj">
+ <Project>{f03a3b48-9d9b-4bf3-92ce-bd63cadc3cd3}</Project>
+ <Name>Tizen.NUI</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\NUISamples\NUISamples-dummy.csproj">
+ <Project>{56ca3b27-c662-4ac8-93ca-7acef926b2aa}</Project>
+ <Name>NUISamples-dummy</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="res\images\application-icon-0.png" />
+ <Content Include="res\images\background-blocks.jpg" />
+ <Content Include="res\images\dali-logo-anim.gif" />
+ <Content Include="res\images\dog-anim.gif" />
+ <Content Include="res\images\echo.gif" />
+ <Content Include="res\images\focuseffect\0-normal.png" />
+ <Content Include="res\images\focuseffect\1-normal.png" />
+ <Content Include="res\images\focuseffect\2-normal.png" />
+ <Content Include="res\images\arrow.png" />
+ <Content Include="res\images\focuseffect\background.png" />
+ <Content Include="res\images\Dino-Painted_lambert2SG_color.png" />
+ <Content Include="res\images\Dino-Painted_lambert2SG_gloss.png" />
+ <Content Include="res\images\Dino-Painted_lambert2SG_nmap.png" />
+ <Content Include="res\images\Dino2_lambert2SG_color.png" />
+ <Content Include="res\images\Dino2_lambert2SG_nmap.png" />
+ <Content Include="res\images\focuseffect\halo.png" />
+ <Content Include="res\images\focuseffect\horizontalFrame.png" />
+ <Content Include="res\images\focuseffect\verticalFrame.png" />
+ <Content Include="res\images\focuseffect\focus_grid.9.png" />
+ <Content Include="res\images\focuseffect\focus_launcher_shadow.9.png" />
+ <Content Include="res\images\focuseffect\focus_launcher_shadow_n.png" />
+ <Content Include="res\images\gallery-0.jpg" />
+ <Content Include="res\images\gallery-1.jpg" />
+ <Content Include="res\images\gallery-2.jpg" />
+ <Content Include="res\images\gallery-3.jpg" />
+ <Content Include="res\images\gallery-4.jpg" />
+ <Content Include="res\images\gallery-5.jpg" />
+ <Content Include="res\images\gallery-small-43.jpg" />
+ <Content Include="res\images\focuseffect\highlight_spot.png" />
+ <Content Include="res\images\focuseffect\highlight_stroke.9.png" />
+ <Content Include="res\images\image-1.jpg" />
+ <Content Include="res\images\image-2.jpg" />
+ <Content Include="res\images\image-3.jpg" />
+ <Content Include="res\images\Kid1.svg" />
+ <Content Include="res\images\Mail.svg" />
+ <Content Include="res\images\menu\0.png" />
+ <Content Include="res\images\menu\1.png" />
+ <Content Include="res\images\menu\2.png" />
+ <Content Include="res\images\menu\3.png" />
+ <Content Include="res\images\menu\4.png" />
+ <Content Include="res\images\menu\5.png" />
+ <Content Include="res\images\menu\6.png" />
+ <Content Include="res\images\not_yet_sign.png" />
+ <Content Include="res\images\poster0\0.jpg" />
+ <Content Include="res\images\poster0\1.jpg" />
+ <Content Include="res\images\poster0\10.jpg" />
+ <Content Include="res\images\poster0\11.jpg" />
+ <Content Include="res\images\poster0\12.jpg" />
+ <Content Include="res\images\poster0\13.jpg" />
+ <Content Include="res\images\poster0\2.jpg" />
+ <Content Include="res\images\poster0\3.jpg" />
+ <Content Include="res\images\poster0\4.jpg" />
+ <Content Include="res\images\poster0\5.jpg" />
+ <Content Include="res\images\poster0\6.jpg" />
+ <Content Include="res\images\poster0\7.jpg" />
+ <Content Include="res\images\poster0\8.jpg" />
+ <Content Include="res\images\poster0\9.jpg" />
+ <Content Include="res\images\poster1\0.jpg" />
+ <Content Include="res\images\poster1\1.jpg" />
+ <Content Include="res\images\poster1\2.jpg" />
+ <Content Include="res\images\poster1\3.jpg" />
+ <Content Include="res\images\poster1\4.jpg" />
+ <Content Include="res\images\poster1\5.jpg" />
+ <Content Include="res\images\star-dim.png" />
+ <Content Include="res\images\star-highlight.png" />
+ <Content Include="res\images\star-mod.png" />
+ <Content Include="res\images\focuseffect\thumbnail_shadow.9.png" />
+ <Content Include="res\images\focuseffect\white-pixel.png" />
+ <Content Include="res\images\World.svg" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <PropertyGroup>
+ <!-- https://github.com/dotnet/corefxlab/tree/master/samples/NetCoreSample and
+ https://docs.microsoft.com/en-us/dotnet/articles/core/tutorials/target-dotnetcore-with-msbuild
+ -->
+ <!-- We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two
+ properties to any folder that exists to skip the GetReferenceAssemblyPaths task (not target) and
+ to prevent it from outputting a warning (MSB3644).
+ -->
+ <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)</_TargetFrameworkDirectories>
+ <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)</_FullFrameworkReferenceAssemblyPaths>
+ <AutoUnifyAssemblyReferences>true</AutoUnifyAssemblyReferences>
+ </PropertyGroup>
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{2F98DAC9-6F16-457B-AED7-D43CAC379341}" Configuration="Debug|Any CPU">
+ <ProjectCorporateFlavorCfg />
+ </FlavorProperties>
+ <FlavorProperties GUID="{2F98DAC9-6F16-457B-AED7-D43CAC379341}" Configuration="Release|Any CPU">
+ <ProjectCorporateFlavorCfg />
+ </FlavorProperties>
+ </VisualStudio>
+ </ProjectExtensions>
+</Project>
diff --git a/NUISamples/NUISamples/NUISamples.TizenTV/examples/timer-test.cs b/NUISamples/NUISamples/NUISamples.TizenTV/examples/timer-test.cs new file mode 100755 index 0000000..6b408e7 --- /dev/null +++ b/NUISamples/NUISamples/NUISamples.TizenTV/examples/timer-test.cs @@ -0,0 +1,112 @@ +using System; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.UIComponents; +using Tizen.NUI.Constants; + +namespace TimerTest +{ + // An example of Visual View control. + class Example : NUIApplication + { + private static int i = 0; + + public Example() : base() + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + public void Initialize() + { + Window window = Window.Instance; + window.BackgroundColor = Color.White; + + TextLabel label = new TextLabel() + { + Text = "Steps: 0", + Size2D = new Size2D(460, 80), + Position2D = new Position2D(10, 10) + }; + + RadioButton radio1 = new RadioButton() + { + LabelText = "Set interval 500", + Size2D = new Size2D(300, 50), + Position2D = new Position2D(10, 100), + }; + RadioButton radio2 = new RadioButton() + { + LabelText = "Set interval 1000", + Size2D = new Size2D(300, 50), + Position2D = new Position2D(10, 160), + Selected = true + }; + RadioButton radio3 = new RadioButton() + { + LabelText = "Set interval 3000", + Size2D = new Size2D(300, 50), + Position2D = new Position2D(10, 220), + }; + + PushButton button1 = new PushButton() + { + LabelText = "Start", + Size2D = new Size2D(100, 50), + Position2D = new Position2D(10, 300), + Focusable = true + }; + + PushButton button2 = new PushButton() + { + LabelText = "Stop", + Size2D = new Size2D(100, 50), + Position2D = new Position2D(140, 300), + Focusable = true + }; + + window.Add(label); + window.Add(radio1); + window.Add(radio2); + window.Add(radio3); + window.Add(button1); + window.Add(button2); + + FocusManager.Instance.SetCurrentFocusView(button1); + button1.LeftFocusableView = button1.RightFocusableView = button2; + button2.RightFocusableView = button2.LeftFocusableView = button1; + button1.UpFocusableView = button2.UpFocusableView = radio3; + radio3.UpFocusableView = radio2; + radio2.UpFocusableView = radio1; + radio1.DownFocusableView = radio2; + radio2.DownFocusableView = radio3; + radio3.DownFocusableView = button1; + + Timer timer = new Timer(1000); + timer.Tick += (obj, e) => + { + Tizen.Log.Fatal("NUI", "NUI Timer tick called!"); + label.Text = "Steps: " + (i++); + return true; + }; + + button1.Clicked += (obj, e) => + { + if (radio1.Selected == true) timer.Interval = 500; + if (radio2.Selected == true) timer.Interval = 1000; + if (radio3.Selected == true) timer.Interval = 3000; + timer.Start(); + return true; + }; + button2.Clicked += (obj, e) => + { + timer.Stop(); + return true; + }; + } + } +} diff --git a/Tizen.NUI/src/public/Timer.cs b/Tizen.NUI/src/public/Timer.cs index a062638..cbb7dd6 100755 --- a/Tizen.NUI/src/public/Timer.cs +++ b/Tizen.NUI/src/public/Timer.cs @@ -175,6 +175,21 @@ namespace Tizen.NUI } /// <summary> + /// Gets/Sets the interval of the timer. + /// </summary> + public uint Interval + { + get + { + return GetInterval(); + } + set + { + SetInterval(value); + } + } + + /// <summary> /// Sets a new interval on the timer and starts the timer.<br> /// Cancels the previous timer.<br> /// </summary> |