コード例 #1
0
        private async void DataGet()
        {
            if (string.IsNullOrWhiteSpace(Barrel.Current.Get(Url)) && !CrossConnectivity.Current.IsConnected)
            {
                XFToast.ShortMessage("No Previous data or Internet");
                searbar.IsVisible = false;
            }
            else
            {
                try
                {
                    searbar.IsVisible = true;
                    videolist         = await MoneyCache.GetAsync2 <List <Video> >(Url);

                    foreach (Video n in videolist)
                    {
                        n.link = Constants.ScrubHtml2(n.link);
                    }
                    NewsCollection       = new ObservableCollection <Video>(videolist);
                    listView.ItemsSource = NewsCollection;
                    listView.Opacity     = 0;
                    await listView.FadeTo(1, 1000, Easing.SpringIn);
                }
                catch (Exception ex)
                {
                }
            }
            listView.EndRefresh();
        }
コード例 #2
0
        private async void DataGet()
        {
            if (string.IsNullOrWhiteSpace(Barrel.Current.Get(Url)) && !CrossConnectivity.Current.IsConnected)
            {
                XFToast.ShortMessage("No Previous data or Internet");
                searbar.IsVisible = false;
            }
            else
            {
                try
                {
                    searbar.IsVisible = true;
                    newlist           = await MoneyCache.GetAsync <List <NepNews> >(Url);

                    foreach (NepNews n in newlist)
                    {
                        n.desc = Constants.ScrubHtml(n.description);
                        n.desc = new String(n.desc.Take(200).ToArray()) + "...";
                    }
                    NewsCollection       = new ObservableCollection <NepNews>(newlist);
                    listView.ItemsSource = NewsCollection;
                    listView.Opacity     = 0;
                    await listView.FadeTo(1, 1000, Easing.SpringIn);
                }catch (Exception ex)
                {
                }
            }
            listView.EndRefresh();
        }
コード例 #3
0
        private async void DataGet()
        {
            if (string.IsNullOrWhiteSpace(Barrel.Current.Get(Url)) && !CrossConnectivity.Current.IsConnected)
            {
                XFToast.ShortMessage("No Previous data or Internet");
            }
            else
            {
                try
                {
                    messagelist = await MoneyCache.GetAsync <List <Notifications> >(Url);

                    foreach (Notifications n in messagelist)
                    {
                        n.temp = DateTime.Parse(n.start_date);
                    }
                    NewsCollection = new ObservableCollection <Notifications>(messagelist);

                    timelineListView.ItemsSource = NewsCollection;
                    timelineListView.Opacity     = 0;
                    await timelineListView.FadeTo(1, 1000, Easing.SpringIn);
                }catch (Exception ex)
                {
                }
            }
            timelineListView.EndRefresh();
        }
コード例 #4
0
ファイル: BioPage.xaml.cs プロジェクト: ankitstha03/CMAPPS
        private async void DataGet()
        {
            try
            {
                lead = await MoneyCache.GetAsync <List <Leader> >(Url);

                Leader asd = lead.First <Leader>();
                asd.description = Constants.ScrubHtml(asd.description);
                BindingContext  = asd;
                desig.SetBinding(Label.TextProperty, "designate.name");
                await view.FadeTo(1, 1000, Easing.SpringIn);
            }
            catch
            {
            }
        }
コード例 #5
0
        private async void DataGet()
        {
            if (string.IsNullOrWhiteSpace(Barrel.Current.Get(Url)) && !CrossConnectivity.Current.IsConnected)
            {
                XFToast.ShortMessage("No Previous data or Internet");
            }
            else
            {
                try
                {
                    notlist = await MoneyCache.GetAsync <List <Notifications> >(Url);

                    NotiCollection       = new ObservableCollection <Notifications>(notlist);
                    listView.ItemsSource = NotiCollection;
                    listView.Opacity     = 0;
                    await listView.FadeTo(1, 1000, Easing.SpringIn);
                }
                catch (Exception e)
                {
                }
            }

            listView.EndRefresh();
        }
コード例 #6
0
ファイル: HomeView.xaml.cs プロジェクト: ankitstha03/CMAPPS
        private async void DataGet()
        {
            if (string.IsNullOrWhiteSpace(Barrel.Current.Get(Url1)) && !CrossConnectivity.Current.IsConnected)
            {
                XFToast.LongMessage("No Previous data or Internet");
            }
            else
            {
                try
                {
                    sls.Children.Clear();
                    newlist1 = await MoneyCache.GetAsync <List <News> >(Url1);

                    newlist2 = await MoneyCache.GetAsync <List <NepNews> >(Url2);

                    activi.IsRunning = false;
                    activi.IsVisible = false;
                    newlist1         = newlist1.Take(3).ToList();
                    newlist2         = newlist2.Take(3).ToList();
                    foreach (NepNews n in newlist2)
                    {
                        n.desc = n.description.Take(30) + "...";
                    }
                    NewsCollection1 = new ObservableCollection <News>(newlist1);
                    NewsCollection2 = new ObservableCollection <NepNews>(newlist2);


                    foreach (News n in newlist1)
                    {
                        Frame fram = new Frame
                        {
                            IsClippedToBounds = true,
                            HasShadow         = true,
                            BackgroundColor   = Color.White,
                            OutlineColor      = Color.Gray,
                            Margin            = new Thickness(7),
                            Padding           = new Thickness(5)
                        };

                        var slsins = new StackLayout
                        {
                            Orientation = StackOrientation.Vertical
                        };



                        var imag = new Image
                        {
                            Source            = n.images,
                            Aspect            = Aspect.AspectFill,
                            HorizontalOptions = LayoutOptions.FillAndExpand,
                            VerticalOptions   = LayoutOptions.Start
                        };



                        slsins.Children.Add(imag);

                        var slslb = new StackLayout
                        {
                            Orientation = StackOrientation.Vertical,
                            Padding     = new Thickness(10, 5, 10, 5)
                        };

                        Label title = new Label
                        {
                            Text           = n.title,
                            FontSize       = 18,
                            FontAttributes = FontAttributes.Bold,
                            TextColor      = Color.Black
                        };

                        Label desc = new Label
                        {
                            Text      = n.description,
                            FontSize  = 18,
                            TextColor = Color.Black
                        };

                        slslb.Children.Add(title);
                        slslb.Children.Add(desc);

                        slsins.Children.Add(slslb);

                        fram.Content = slsins;

                        var tapGestureRecognizer = new TapGestureRecognizer();
                        tapGestureRecognizer.Tapped += async(s, e) =>
                        {
                            if (CrossConnectivity.Current.IsConnected)
                            {
                                await Navigation.PushAsync(new NewsDetailPage(n), true);
                            }
                            else
                            {
                                XFToast.LongMessage("No Internet Connection");
                            }
                        };

                        fram.GestureRecognizers.Add(tapGestureRecognizer);
                        sls.Children.Add(fram);
                    }

                    foreach (NepNews n2 in newlist2)
                    {
                        Frame fram2 = new Frame
                        {
                            IsClippedToBounds = true,
                            HasShadow         = true,
                            BackgroundColor   = Color.White,
                            OutlineColor      = Color.Gray,
                            Margin            = new Thickness(7),
                            Padding           = new Thickness(5)
                        };
                        var slsins = new StackLayout
                        {
                            Orientation = StackOrientation.Vertical
                        };


                        var imag = new Image
                        {
                            Source            = n2.title_image,
                            Aspect            = Aspect.AspectFill,
                            HorizontalOptions = LayoutOptions.FillAndExpand,
                            VerticalOptions   = LayoutOptions.Start
                        };

                        slsins.Children.Add(imag);

                        var slslb = new StackLayout
                        {
                            Orientation = StackOrientation.Vertical,
                            Padding     = new Thickness(10, 5, 10, 5)
                        };

                        Label title = new Label
                        {
                            Text           = n2.title,
                            FontSize       = 18,
                            FontAttributes = FontAttributes.Bold,
                            TextColor      = Color.Black
                        };
                        n2.desc = Constants.ScrubHtml(n2.description);

                        Label desc = new Label
                        {
                            Text      = new String(n2.desc.Take(200).ToArray()) + "...",
                            FontSize  = 18,
                            TextColor = Color.Black
                        };

                        slslb.Children.Add(title);
                        slslb.Children.Add(desc);

                        slsins.Children.Add(slslb);

                        fram2.Content = slsins;

                        var tapGestureRecognizer2 = new TapGestureRecognizer();
                        tapGestureRecognizer2.Tapped += async(s, e) =>
                        {
                            await Navigation.PushAsync(new NepaliNewsDetailPage(n2), true);
                        };

                        fram2.GestureRecognizers.Add(tapGestureRecognizer2);
                        sls.Children.Add(fram2);
                    }
                    view.Content = sls;
                    view.Opacity = 0;
                    await view.FadeTo(1, 1000, Easing.SpringIn);
                }catch (Exception ex)
                {
                }
            }
        }