Fixed JIRA issue TNEXT-2897 65/148865/2 accepted/tizen/4.0/unified/20170911.155113 accepted/tizen/unified/20170911.160034 submit/tizen/20170911.075036 submit/tizen_4.0/20170911.075016
authorHyerim Kim <rimi.kim@samsung.com>
Mon, 11 Sep 2017 05:16:30 +0000 (14:16 +0900)
committerHyerim Kim <rimi.kim@samsung.com>
Mon, 11 Sep 2017 06:04:39 +0000 (15:04 +0900)
Adds packaing folder for building RPM package
Adds tpk package
 - When Apps is launched as pin mode, set the Done button's enable value following to whether is there are pinned apps or not.

Change-Id: I56f09d5cd90c818e973cc91cd5464d406c00ad75
Signed-off-by: Hyerim Kim <rimi.kim@samsung.com>
TVApps/TVApps/Views/FooterDeleteStatus.xaml.cs
TVApps/TVApps/Views/FooterPinStatus.xaml
TVApps/TVApps/Views/FooterPinStatus.xaml.cs
TVApps/TVApps/Views/MainPage.xaml.cs
TVHome/TVHome.Tizen.TV/bin/Debug/TVHome.TizenTV.tpk [new file with mode: 0755]
packaging/org.tizen.xahome.path [new file with mode: 0644]
packaging/org.tizen.xahome.service [new file with mode: 0644]
packaging/org.tizen.xahome.spec [new file with mode: 0644]

index 8dc85b3..7c7d203 100755 (executable)
@@ -29,16 +29,7 @@ namespace TVApps.Views
         /// <summary>
         /// The cancel button object
         /// </summary>
-        private Button CancelButton;
-
-        /// <summary>
-        /// Gets Cancel Button
-        /// </summary>
-        /// <returns>Returns Cancel Button</returns>
-        public Button GetCancelButton()
-        {
-            return CancelButton;
-        }
+        public Button CancelButton { private set; get; }
 
         /// <summary>
         /// A constructor
index 42e5dc3..a795986 100755 (executable)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <RelativeLayout xmlns="http://xamarin.com/schemas/2014/forms"
       xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
-      x:Class="TVApps.Views.FooterPinStatus">
+      x:Class="TVApps.Views.FooterPinStatus"
+      ButtonPinDoneCommand="{Binding ButtonPinDoneCommand}">
 
 </RelativeLayout>
\ No newline at end of file
index 25a7db0..cae1c74 100755 (executable)
@@ -15,6 +15,7 @@
  */
 
 using LibTVRefCommonPortable.Utils;
+using System.Windows.Input;
 using Xamarin.Forms;
 using Xamarin.Forms.PlatformConfiguration.TizenSpecific;
 
@@ -28,15 +29,7 @@ namespace TVApps.Views
         /// <summary>
         /// The Done button object
         /// </summary>
-        private Button DoneButton;
-        /// <summary>
-        /// Gets Done Button
-        /// </summary>
-        /// <returns>Returns Done Button object</returns>
-        public Button GetDoneButton()
-        {
-            return DoneButton;
-        }
+        public Button DoneButton { private set; get; }
 
         /// <summary>
         /// A Container for additional information labels
@@ -101,6 +94,20 @@ namespace TVApps.Views
         }
 
         /// <summary>
+        /// Identifies the ButtonPinDoneCommand bindable property
+        /// </summary>
+        public static readonly BindableProperty ButtonPinDoneCommandProperty = BindableProperty.Create("ButtonPinDoneCommand", typeof(Command), typeof(FooterPinStatus), default(Command));
+
+        /// <summary>
+        /// Gets or sets ButtonPinDoneCommand
+        /// </summary>
+        public ICommand ButtonPinDoneCommand
+        {
+            get { return (ICommand)GetValue(ButtonPinDoneCommandProperty); }
+            set { SetValue(ButtonPinDoneCommandProperty, value); }
+        }
+
+        /// <summary>
         /// A constructor
         /// </summary>
         public FooterPinStatus()
@@ -171,9 +178,14 @@ namespace TVApps.Views
             {
                 Text = "Done",
                 FontSize = SizeUtils.GetFontSize(28),
+                IsEnabled = false
             };
 
-            DoneButton.SetBinding(Button.CommandProperty, new Binding("ButtonPinDoneCommand"));
+            DoneButton.Clicked += DoneButtonClicked;
+            if (SumOfCheckedApp > 0)
+            {
+                IsEnabled = true;
+            }
 
             this.Children.Add(DoneButton,
                 heightConstraint: Constraint.Constant(SizeUtils.GetHeightSize(80)),
@@ -182,6 +194,11 @@ namespace TVApps.Views
                 xConstraint: Constraint.Constant(SizeUtils.GetWidthSize(96 + 1332 + 96)));
         }
 
+        private void DoneButtonClicked(object sender, System.EventArgs e)
+        {
+            ButtonPinDoneCommand?.Execute("");
+        }
+
         /// <summary>
         /// This method is called when the properties of FooterPinStatus is changed
         /// </summary>
@@ -191,6 +208,15 @@ namespace TVApps.Views
         {
             if (e.PropertyName.Equals("SumOfCheckedApp"))
             {
+                if (SumOfCheckedApp > 0)
+                {
+                    DoneButton.IsEnabled = true;
+                }
+                else
+                {
+                    DoneButton.IsEnabled = false;
+                }
+
                 if (pinnedAppCount > SumOfCheckedApp)
                 {
                     AppNameLabel.Text = UnpinnedAppName;
index 90f0721..c801692 100755 (executable)
@@ -340,20 +340,19 @@ namespace TVApps.Views
         private void SetFocusChainingUpAndDownForDeleteMode(double scrollX)
         {
             List<View> lowerList = AppList.GetAppsLowerList().ToList();
-            Button cancelButton = FooterDelete.GetCancelButton();
 
             foreach (var item in lowerList)
             {
                 Button button = item.FindByName<Button>("ButtonFocusArea");
-                button?.On<Tizen>()?.SetNextFocusDownView(cancelButton);
+                button?.On<Tizen>()?.SetNextFocusDownView(FooterDelete.CancelButton);
             }
 
             if (lowerList.Count > 0)
             {
-                cancelButton?.On<Tizen>()?.SetNextFocusUpView(lowerList[lowerList.Count - 1].FindByName<Button>("ButtonFocusArea"));
+                FooterDelete.CancelButton?.On<Tizen>()?.SetNextFocusUpView(lowerList[lowerList.Count - 1].FindByName<Button>("ButtonFocusArea"));
             }
 
-            cancelButton?.On<Tizen>()?.SetNextFocusLeftView(cancelButton);
+            FooterDelete.CancelButton?.On<Tizen>()?.SetNextFocusLeftView(FooterDelete.CancelButton);
         }
 
         /// <summary>
@@ -362,20 +361,19 @@ namespace TVApps.Views
         private void SetFocusChainingUpAndDownForPinMode(double scrollX)
         {
             List<View> lowerList = AppList.GetAppsLowerList().ToList();
-            Button doneButton = FooterPin.GetDoneButton();
 
             foreach (var item in lowerList)
             {
                 Button button = item.FindByName<Button>("ButtonFocusArea");
-                button?.On<Tizen>()?.SetNextFocusDownView(doneButton);
+                button?.On<Tizen>()?.SetNextFocusDownView(FooterPin.DoneButton);
             }
 
             if (lowerList.Count > 0)
             {
-                doneButton?.On<Tizen>()?.SetNextFocusUpView(lowerList[lowerList.Count - 1].FindByName<Button>("ButtonFocusArea"));
+                FooterPin.DoneButton?.On<Tizen>()?.SetNextFocusUpView(lowerList[lowerList.Count - 1].FindByName<Button>("ButtonFocusArea"));
             }
 
-            doneButton?.On<Tizen>()?.SetNextFocusLeftView(doneButton);
+            FooterPin.DoneButton?.On<Tizen>()?.SetNextFocusLeftView(FooterPin.DoneButton);
         }
 
         /// <summary>
diff --git a/TVHome/TVHome.Tizen.TV/bin/Debug/TVHome.TizenTV.tpk b/TVHome/TVHome.Tizen.TV/bin/Debug/TVHome.TizenTV.tpk
new file mode 100755 (executable)
index 0000000..d5dbd0e
Binary files /dev/null and b/TVHome/TVHome.Tizen.TV/bin/Debug/TVHome.TizenTV.tpk differ
diff --git a/packaging/org.tizen.xahome.path b/packaging/org.tizen.xahome.path
new file mode 100644 (file)
index 0000000..4d7d360
--- /dev/null
@@ -0,0 +1,5 @@
+[Unit]
+Description=This path will tell you that home is ready to launch
+
+[Path]
+PathExists=/run/.wm_ready
diff --git a/packaging/org.tizen.xahome.service b/packaging/org.tizen.xahome.service
new file mode 100644 (file)
index 0000000..1cab992
--- /dev/null
@@ -0,0 +1,7 @@
+[Unit]
+Description=TV Home
+Requires=launchpad-process-pool.service
+After=launchpad-process-pool.service
+
+[Service]
+ExecStart=/bin/sh -c -l '/usr/bin/aul_test launch org.tizen.xahome'
diff --git a/packaging/org.tizen.xahome.spec b/packaging/org.tizen.xahome.spec
new file mode 100644 (file)
index 0000000..019d4c9
--- /dev/null
@@ -0,0 +1,61 @@
+Name:       org.tizen.xahome
+Summary:    TV home application
+Version:    1.0.0
+Release:    1
+Group:      Applications
+License:    Flora-1.1
+Source0:    %{name}-%{version}.tar.gz
+Source1:    %{name}.service
+Source2:    %{name}.path
+
+BuildRequires:  pkgconfig(libtzplatform-config)
+Requires(post):  /usr/bin/tpk-backend
+
+%define _sysuserdir systemd/user
+%define _servicedir systemd/user/default.target.wants
+
+%define internal_name org.tizen.xahome
+%define preload_tpk_path %{TZ_SYS_RO_APP}/.preload-tpk
+
+%define build_mode %{nil}
+
+%ifarch arm armv7l
+%define target arm
+%endif
+%ifarch aarch64
+%define target aarch64
+%endif
+%ifarch x86_64
+%define target x86_64
+%endif
+%ifarch i386 i486 i586 i686
+%define target i386
+%endif
+%description
+This is a container package which have preload TPK files
+
+%prep
+%setup -q
+
+%build
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}%{preload_tpk_path}
+install TVHome/TVHome.Tizen.TV/bin/Debug/TVHome.TizenTV.tpk %{buildroot}%{preload_tpk_path}/
+install --directory %{buildroot}%{_prefix}/lib/%{_servicedir}
+install -m 0644 %{SOURCE1} %{buildroot}%{_prefix}/lib/%{_sysuserdir}
+install -m 0644 %{SOURCE2} %{buildroot}%{_prefix}/lib/%{_sysuserdir}
+ln -sf ../%{name}.path %{buildroot}%{_prefix}/lib/%{_servicedir}
+
+%post
+chsmack %{_prefix}/lib/%{_sysuserdir}/%{name}.service -a "_"
+chsmack %{_prefix}/lib/%{_sysuserdir}/%{name}.path -a "_"
+chsmack %{_prefix}/lib/%{_servicedir}/%{name}.path -a "_"
+
+%files
+%defattr(-,root,root,-)
+%{preload_tpk_path}/*.tpk
+%{_prefix}/lib/%{_sysuserdir}/%{name}.service
+%{_prefix}/lib/%{_sysuserdir}/%{name}.path
+%{_prefix}/lib/%{_servicedir}/%{name}.path