diff options
author | Heonjae.Jang <Heonjae.Jang@samsung.com> | 2017-09-22 17:53:53 +0900 |
---|---|---|
committer | Heonjae.Jang <Heonjae.Jang@samsung.com> | 2017-09-22 17:53:53 +0900 |
commit | 0d6a206db8ddd26550a1e1ca16fccb5fd1da5656 (patch) | |
tree | 0e9a3d29f656e4c1322213481ba82d3d7705fad7 | |
parent | f5c53a8be0a32bb3c1d27c350f24c0a108ee96f0 (diff) | |
download | mediahub-0d6a206db8ddd26550a1e1ca16fccb5fd1da5656.tar.gz mediahub-0d6a206db8ddd26550a1e1ca16fccb5fd1da5656.tar.bz2 mediahub-0d6a206db8ddd26550a1e1ca16fccb5fd1da5656.zip |
Fix Issues [TNEXT-3689]
Change-Id: Ie4b182c052d7c47b45a365da894f0dff4949e36c
Signed-off-by: Heonjae.Jang <Heonjae.Jang@samsung.com>
4 files changed, 86 insertions, 27 deletions
diff --git a/TVMediaHub/TVMediaHub.Tizen/Views/FooterDeleteStatus.xaml.cs b/TVMediaHub/TVMediaHub.Tizen/Views/FooterDeleteStatus.xaml.cs index 2c586d7..460b502 100755 --- a/TVMediaHub/TVMediaHub.Tizen/Views/FooterDeleteStatus.xaml.cs +++ b/TVMediaHub/TVMediaHub.Tizen/Views/FooterDeleteStatus.xaml.cs @@ -19,6 +19,7 @@ using Xamarin.Forms; using Xamarin.Forms.Xaml; using TVMediaHub.Tizen.Utils; using Xamarin.Forms.PlatformConfiguration.TizenSpecific; +using TizenVisualElement = Xamarin.Forms.PlatformConfiguration.TizenSpecific.VisualElement; namespace TVMediaHub.Tizen.Views { @@ -146,10 +147,12 @@ namespace TVMediaHub.Tizen.Views if (SelectedCount > 0) { OkButton.IsEnabled = true; + SetFocusChain(); } else { OkButton.IsEnabled = false; + SetFocusChain(); } if (SelectedCount > 1) { @@ -192,5 +195,31 @@ namespace TVMediaHub.Tizen.Views LabelCount.Text = "0 " + ContentType; LabelText.Text = "is Selected"; } + + public void SetFocusChain() + { + TizenVisualElement.SetNextFocusLeftView(SelectAllButton, SelectAllButton); + TizenVisualElement.SetNextFocusDownView(SelectAllButton, SelectAllButton); + + TizenVisualElement.SetNextFocusDownView(OkButton, OkButton); + + TizenVisualElement.SetNextFocusRightView(CancelButton, CancelButton); + TizenVisualElement.SetNextFocusDownView(CancelButton, CancelButton); + + if (OkButton.IsEnabled) + { + TizenVisualElement.SetNextFocusRightView(SelectAllButton, OkButton); + + TizenVisualElement.SetNextFocusLeftView(OkButton, SelectAllButton); + TizenVisualElement.SetNextFocusRightView(OkButton, CancelButton); + + TizenVisualElement.SetNextFocusLeftView(CancelButton, OkButton); + } + else + { + TizenVisualElement.SetNextFocusRightView(SelectAllButton, CancelButton); + TizenVisualElement.SetNextFocusLeftView(CancelButton, SelectAllButton); + } + } } } diff --git a/TVMediaHub/TVMediaHub.Tizen/Views/FooterNormalStatus.xaml.cs b/TVMediaHub/TVMediaHub.Tizen/Views/FooterNormalStatus.xaml.cs index a3f580e..5a986cd 100755 --- a/TVMediaHub/TVMediaHub.Tizen/Views/FooterNormalStatus.xaml.cs +++ b/TVMediaHub/TVMediaHub.Tizen/Views/FooterNormalStatus.xaml.cs @@ -22,6 +22,7 @@ using Xamarin.Forms.Xaml; using Tizen.Xamarin.Forms.Extension; using TVMediaHub.Tizen.Utils; using TVMediaHub.Tizen.DataModels; +using TizenVisualElement = Xamarin.Forms.PlatformConfiguration.TizenSpecific.VisualElement; namespace TVMediaHub.Tizen.Views { @@ -242,5 +243,20 @@ namespace TVMediaHub.Tizen.Views popup.Show(ButtonOption, (ButtonOption.Width / 2), 0); isPopupShowing = true; } + + public void SetFocusChain() + { + TizenVisualElement.SetNextFocusLeftView(DropdownSource, DropdownSource); + TizenVisualElement.SetNextFocusRightView(DropdownSource, DropdownSort); + TizenVisualElement.SetNextFocusDownView(DropdownSource, DropdownSource); + + TizenVisualElement.SetNextFocusLeftView(DropdownSort, DropdownSource); + TizenVisualElement.SetNextFocusRightView(DropdownSort, ButtonOption); + TizenVisualElement.SetNextFocusDownView(DropdownSort, DropdownSort); + + TizenVisualElement.SetNextFocusLeftView(ButtonOption, DropdownSort); + TizenVisualElement.SetNextFocusRightView(ButtonOption, ButtonOption); + TizenVisualElement.SetNextFocusDownView(ButtonOption, ButtonOption); + } } } diff --git a/TVMediaHub/TVMediaHub.Tizen/Views/ImageTab.xaml.cs b/TVMediaHub/TVMediaHub.Tizen/Views/ImageTab.xaml.cs index 29753d1..48b1e0d 100755 --- a/TVMediaHub/TVMediaHub.Tizen/Views/ImageTab.xaml.cs +++ b/TVMediaHub/TVMediaHub.Tizen/Views/ImageTab.xaml.cs @@ -28,6 +28,7 @@ using TVMediaHub.Tizen.ViewModels; using Xamarin.Forms; using Xamarin.Forms.PlatformConfiguration.TizenSpecific; using static TVMediaHub.Tizen.Views.ImageItem; +using TizenVisualElement = Xamarin.Forms.PlatformConfiguration.TizenSpecific.VisualElement; namespace TVMediaHub.Tizen.Views { @@ -251,6 +252,10 @@ namespace TVMediaHub.Tizen.Views BottomButtonList.Clear(); } } + else if (e.PropertyName.Equals("ImageTabStatus")) + { + SetFooterFocusChain(ImageTabScrollView.ScrollX); + } } /// <summary> @@ -440,12 +445,15 @@ namespace TVMediaHub.Tizen.Views /// <param name="scrollX">The current X position of the scroll</param> private void SetFooterFocusChain(double scrollX) { + FooterNormal.SetFocusChain(); + FooterDelete.SetFocusChain(); var Padding = SizeUtils.GetWidthSize(96); var ItemWidth = SizeUtils.GetWidthSize(180); var FocusableBoundFrom = scrollX; var FocusableBoundTo = scrollX + SizeUtils.BaseScreenWidth - ItemWidth; - var list = BottomButtonList.FindAll((pair) => { + var list = BottomButtonList.FindAll((pair) => + { Console.WriteLine("Pair.key " + pair.Key); return (pair.Key >= FocusableBoundFrom && pair.Key <= FocusableBoundTo); }); @@ -459,40 +467,39 @@ namespace TVMediaHub.Tizen.Views { if (ImageTabStatus == TabStatus.Delete) { - btn.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusDownView(FooterDelete.GetSelectAllButton()); - // TODO : FooterDelete.GetSelectAllButton().DropdownSource.ButtonOption.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusUpView(btn); + TizenVisualElement.SetNextFocusDownView(btn, FooterDelete.GetSelectAllButton()); + TizenVisualElement.SetNextFocusUpView(FooterDelete.GetSelectAllButton(), btn); } else { - btn.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusDownView(FooterNormal.DropdownSource); - // TODO : FooterNormal.DropdownSource.ButtonOption.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusUpView(btn); + TizenVisualElement.SetNextFocusDownView(btn, FooterNormal.DropdownSource); + TizenVisualElement.SetNextFocusUpView(FooterNormal.DropdownSource, btn); } } else if (buttonIndex == list.Count - 1) { if (ImageTabStatus == TabStatus.Delete) { - btn.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusDownView(FooterDelete.GetCancelButton()); - FooterDelete.GetCancelButton().On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusUpView(btn); + TizenVisualElement.SetNextFocusDownView(btn, FooterDelete.GetCancelButton()); + TizenVisualElement.SetNextFocusUpView(FooterDelete.GetCancelButton(), btn); } else { - btn.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusDownView(FooterNormal.ButtonOption); - // TODO : Uncomment before TDC - //FooterNormal.ButtonOption.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusUpView(btn); + TizenVisualElement.SetNextFocusDownView(btn, FooterNormal.ButtonOption); + TizenVisualElement.SetNextFocusUpView(FooterNormal.ButtonOption, btn); } } else { if (ImageTabStatus == TabStatus.Delete) { - btn.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusDownView(FooterDelete.GetOkButton()); - // TODO :FooterDelete.GetCancelAllButton().ButtonOption.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusUpView(btn); + TizenVisualElement.SetNextFocusDownView(btn, FooterDelete.GetOkButton()); + TizenVisualElement.SetNextFocusUpView(FooterDelete.GetOkButton(), btn); } else { - btn.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusDownView(FooterNormal.DropdownSort); - // TODO : FooterNormal.DropdownSort.ButtonOption.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusUpView(btn); + TizenVisualElement.SetNextFocusDownView(btn, FooterNormal.DropdownSort); + TizenVisualElement.SetNextFocusUpView(FooterNormal.DropdownSort, btn); } } } diff --git a/TVMediaHub/TVMediaHub.Tizen/Views/VideoTab.xaml.cs b/TVMediaHub/TVMediaHub.Tizen/Views/VideoTab.xaml.cs index b135fef..5ef3c01 100755 --- a/TVMediaHub/TVMediaHub.Tizen/Views/VideoTab.xaml.cs +++ b/TVMediaHub/TVMediaHub.Tizen/Views/VideoTab.xaml.cs @@ -24,6 +24,7 @@ using TVMediaHub.Tizen.Models; using TVMediaHub.Tizen.Utils; using TVMediaHub.Tizen.ViewModels; using Xamarin.Forms; +using TizenVisualElement = Xamarin.Forms.PlatformConfiguration.TizenSpecific.VisualElement; namespace TVMediaHub.Tizen.Views { @@ -241,6 +242,10 @@ namespace TVMediaHub.Tizen.Views BottomButtonList.Clear(); } } + else if (e.PropertyName.Equals("VideoTabStatus")) + { + SetFooterFocusChain(VideoTabScrollView.ScrollX); + } } /// <summary> @@ -432,6 +437,9 @@ namespace TVMediaHub.Tizen.Views /// <param name="scrollX">The current X position of the scroll</param> private void SetFooterFocusChain(double scrollX) { + FooterNormal.SetFocusChain(); + FooterDelete.SetFocusChain(); + var Padding = SizeUtils.GetWidthSize(96); var ItemWidth = SizeUtils.GetWidthSize(320); @@ -449,40 +457,39 @@ namespace TVMediaHub.Tizen.Views { if (VideoTabStatus == TabStatus.Delete) { - btn.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusDownView(FooterDelete.GetSelectAllButton()); - // TODO : FooterDelete.GetSelectAllButton().DropdownSource.ButtonOption.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusUpView(btn); + TizenVisualElement.SetNextFocusDownView(btn, FooterDelete.GetSelectAllButton()); + TizenVisualElement.SetNextFocusUpView(FooterDelete.GetSelectAllButton(), btn); } else { - btn.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusDownView(FooterNormal.DropdownSource); - // TODO : FooterNormal.DropdownSource.ButtonOption.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusUpView(btn); + TizenVisualElement.SetNextFocusDownView(btn, FooterNormal.DropdownSource); + TizenVisualElement.SetNextFocusUpView(FooterNormal.DropdownSource, btn); } } else if (buttonIndex == list.Count - 1) { if (VideoTabStatus == TabStatus.Delete) { - btn.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusDownView(FooterDelete.GetCancelButton()); - FooterDelete.GetCancelButton().On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusUpView(btn); + TizenVisualElement.SetNextFocusDownView(btn, FooterDelete.GetCancelButton()); + TizenVisualElement.SetNextFocusUpView(FooterDelete.GetCancelButton(), btn); } else { - btn.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusDownView(FooterNormal.ButtonOption); - // TODO : Uncomment before TDC - //FooterNormal.ButtonOption.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusUpView(btn); + TizenVisualElement.SetNextFocusDownView(btn, FooterNormal.ButtonOption); + TizenVisualElement.SetNextFocusUpView(FooterNormal.ButtonOption, btn); } } else { if (VideoTabStatus == TabStatus.Delete) { - btn.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusDownView(FooterDelete.GetOkButton()); - // TODO :FooterDelete.GetCancelAllButton().ButtonOption.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusUpView(btn); + TizenVisualElement.SetNextFocusDownView(btn, FooterDelete.GetOkButton()); + TizenVisualElement.SetNextFocusUpView(FooterDelete.GetOkButton(), btn); } else { - btn.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusDownView(FooterNormal.DropdownSort); - // TODO : FooterNormal.DropdownSort.ButtonOption.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetNextFocusUpView(btn); + TizenVisualElement.SetNextFocusDownView(btn, FooterNormal.DropdownSort); + TizenVisualElement.SetNextFocusUpView(FooterNormal.DropdownSort, btn); } } } |