From: Heonjae Jang Date: Fri, 24 Feb 2017 03:55:19 +0000 (+0900) Subject: Add Label Animation & StyleCop check X-Git-Tag: submit/tizen/20170808.015446~238 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1b4b72d7057b6a7242aa51e68c906ddefcf930e3;p=profile%2Ftv%2Fapps%2Fdotnet%2Fhome.git Add Label Animation & StyleCop check 1. Add PanelButton Label Animation on Focused, Unfocused 2. Add PanelButton Label line break mode. 3. Add Image in SubPanelButton 4. StyleCop check Change-Id: If221c8451f17e8b4fc1a5fe29af06cf696af0360 --- diff --git a/TVHome/TVHome.TizenTV/Ports/ApplicationManagerPort.cs b/TVHome/TVHome.TizenTV/Ports/ApplicationManagerPort.cs index 66615f4..600f43e 100644 --- a/TVHome/TVHome.TizenTV/Ports/ApplicationManagerPort.cs +++ b/TVHome/TVHome.TizenTV/Ports/ApplicationManagerPort.cs @@ -24,40 +24,40 @@ using TVHome.Utils; namespace TVHome.TizenTV.Ports { - class ApplicationManagerPort : IApplicationManagerAPIs - { - public ApplicationManagerPort() - { - ApplicationManager.ApplicationLaunched += new EventHandler(OnApplicationLaunched); - } - - void OnApplicationLaunched(object sender, EventArgs args) - { - ApplicationLaunchedEventArgs launchedEventArgs = args as ApplicationLaunchedEventArgs; - - DebuggingUtils.Dbg(launchedEventArgs.ApplicationInfo.Label.ToString() + " launched"); - } - - public async Task> GetRecentApplications() - { - // RUA가 지원되지 않으므로 일단 설치된 app들을 가져와 본다 - // TODO: RUA로 대체한다 - Dictionary resultList = new Dictionary(); - var applicationList = await ApplicationManager.GetInstalledApplicationsAsync(); - string[] result; - - foreach (ApplicationInfo appInfo in applicationList) - { - result = new string[3]; - - result[0] = appInfo.Label != null ? appInfo.Label : null; - result[1] = appInfo.ApplicationId != null ? appInfo.ApplicationId : null; - result[2] = appInfo.IconPath != null ? appInfo.IconPath : null; - - resultList.Add(appInfo.ApplicationId, result); - } - - return resultList; - } - } + class ApplicationManagerPort : IApplicationManagerAPIs + { + public ApplicationManagerPort() + { + ApplicationManager.ApplicationLaunched += new EventHandler(OnApplicationLaunched); + } + + void OnApplicationLaunched(object sender, EventArgs args) + { + ApplicationLaunchedEventArgs launchedEventArgs = args as ApplicationLaunchedEventArgs; + + DebuggingUtils.Dbg(launchedEventArgs.ApplicationInfo.Label.ToString() + " launched"); + } + + public async Task> GetRecentApplications() + { + // RUA가 지원되지 않으므로 일단 설치된 app들을 가져와 본다 + // TODO: RUA로 대체한다 + Dictionary resultList = new Dictionary(); + var applicationList = await ApplicationManager.GetInstalledApplicationsAsync(); + string[] result; + + foreach (ApplicationInfo appInfo in applicationList) + { + result = new string[3]; + + result[0] = appInfo.Label != null ? appInfo.Label : null; + result[1] = appInfo.ApplicationId != null ? appInfo.ApplicationId : null; + result[2] = appInfo.IconPath != null ? appInfo.IconPath : null; + + resultList.Add(appInfo.ApplicationId, result); + } + + return resultList; + } + } } \ No newline at end of file diff --git a/TVHome/TVHome.TizenTV/Ports/DBPort.cs b/TVHome/TVHome.TizenTV/Ports/DBPort.cs index 554328d..81420b3 100644 --- a/TVHome/TVHome.TizenTV/Ports/DBPort.cs +++ b/TVHome/TVHome.TizenTV/Ports/DBPort.cs @@ -82,45 +82,46 @@ namespace TVHome.TizenTV.Ports public DBPort() { // TODO : make a unit test for this!!! - DebuggingPort.d("DBPort-------------------------------------"); - DebuggingPort.d("version " + ExecSQL("csk", "SELECT SQLITE_VERSION()")); - DebuggingPort.d("create " + ExecSQL("csk", "CREATE TABLE friends(Id INTEGER PRIMARY KEY, Name TEXT);")); + DebuggingPort.D("DBPort-------------------------------------"); + DebuggingPort.D("version " + ExecSQL("csk", "SELECT SQLITE_VERSION()")); + DebuggingPort.D("create " + ExecSQL("csk", "CREATE TABLE friends(Id INTEGER PRIMARY KEY, Name TEXT);")); - DebuggingPort.d("insert 1 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Tom');")); - DebuggingPort.d("insert 2 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Rebecca');")); - DebuggingPort.d("insert 3 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Jim');")); - DebuggingPort.d("insert 4 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Roger');")); - DebuggingPort.d("insert 5 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Robert');")); + DebuggingPort.D("insert 1 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Tom');")); + DebuggingPort.D("insert 2 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Rebecca');")); + DebuggingPort.D("insert 3 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Jim');")); + DebuggingPort.D("insert 4 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Roger');")); + DebuggingPort.D("insert 5 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Robert');")); IEnumerable dbItems = new List(); - DebuggingPort.d("select " + ExecSQL("csk", "SELECT * FROM friends;", out dbItems)); + DebuggingPort.D("select " + ExecSQL("csk", "SELECT * FROM friends;", out dbItems)); foreach (var item in dbItems) { foreach (var value in item.ItemProperties) { - DebuggingPort.d("column[" + value.Key + "] = " + value.Value); + DebuggingPort.D("column[" + value.Key + "] = " + value.Value); } } - DebuggingPort.d("insert 5 " + ExecSQL("csk", "DROP TABLE friends;")); + DebuggingPort.D("insert 5 " + ExecSQL("csk", "DROP TABLE friends;")); } private static bool CheckResult(int res, string desc) { if (res != SQLITE_OK) { - DebuggingPort.d(String.Format("DB Error [{0}], {1}", desc, res)); + DebuggingPort.D(String.Format("DB Error [{0}], {1}", desc, res)); return false; } + return true; } private static bool Open(string dbName, out IntPtr handle) { - DebuggingPort.d("[DB Open]"); + DebuggingPort.D("[DB Open]"); if (dbName == null) { - DebuggingPort.e("DB Name is NULL!!!"); + DebuggingPort.E("DB Name is NULL!!!"); handle = IntPtr.Zero; return false; } @@ -133,7 +134,7 @@ namespace TVHome.TizenTV.Ports private static void Close(IntPtr handle) { - DebuggingPort.d("[DB Close]"); + DebuggingPort.D("[DB Close]"); if (handle == null) { return; @@ -168,14 +169,14 @@ namespace TVHome.TizenTV.Ports { if (dbName == null || sql == null) { - DebuggingPort.e("Invalid argument!!!"); + DebuggingPort.E("Invalid argument!!!"); return false; } DBHandleRAII db = new DBHandleRAII(dbName); if (db.handle == IntPtr.Zero) { - DebuggingPort.e("DB open failed!!!"); + DebuggingPort.E("DB open failed!!!"); return false; } @@ -187,15 +188,16 @@ namespace TVHome.TizenTV.Ports private int ExecCallback(IntPtr notUsed, int numberOfColumn, IntPtr value, IntPtr column) { - DebuggingPort.d("ExecCallback"); + DebuggingPort.D("ExecCallback"); for (int i = 1; i < numberOfColumn; i++) { string _value = Marshal.PtrToStringAnsi(Marshal.ReadIntPtr(value, i * PtrSize)); - DebuggingPort.e("" + i + " - " + _value + " / "); + DebuggingPort.E("" + i + " - " + _value + " / "); DBItem item = new DBItem(); item.Add(i, _value); givenItems.Add(item); } + return 0; } @@ -204,17 +206,17 @@ namespace TVHome.TizenTV.Ports givenItems.Clear(); items = givenItems; - DebuggingPort.d("ExecSQL"); + DebuggingPort.D("ExecSQL"); if (dbName == null || sql == null) { - DebuggingPort.e("Invalid argument!!!"); + DebuggingPort.E("Invalid argument!!!"); return false; } DBHandleRAII db = new DBHandleRAII(dbName); if (db.handle == IntPtr.Zero) { - DebuggingPort.e("DB open failed!!!"); + DebuggingPort.E("DB open failed!!!"); return false; } diff --git a/TVHome/TVHome.TizenTV/Ports/DebuggingPort.cs b/TVHome/TVHome.TizenTV/Ports/DebuggingPort.cs index e360a33..934d2b8 100644 --- a/TVHome/TVHome.TizenTV/Ports/DebuggingPort.cs +++ b/TVHome/TVHome.TizenTV/Ports/DebuggingPort.cs @@ -79,12 +79,12 @@ namespace TVHome.TizenTV.Ports toast.Show(); } - public static void d(string message) + public static void D(string message) { Log.Debug(TAG, message); } - public static void e(string message) + public static void E(string message) { Log.Error(TAG, message); } diff --git a/TVHome/TVHome.TizenTV/Ports/FileSystemWatcherPort.cs b/TVHome/TVHome.TizenTV/Ports/FileSystemWatcherPort.cs index 7c7cc17..601bd56 100644 --- a/TVHome/TVHome.TizenTV/Ports/FileSystemWatcherPort.cs +++ b/TVHome/TVHome.TizenTV/Ports/FileSystemWatcherPort.cs @@ -28,7 +28,7 @@ namespace TVHome.TizenTV.Ports public event EventHandler CustomChanged; private FileSystemEventCustomArgs args; - public void run() + public void Run() { watcher = new FileSystemWatcher(); watcher.Path = "/opt/usr/home/owner/share/"; @@ -49,7 +49,8 @@ namespace TVHome.TizenTV.Ports { CustomChanged(this, args); } - DebuggingPort.d(e.ChangeType + ", " + e.Name); + + DebuggingPort.D(e.ChangeType + ", " + e.Name); } } } diff --git a/TVHome/TVHome.TizenTV/Ports/PackageManagerPort.cs b/TVHome/TVHome.TizenTV/Ports/PackageManagerPort.cs index a213fb8..a27a588 100644 --- a/TVHome/TVHome.TizenTV/Ports/PackageManagerPort.cs +++ b/TVHome/TVHome.TizenTV/Ports/PackageManagerPort.cs @@ -38,13 +38,17 @@ namespace TVHome.TizenTV.Ports private void PackageManager_UninstallProgressChanged(object sender, PackageManagerEventArgs e) { if (e.State == PackageEventState.Completed) + { DebuggingUtils.Dbg("uninstall completed"); + } } private void PackageManager_InstallProgressChanged(object sender, PackageManagerEventArgs e) { if (e.State == PackageEventState.Completed) + { DebuggingUtils.Dbg("install completed"); + } } public Dictionary GetPackageList() @@ -67,7 +71,7 @@ namespace TVHome.TizenTV.Ports result[0] = null; } - if ( item.Id != null) + if (item.Id != null) { result[1] = item.Id; } @@ -76,7 +80,7 @@ namespace TVHome.TizenTV.Ports result[1] = null; } - if ( item.IconPath != null) + if (item.IconPath != null) { result[2] = item.IconPath; } @@ -96,9 +100,13 @@ namespace TVHome.TizenTV.Ports Package tempItem = PackageManager.GetPackage(PkgID); if (tempItem != null) + { return tempItem.Label; + } else + { return null; + } } } } \ No newline at end of file diff --git a/TVHome/TVHome.TizenTV/TVHome.TizenTV.cs b/TVHome/TVHome.TizenTV/TVHome.TizenTV.cs index da47666..1b7fba5 100644 --- a/TVHome/TVHome.TizenTV/TVHome.TizenTV.cs +++ b/TVHome/TVHome.TizenTV/TVHome.TizenTV.cs @@ -25,9 +25,9 @@ namespace TVHome.TizenTV AppResourcePath = DirectoryInfo.Resource; AppDataPath = DirectoryInfo.Data; - // TODO : remove this. - // var dbPort = new DBPort(); - DebuggingPort.d("I'm here"); + // TODO : remove this. + // var dbPort = new DBPort(); + DebuggingPort.D("I'm here"); LoadApplication(new App()); } @@ -42,7 +42,7 @@ namespace TVHome.TizenTV global::Xamarin.Forms.DependencyService.Register(); global::Xamarin.Forms.DependencyService.Register(); global::Xamarin.Forms.DependencyService.Register(); - global::Xamarin.Forms.Platform.Tizen.Forms.Init(app); + global::Xamarin.Forms.Platform.Tizen.Forms.Init(app); app.Run(args); } } diff --git a/TVHome/TVHome.TizenTV/TVHome.TizenTV.csproj b/TVHome/TVHome.TizenTV/TVHome.TizenTV.csproj index b5372e1..69739e4 100644 --- a/TVHome/TVHome.TizenTV/TVHome.TizenTV.csproj +++ b/TVHome/TVHome.TizenTV/TVHome.TizenTV.csproj @@ -51,6 +51,7 @@ + @@ -61,9 +62,6 @@ - - - {54dd6673-7e64-48e6-a008-4d455e19e017} diff --git a/TVHome/TVHome/Controls/MainPanelButton.xaml b/TVHome/TVHome/Controls/MainPanelButton.xaml index 41f4f97..afd10c7 100644 --- a/TVHome/TVHome/Controls/MainPanelButton.xaml +++ b/TVHome/TVHome/Controls/MainPanelButton.xaml @@ -2,21 +2,28 @@ - - - -