-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Mobile][NUI] Location sample application
- Loading branch information
1 parent
6f7a29f
commit 56d4928
Showing
21 changed files
with
12,824 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
arg_file_template = "" | ||
buildconfig = "//build/BUILDCONFIG.gn" | ||
root = "//build:" | ||
script_executable = "" | ||
secondary_source = "//build" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.31005.135 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Location", "Location\Location.csproj", "{e708c9b1-601b-48fa-9ff2-fe38f37dc2f5}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5204eb4c-1913-4de9-93d0-f1e45943f734}" | ||
ProjectSection(SolutionItems) = preProject | ||
tizen_workspace.yaml = tizen_workspace.yaml | ||
EndProjectSection | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{e708c9b1-601b-48fa-9ff2-fe38f37dc2f5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{e708c9b1-601b-48fa-9ff2-fe38f37dc2f5}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{e708c9b1-601b-48fa-9ff2-fe38f37dc2f5}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{e708c9b1-601b-48fa-9ff2-fe38f37dc2f5}.Release|Any CPU.Build.0 = Release|Any CPU | ||
|
||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (c) 2023 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 Tizen.NUI.Binding; | ||
using Tizen.NUI.Components; | ||
|
||
namespace Location.Behaviors | ||
{ | ||
public static class TextSetter | ||
{ | ||
public static readonly BindableProperty TextProperty = | ||
BindableProperty.CreateAttached( | ||
"Text", | ||
typeof(string), | ||
typeof(TextSetter), | ||
"", | ||
propertyChanged: OnTextChanged); | ||
|
||
public static string GetText(BindableObject button) => (string)button.GetValue(TextProperty); | ||
|
||
public static void SetText(BindableObject button, string value) => button.SetValue(TextProperty, value); | ||
|
||
public static void OnTextChanged(BindableObject bindable, object oldValue, object newValue) | ||
{ | ||
if (newValue is string text && bindable is Button button) | ||
{ | ||
button.Text = text; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!-- | ||
*********************************************************************************************** | ||
<Build.Directory.targets> | ||
WARNING: DO NOT MODIFY this file. Incorrect changes to this file will make it | ||
impossible to load or build your projects from the IDE. | ||
*********************************************************************************************** | ||
--> | ||
|
||
<Project> | ||
<Target Name="BuildDotnet" AfterTargets="TizenPackage" > | ||
<Message Text="Tizen Build starts here ------------" Importance="high"/> | ||
<Message Text="$(MSBuildProjectDirectory)" Importance="high"/> | ||
<PropertyGroup> | ||
<WorkspaceFolder>$([System.IO.Path]::GetDirectoryName($(MSBuildProjectDirectory)))</WorkspaceFolder> | ||
</PropertyGroup> | ||
<Message Text="Workspace: '$(WorkspaceFolder)'" Importance="high" /> | ||
|
||
<Exec Command="C:\tizen-studio\tools\tizen-core\tz.exe pack -S $(ProjectDir) $(WorkspaceFolder)"> </Exec> | ||
</Target> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright (c) 2023 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 Tizen.NUI; | ||
|
||
namespace Location | ||
{ | ||
public class Program : NUIApplication | ||
{ | ||
protected override void OnCreate() | ||
{ | ||
base.OnCreate(); | ||
Window window = Window.Instance; | ||
window.BackgroundColor = Color.Blue; | ||
window.KeyEvent += OnKeyEvent; | ||
|
||
MainPage page = new MainPage(); | ||
page.PositionUsesPivotPoint = true; | ||
page.ParentOrigin = ParentOrigin.Center; | ||
page.PivotPoint = PivotPoint.Center; | ||
page.Size = new Size(window.WindowSize); | ||
window.Add(page); | ||
} | ||
|
||
public void OnKeyEvent(object sender, Window.KeyEventArgs e) | ||
{ | ||
if (e.Key.State == Key.StateType.Down && (e.Key.KeyPressedName == "XF86Back" || e.Key.KeyPressedName == "Escape")) | ||
{ | ||
Exit(); | ||
} | ||
} | ||
|
||
static void Main(string[] args) | ||
{ | ||
var app = new Program(); | ||
app.Run(args); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<Project Sdk="Tizen.NET.Sdk/1.1.9"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>tizen10.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugType>portable</DebugType> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>None</DebugType> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Folder Include="lib\" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<EmbeddedResource Include="res\layout\MainPage.xaml"> | ||
<Generator>MSBuild:Compile</Generator> | ||
</EmbeddedResource> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Tizen.NUI.XamlBuild" Version="1.0.34" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup> | ||
<NeedInjection>True</NeedInjection> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright (c) 2023 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; | ||
using Tizen.NUI.Components; | ||
using Tizen.NUI.BaseComponents; | ||
|
||
namespace Location | ||
{ | ||
public partial class MainPage : ContentPage | ||
{ | ||
public MainPage() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
/// <summary> | ||
/// User needs to implement this, if required | ||
/// </summary> | ||
/// <param name="type">dispose type</param> | ||
protected override void Dispose(DisposeTypes type) | ||
{ | ||
if (Disposed) | ||
{ | ||
return; | ||
} | ||
|
||
ExitXaml(); | ||
|
||
if (type == DisposeTypes.Explicit) | ||
{ | ||
//Todo: Called by User | ||
//Release your own managed resources here. | ||
//You should release all of your own disposable objects here. | ||
|
||
} | ||
|
||
//Todo: Release your own unmanaged resources here. | ||
//You should not access any managed member here except static instance. | ||
//because the execution order of Finalizes is non-deterministic. | ||
|
||
|
||
base.Dispose(type); | ||
} | ||
} | ||
} |
Oops, something went wrong.