diff options
author | Sung-jae Park <nicesj@nicesj.com> | 2017-09-11 04:57:58 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.ap-northeast-2.compute.internal> | 2017-09-11 04:57:58 +0000 |
commit | f39bdc5cdf889115f7c2907a5f460690fb72dea7 (patch) | |
tree | 7842f80c7c0e3a28cd3e4e7a69753e2b650ce040 | |
parent | c19d865a3c356e2f445bc659e33692c44c981bb0 (diff) | |
parent | 81659fb1e028bc240fa0ae07e6af5e0e316fbd63 (diff) | |
download | mediahub-f39bdc5cdf889115f7c2907a5f460690fb72dea7.tar.gz mediahub-f39bdc5cdf889115f7c2907a5f460690fb72dea7.tar.bz2 mediahub-f39bdc5cdf889115f7c2907a5f460690fb72dea7.zip |
Merge "Added await keyword for the asynchronous methods." into tizen
-rwxr-xr-x | TVMediaHub/TVMediaHub.Tizen/Views/ImageTab.xaml.cs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/TVMediaHub/TVMediaHub.Tizen/Views/ImageTab.xaml.cs b/TVMediaHub/TVMediaHub.Tizen/Views/ImageTab.xaml.cs index e5548ed..777b9e2 100755 --- a/TVMediaHub/TVMediaHub.Tizen/Views/ImageTab.xaml.cs +++ b/TVMediaHub/TVMediaHub.Tizen/Views/ImageTab.xaml.cs @@ -444,10 +444,12 @@ namespace TVMediaHub.Tizen.Views var FocusableBoundFrom = scrollX; var FocusableBoundTo = scrollX + SizeUtils.BaseScreenWidth - ItemWidth; - var list = BottomButtonList.FindAll((pair) => (pair.Key >= FocusableBoundFrom && pair.Key <= FocusableBoundTo)); + var list = BottomButtonList.FindAll((pair) => { + Console.WriteLine("Pair.key " + pair.Key); + return (pair.Key >= FocusableBoundFrom && pair.Key <= FocusableBoundTo); + }); - string what = "The number of filtered objects is " + list?.Count + "(" + FocusableBoundFrom + ")" + "(" + FocusableBoundTo + ")"; - Console.WriteLine(what); + Console.WriteLine("{0} - {1}", FocusableBoundFrom, FocusableBoundTo); for (var buttonIndex = 0; buttonIndex < list.Count; buttonIndex++) { @@ -501,13 +503,13 @@ namespace TVMediaHub.Tizen.Views /// <param name="targetX">The given target</param> /// <param name="targetWidth">The width of the given target</param> /// <param name="padding">The padding of the given target</param> - private void ScrollToTarget(double targetX, int targetWidth, int padding) + private async void ScrollToTarget(double targetX, int targetWidth, int padding) { var ScrollX = ImageTabScrollView.ScrollX; - var ScrollBoundFrom = targetX - (SizeUtils.BaseScreenWidth - targetWidth - padding); + var ScrollBoundFrom = targetX - (double)(SizeUtils.BaseScreenWidth - targetWidth - padding); ScrollBoundFrom = ScrollBoundFrom > 0 ? ScrollBoundFrom : 0; - var ScrollBoundTo = targetX - padding; + var ScrollBoundTo = targetX - (double)padding; ScrollBoundTo = ScrollBoundTo > 0 ? ScrollBoundTo : 0; // Is Focusable. @@ -518,13 +520,13 @@ namespace TVMediaHub.Tizen.Views if (Math.Abs(ScrollX - ScrollBoundFrom) > Math.Abs(ScrollX - ScrollBoundTo)) { - ImageTabScrollView.ScrollToAsync(ScrollBoundTo, 0, true); SetFooterFocusChain(ScrollBoundTo); + await ImageTabScrollView.ScrollToAsync(ScrollBoundTo, 0, true); } else { - ImageTabScrollView.ScrollToAsync(ScrollBoundFrom, 0, true); SetFooterFocusChain(ScrollBoundFrom); + await ImageTabScrollView.ScrollToAsync(ScrollBoundFrom, 0, true); } } |