From 995fe6de406a3047e15502851eb1dea9ecada6e5 Mon Sep 17 00:00:00 2001 From: "huayong.xu" Date: Mon, 30 Jan 2023 17:34:04 +0800 Subject: [PATCH] [TV] Implement Preferences. --- Preference/.gitignore | 180 ++++++++++++++ Preference/LICENSE | 201 +++++++++++++++ Preference/README.md | 15 ++ Preference/Screenshots/screenshot_1.png | Bin 0 -> 22780 bytes Preference/src/Preference.sln | 25 ++ .../Preference.Tizen.TV/Interfaces/IPage.cs | 51 ++++ .../Interfaces/IPreferenceService.cs | 50 ++++ .../Models/PreferenceModel.cs | 68 +++++ .../Preference.Tizen.TV.cs | 51 ++++ .../Preference.Tizen.TV.csproj | 37 +++ .../Services/PreferenceService.cs | 74 ++++++ .../ViewModels/EditPreferencesViewModel.cs | 233 ++++++++++++++++++ .../ViewModels/ViewModelBase.cs | 70 ++++++ .../Views/EditPreferences.xaml | 108 ++++++++ .../Views/EditPreferences.xaml.cs | 110 +++++++++ .../shared/res/Preference.Tizen.TV.png | Bin 0 -> 10097 bytes .../Preference.Tizen.TV/tizen-manifest.xml | 14 ++ 17 files changed, 1287 insertions(+) create mode 100755 Preference/.gitignore create mode 100755 Preference/LICENSE create mode 100755 Preference/README.md create mode 100755 Preference/Screenshots/screenshot_1.png create mode 100755 Preference/src/Preference.sln create mode 100755 Preference/src/Preference/Preference.Tizen.TV/Interfaces/IPage.cs create mode 100755 Preference/src/Preference/Preference.Tizen.TV/Interfaces/IPreferenceService.cs create mode 100755 Preference/src/Preference/Preference.Tizen.TV/Models/PreferenceModel.cs create mode 100755 Preference/src/Preference/Preference.Tizen.TV/Preference.Tizen.TV.cs create mode 100755 Preference/src/Preference/Preference.Tizen.TV/Preference.Tizen.TV.csproj create mode 100755 Preference/src/Preference/Preference.Tizen.TV/Services/PreferenceService.cs create mode 100755 Preference/src/Preference/Preference.Tizen.TV/ViewModels/EditPreferencesViewModel.cs create mode 100755 Preference/src/Preference/Preference.Tizen.TV/ViewModels/ViewModelBase.cs create mode 100755 Preference/src/Preference/Preference.Tizen.TV/Views/EditPreferences.xaml create mode 100755 Preference/src/Preference/Preference.Tizen.TV/Views/EditPreferences.xaml.cs create mode 100755 Preference/src/Preference/Preference.Tizen.TV/shared/res/Preference.Tizen.TV.png create mode 100755 Preference/src/Preference/Preference.Tizen.TV/tizen-manifest.xml diff --git a/Preference/.gitignore b/Preference/.gitignore new file mode 100755 index 0000000..e584504 --- /dev/null +++ b/Preference/.gitignore @@ -0,0 +1,180 @@ +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates +*.DotSettings + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ + +# .NET Core +*.project.lock.json +*.project.fragment.lock.json +artifacts/ +**/Properties/launchSettings.json + + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + + +### Android START ### +# Built application files +*.apk +*.ap_ + +# Files for the Dalvik VM +*.dex + +# Java class files +*.class + +# Generated files +bin/ +gen/ + +# Gradle files +.gradle/ +build/ + +# Local configuration file (sdk path, etc) +local.properties + +# Proguard folder generated by Eclipse +proguard/ + +# Log Files +*.log + +# Android Studio Navigation editor temp files +.navigation/ + +### Android Patch ### +gen-external-apklibs + + +### Java ### +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio + +*.iml + +## Directory-based project format: +.idea/ +# if you remove the above rule, at least ignore the following: + +# User-specific stuff: +# .idea/workspace.xml +# .idea/tasks.xml +# .idea/dictionaries + +# Sensitive or high-churn files: +# .idea/dataSources.ids +# .idea/dataSources.xml +# .idea/sqlDataSources.xml +# .idea/dynamic.xml +# .idea/uiDesigner.xml + +# Gradle: +# .idea/gradle.xml +# .idea/libraries + +# Mongo Explorer plugin: +# .idea/mongoSettings.xml + +## File-based project format: +*.ipr +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ +/captures + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties + +### Android END ### + +### Resharper ### + +_Resharper* diff --git a/Preference/LICENSE b/Preference/LICENSE new file mode 100755 index 0000000..51a2cd2 --- /dev/null +++ b/Preference/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2017 Samsung + + 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. diff --git a/Preference/README.md b/Preference/README.md new file mode 100755 index 0000000..c22900e --- /dev/null +++ b/Preference/README.md @@ -0,0 +1,15 @@ +# Preference +Preference is a sample application which demonstrates how to use [Tizen.Applications](https://samsung.github.io/TizenFX/stable/api/Tizen.Applications.Preference.html). + +![Main page - overview](./Screenshots/screenshot_1.png) + +### Features +* Store user provided data. + +### Prerequisites + +* [Visual Studio](https://www.visualstudio.com/) - Buildtool, IDE +* [Visual Studio Tools for Tizen](https://docs.tizen.org/application/vstools/install) - Visual Studio plugin for Tizen .NET application development + +### Author +* Patryk Falba diff --git a/Preference/Screenshots/screenshot_1.png b/Preference/Screenshots/screenshot_1.png new file mode 100755 index 0000000000000000000000000000000000000000..41c0e71061473760235e4a9d9edb2cc78c9fda75 GIT binary patch literal 22780 zcmeIa2T)Yo*C*PD3MRlSqLR5PD3TN;LnEe(Bn1Q{BS_9UgG3d9D@aaClq?`QgMbLw z1hL6EXJ~Rm_gmfg|JSQmQ&aQJyqfQO^X{%P^yzc*-{aEhdnUl095eUQ? zslVKSKkyl=~G01r~adRst0Ckc;#y{g94*X|x zAPPmfz=%N9I{8VmoNllv5m_K>;GsW#-1zi~Q0l-&$&XYcUvw`Xzr%C!^l_g%dFX{r z7u&%m0@bx$@V#=Dy|c5ktE;P{V}x9}U=NK(OOf2TLp3-&99(6Qqbz+w2!VL};+!Oc`4kry zmxH6@!sgyJWY7%-ZZ0kZF{O+Cjn8kMZUE8xkIho%Y1jO4J7$`%3L+aE8hXl)Q!UeA zjQ!zQF$AM0gbaZw_D0YmzP$=04ndCK*wr77aVACO-@8_16|YeP3$&}_2Os;;_qYeax=5DMnlOuV$-SzHf8kpJAJQ|t8)BWurI3GzIv=9i|GV# z;T;oN47j13(>+(|ao}PTWSgT*M^`2;FBK_?0Nn`#-Xjt+`b?no!@*qDQfw zYOq>dKz*J%g+R33gWFc!HeIS0`-wfQ_hN@*WfSWQX%1vE0Z z*1I0}sng;4Y&>A_DAS9=`@`dFGQFRyDEuTpKEB2=)MX?n_iP26o?dAScv1+HGkb?Tbl^%ZsKND+ zOVSg$ugG}2dAedpC(gYv-ep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swD)aQSkBef$R>&@4L&1#eDZqD~erD&Dg z8Ha{~Sf%^Q?Xq-@g`2;w+@6D~r>YJiiL#&p`+-3?0Cd_MNe&TLJJ}H;zGu|+UfMt~ zc7M5Ig_Ux|79|FxobG1uq+o%zoh#be&kCna$a2{zfahL*_rRt`r$gyqEiWw{%&XMU zipPKK92%;!7%EqACm1rYcyx3WZ@EHYulB4S5xi2x_R5(2xr)v&=3m|^sK*@K4Oy#4 zZ}-yPYd;&vVtnk?%~!WyTds6&_kj9u-3n&>?z-#~YGb3lRiT?r z)hn$99IXYp3%LtTdKH&@;2lHb+OiewM(tf1uwJWd!WMD&%m>mC@JjsCr#GAC>|&~+ zd8uOiq#SEl9&4mZ*3+02ix`88{(M|R_Cpqrm$BjpZbfRTcZ?B;9otfXU|ti{lDz}{ zm06jYYYTi)qFm3#D>+whOtcJb(z@1&H_bvj@<=5ZFa1^MXZ4!ki38 zy&z75`hGc&mB!af*Q+{e9cw)g-!}ZP*9;;3=}J;=KCqS#uguzrd%L~89gTw$$7&UUFTsz= zKQ5G8N9<Rp|CW%OPs}cc>6^ON3ty0zxx0w}!7Y zm8x>p{4ORG{O&&f|L6@k64$&bLo~vlSk9EX MFLy6jQpfxM0%qeXqW}N^ literal 0 HcmV?d00001 diff --git a/Preference/src/Preference.sln b/Preference/src/Preference.sln new file mode 100755 index 0000000..e77c8b3 --- /dev/null +++ b/Preference/src/Preference.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.32929.386 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Preference.Tizen.TV", "Preference\Preference.Tizen.TV\Preference.Tizen.TV.csproj", "{5E103C1A-E6A4-4929-A34B-A00B10D69F23}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5E103C1A-E6A4-4929-A34B-A00B10D69F23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5E103C1A-E6A4-4929-A34B-A00B10D69F23}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5E103C1A-E6A4-4929-A34B-A00B10D69F23}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5E103C1A-E6A4-4929-A34B-A00B10D69F23}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {39024C7B-6CF9-4458-92A6-71059B9B5FEC} + EndGlobalSection +EndGlobal diff --git a/Preference/src/Preference/Preference.Tizen.TV/Interfaces/IPage.cs b/Preference/src/Preference/Preference.Tizen.TV/Interfaces/IPage.cs new file mode 100755 index 0000000..0163b37 --- /dev/null +++ b/Preference/src/Preference/Preference.Tizen.TV/Interfaces/IPage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2018 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; + +namespace Preference.Interfaces +{ + /// + /// Application page interface. + /// + public interface IPage + { + #region methods + + /// + /// Handles OnSaved event. + /// + /// ViewModel instance. + /// Event parameters. + void OnSaved(object sender, EventArgs args); + + /// + /// Handles OnLoaded event. + /// + /// ViewModel instance. + /// Event parameters. + void OnLoaded(object sender, EventArgs args); + + /// + /// Handles OnDataError event. + /// + /// ViewModel instance. + /// Event parameters. + void OnDataError(object sender, EventArgs args); + + #endregion + } +} diff --git a/Preference/src/Preference/Preference.Tizen.TV/Interfaces/IPreferenceService.cs b/Preference/src/Preference/Preference.Tizen.TV/Interfaces/IPreferenceService.cs new file mode 100755 index 0000000..ff37a53 --- /dev/null +++ b/Preference/src/Preference/Preference.Tizen.TV/Interfaces/IPreferenceService.cs @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2018 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. + */ + +namespace Preference.Interfaces +{ + /// + /// Application service interface. + /// + public interface IPreferenceService + { + #region methods + + /// + /// Checks if provided key is stored. + /// + /// Key name to check. + /// True if key exists. False otherwise. + bool Contains(string key); + + /// + /// Stores key with value. + /// + /// Key name. + /// Value. + void Set(string key, object value); + + /// + /// Gets value of provided key. + /// + /// Type of value. + /// Key name. + /// Stored value. + object Get(string key); + + #endregion + } +} diff --git a/Preference/src/Preference/Preference.Tizen.TV/Models/PreferenceModel.cs b/Preference/src/Preference/Preference.Tizen.TV/Models/PreferenceModel.cs new file mode 100755 index 0000000..ff9ec03 --- /dev/null +++ b/Preference/src/Preference/Preference.Tizen.TV/Models/PreferenceModel.cs @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2018 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 Preference.Interfaces; +using Preference.TV.Services; + +namespace Preference.Models +{ + /// + /// PreferenceModel class. + /// + class PreferenceModel + { + #region fields + + private readonly IPreferenceService _model = new PreferenceService(); + + #endregion + + #region methods + + /// + /// Returns boolean value that indicates that provided key is stored. + /// + /// Key name. + /// True if key is stored, false otherwise. + public bool Contains(string key) + { + return _model.Contains(key); + } + + /// + /// Sets key with provided value. + /// + /// Key name. + /// Value. + public void Set(string key, object value) + { + _model.Set(key, value); + } + + /// + /// Gets value of stored key or null if key not exist. + /// + /// Key name. + /// Type of stored value. + /// Value assigned to the key. + public object Get(string key) + { + return _model.Get(key); + } + + #endregion + } +} diff --git a/Preference/src/Preference/Preference.Tizen.TV/Preference.Tizen.TV.cs b/Preference/src/Preference/Preference.Tizen.TV/Preference.Tizen.TV.cs new file mode 100755 index 0000000..098e8de --- /dev/null +++ b/Preference/src/Preference/Preference.Tizen.TV/Preference.Tizen.TV.cs @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2018 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; +using Tizen.NUI.Components; +using Tizen.NUI.BaseComponents; +using Preference.TV.Views; + +namespace Preference.TV +{ + class Program : NUIApplication + { + protected override void OnCreate() + { + base.OnCreate(); + Window window = Window.Instance; + window.BackgroundColor = Color.Red; + window.KeyEvent += OnKeyEvent; + + window.GetDefaultLayer().Add(new EditPreferences()); + window.AddAvailableOrientation(Window.WindowOrientation.Landscape); + } + + 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); + } + } +} diff --git a/Preference/src/Preference/Preference.Tizen.TV/Preference.Tizen.TV.csproj b/Preference/src/Preference/Preference.Tizen.TV/Preference.Tizen.TV.csproj new file mode 100755 index 0000000..638df7c --- /dev/null +++ b/Preference/src/Preference/Preference.Tizen.TV/Preference.Tizen.TV.csproj @@ -0,0 +1,37 @@ + + + + + Exe + netcoreapp3.1 + 1 + + + + portable + + + None + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Preference/src/Preference/Preference.Tizen.TV/Services/PreferenceService.cs b/Preference/src/Preference/Preference.Tizen.TV/Services/PreferenceService.cs new file mode 100755 index 0000000..8f3c81b --- /dev/null +++ b/Preference/src/Preference/Preference.Tizen.TV/Services/PreferenceService.cs @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2018 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 Preference.TV.Services; +using TizenPreference = Tizen.Applications.Preference; + +namespace Preference.TV.Services +{ + /// + /// PreferenceService class. + /// + public class PreferenceService : Interfaces.IPreferenceService + { + #region methods + + /// + /// Checks if provided key is stored. + /// + /// Key name to check. + /// Returns true if key is stored. False otherwise. + public bool Contains(string key) + { + return TizenPreference.Contains(key); + } + + /// + /// Store key with provided value. + /// + /// Key name. + /// Value to assign to provided key. + public void Set(string key, object value) + { + if (Contains(key)) + { + TizenPreference.Remove(key); + } + + TizenPreference.Set(key, value); + } + + /// + /// Returns value assigned to the key. + /// + /// Key name. + /// Returns value assigned to requested key. If key doesn't exist and requested type is string, empty string is returned. + /// If key doesn't exist and requested type is not a string, default value for requested type is returned + public object Get(string key) + { + object value = default(T); + + if (Contains(key)) + { + value = TizenPreference.Get(key); + } + + return value ?? string.Empty; + } + + #endregion + } +} \ No newline at end of file diff --git a/Preference/src/Preference/Preference.Tizen.TV/ViewModels/EditPreferencesViewModel.cs b/Preference/src/Preference/Preference.Tizen.TV/ViewModels/EditPreferencesViewModel.cs new file mode 100755 index 0000000..e88f40f --- /dev/null +++ b/Preference/src/Preference/Preference.Tizen.TV/ViewModels/EditPreferencesViewModel.cs @@ -0,0 +1,233 @@ +/* + * Copyright (c) 2017 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 Preference.Models; +using System; +using System.Globalization; +using System.Windows.Input; +using Tizen.NUI.Binding; + +namespace Preference.ViewModels +{ + /// + /// Main application ViewModel. + /// + public class EditPreferencesViewModel : ViewModelBase + { + #region fields + + /// + /// Backing field for property. + /// + private string _nameValue; + + /// + /// Backing field for property. + /// + private string _surnameValue; + + /// + /// Backing field for property. + /// + private string _ageValue; + + /// + /// Backing field for property. + /// + private string _heightValue; + + /// + /// Backing field for property. + /// + private bool? _cplusplusValue; + + /// + /// Backing field for property. + /// + private bool? _csharpValue; + + /// + /// Backing field for property. + /// + private bool? _javaValue; + + /// + /// instance. + /// + private readonly PreferenceModel _model = new PreferenceModel(); + + #endregion + + #region properties + + /// + /// Property for "Name" value. + /// + public string NameValue + { + get => _nameValue; + set => SetProperty(ref _nameValue, value); + } + + /// + /// Property for "Surname" value. + /// + public string SurnameValue + { + get => _surnameValue; + set => SetProperty(ref _surnameValue, value); + } + + /// + /// Property for "Age" value. + /// + public string AgeValue + { + get => _ageValue; + set => SetProperty(ref _ageValue, value); + } + + /// + /// Property for "Height" value. + /// + public string HeightValue + { + get => _heightValue; + set => SetProperty(ref _heightValue, value); + } + + /// + /// Property for "CPlusPlusValue" value. + /// + public bool? CPlusPlusValue + { + get => _cplusplusValue; + set => SetProperty(ref _cplusplusValue, value); + } + + /// + /// Property for "C#" value. + /// + public bool? CSharpValue + { + get => _csharpValue; + set => SetProperty(ref _csharpValue, value); + } + + /// + /// Property for "Java" value. + /// + public bool? JavaValue + { + get => _javaValue; + set => SetProperty(ref _javaValue, value); + } + + /// + /// Save command. + /// + public ICommand SaveRequestCommand { get; } + + public event EventHandler OnSaveCompleteEvent; + + public event EventHandler OnLoadCompleteEvent; + + public event EventHandler OnInvalidDataEvent; + + #endregion + + #region methods + + /// + /// EditPreferencesViewModel class constructor. + /// Defines "Save" command. + /// Calls load preferences method. + /// + public EditPreferencesViewModel() + { + SaveRequestCommand = new Command(SavePreferences); + LoadPreferences(); + } + + /// + /// Stores data provided by user if data are correct. + /// + private void SavePreferences() + { + int tempAgeValue; + double tempHeightValue; + + if (int.TryParse(AgeValue, out tempAgeValue) && + double.TryParse(HeightValue, NumberStyles.Float, CultureInfo.InvariantCulture, out tempHeightValue)) + { + _model.Set("Name", NameValue); + _model.Set("Surname", SurnameValue); + _model.Set("Age", tempAgeValue); + _model.Set("Height", tempHeightValue); + _model.Set("CPlusPlus", CPlusPlusValue); + _model.Set("CSharp", CSharpValue); + _model.Set("Java", JavaValue); + OnSaveComplete(); + } + else + { + OnInvalidData(); + } + } + + /// + /// Loads stored data. + /// + public void LoadPreferences() + { + NameValue = _model.Get("Name").ToString(); + SurnameValue = _model.Get("Surname").ToString(); + AgeValue = _model.Get("Age").ToString(); + HeightValue = _model.Get("Height").ToString(); + CPlusPlusValue = _model.Get("CPlusPlus") as bool?; + CSharpValue = _model.Get("CSharp") as bool?; + JavaValue = _model.Get("Java") as bool?; + + OnLoadComplete(); + } + + /// + /// Invokes event handlers bound to OnSaveCompleteEvent. + /// + protected virtual void OnSaveComplete() + { + OnSaveCompleteEvent?.Invoke(this, EventArgs.Empty); + } + + /// + /// Invokes event handlers bound to OnLoadCompleteEvent. + /// + protected virtual void OnLoadComplete() + { + OnLoadCompleteEvent?.Invoke(this, EventArgs.Empty); + } + + /// + /// Invokes event handlers bound to OnInvalidDataEvent. + /// + protected virtual void OnInvalidData() + { + OnInvalidDataEvent?.Invoke(this, EventArgs.Empty); + } + + #endregion + } +} \ No newline at end of file diff --git a/Preference/src/Preference/Preference.Tizen.TV/ViewModels/ViewModelBase.cs b/Preference/src/Preference/Preference.Tizen.TV/ViewModels/ViewModelBase.cs new file mode 100755 index 0000000..c2f79cb --- /dev/null +++ b/Preference/src/Preference/Preference.Tizen.TV/ViewModels/ViewModelBase.cs @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2018 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.ComponentModel; +using System.Runtime.CompilerServices; + +namespace Preference.ViewModels +{ + /// + /// ViewModelBase class. + /// Provides dispatching event for property change. + /// + public class ViewModelBase : INotifyPropertyChanged + { + #region properties + + /// + /// Property change event. + /// + public event PropertyChangedEventHandler PropertyChanged; + + #endregion + + #region methods + + /// + /// Sets field value with + /// + /// + /// Field to store value. + /// Value. + /// Name of property triggering value change. + /// True if new value differs with value stored. False otherwise. + protected bool SetProperty(ref T storage, T value, [CallerMemberName] string propertyName = null) + { + if (Equals(storage, value)) + { + return false; + } + + storage = value; + OnPropertyChanged(propertyName); + return true; + } + + /// + /// Invokes PropertyChanged event. + /// + /// Changed property name + protected void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + #endregion + } +} \ No newline at end of file diff --git a/Preference/src/Preference/Preference.Tizen.TV/Views/EditPreferences.xaml b/Preference/src/Preference/Preference.Tizen.TV/Views/EditPreferences.xaml new file mode 100755 index 0000000..3f619f1 --- /dev/null +++ b/Preference/src/Preference/Preference.Tizen.TV/Views/EditPreferences.xaml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +