Exemple #1
0
 private void ChangeBarGridAnima(ref double oldOne, double newOne)
 {
     if (!isNative)
     {
         return;
     }
     if (!isMobileAnimaCompleted)
     {
         return;
     }
     if (newOne - oldOne < -20 && BarGrid.Visibility == Visibility.Collapsed)
     {
         isMobileAnimaCompleted = false;
         BarGrid.SetVisibility(true);
         Scroll.ViewChanged -= Scroll_ViewChanged;
         BtnStackSlideIn.Begin();
     }
     else if (newOne - oldOne > 20 && BarGrid.Visibility == Visibility.Visible)
     {
         isMobileAnimaCompleted = false;
         Scroll.ViewChanged    -= Scroll_ViewChanged;
         BtnStackSlideOut.Begin();
     }
     oldOne = newOne;
 }
Exemple #2
0
        private async void SetWebViewSourceAsync(Uri uri)
        {
            try {
                var result = htmlReturn = await DoubanWebProcess.GetMDoubanResponseAsync(
                    path : uri.ToString(),
                    host : "m.douban.com",
                    reffer : "https://m.douban.com/");

                var doc = new HtmlDocument();
                doc.LoadHtml(result);
                var shouldNative = IfCanGetContent(doc.DocumentNode);
                if (shouldNative)
                {
                    WebView.NavigateToString(GetContent(doc.DocumentNode));
                    SetTitleAndDescForShare(doc);
                    SetAuthorGrid();
                }
                else
                {
                    WebView.Source = uri;
                    BarGrid.SetVisibility(false);
                    isNative = false;
                }
            } catch {
                WebView.Source = uri;
            }
        }
Exemple #3
0
 private void DoublAnimationOut_Completed(object sender, object e)
 {
     BarGrid.SetVisibility(false);
     Scroll.ViewChanged    += Scroll_ViewChanged;
     isMobileAnimaCompleted = true;
 }