Esempio n. 1
0
        public void build(DataJsonApiAllGallery Inputdata)
        {
            IList <CompomentImage> data = Inputdata.data;
            IList <ImageApi>       tmp  = null;
            string titre = null;

            if (Inputdata.status == -1)
            {
                return;
            }
            foreach (CompomentImage element in data)
            {
                Console.WriteLine(element);
                if (element.images == null)
                {
                    continue;
                }
                tmp   = element.images;
                titre = element.title.ToString();
                if (Path.GetExtension(tmp[0].link) != ".png" && Path.GetExtension(tmp[0].link) != ".jpg")
                {
                    tmp[0].link = Path.ChangeExtension(tmp[0].link, ".png");
                }
                AddImageInGallery(tmp[0].link, titre, tmp);
                tmp = null;
            }
        }
Esempio n. 2
0
 public void morePageGallery()
 {
     ++_index;
     _dataImage = null;
     _dataImage = ResquestAPI.getAllGallery("1");
     reloadview();
 }
Esempio n. 3
0
        public GalleryPage()
        {
            Title      = "Gallery";
            _index     = 0;
            _dataImage = ResquestAPI.getAllGallery(_index.ToString());

            _stackLayout = new StackLayout
            {
                BackgroundColor = Color.FromHex("101010"),
                Padding         = new Thickness(5),
            };

            reloadview();
            ScrollView scrollView = new ScrollView {
                Content = _stackLayout
            };
            RefreshView refreshView    = new RefreshView();
            ICommand    refreshCommand = new Command(() =>
            {
                reloadview();
                refreshView.IsRefreshing = false;
            });

            refreshView.Command = refreshCommand;
            refreshView.Content = scrollView;
            Content             = refreshView;
        }
Esempio n. 4
0
        public SearchPage(string textSearch)
        {
            Title        = "Gallery";
            _dataImage   = ResquestAPI.getSearchImages(textSearch);
            _stackLayout = new StackLayout
            {
                BackgroundColor = Color.FromHex("101010"),
                Spacing         = 20,
                Padding         = new Thickness(20),
            };
            build(_dataImage);
            ScrollView scrollView = new ScrollView {
                Content = _stackLayout
            };

            Content = scrollView;
        }
Esempio n. 5
0
        public void Searchview()
        {
            _textSearch   = new Editor {
            };
            _buttonSearch = new Button
            {
                BackgroundColor   = Color.FromHex("101010"),
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Center,
                Text = "Search"
            };
            Frame search = new Frame
            {
                BackgroundColor = Color.FromHex("000000"),
                Content         = new StackLayout
                {
                    Children =
                    {
                        _textSearch,
                        _buttonSearch
                    }
                },
            };

            _buttonSearch.Clicked += delegate {
                if (_textSearch.Text == null || _textSearch.Text == "")
                {
                    _dataImage = ResquestAPI.getAllGallery("0");
                    reloadview();
                    return;
                }
                Console.WriteLine("--------------------\n" + _textSearch.Text + "\n--------------------");
                _dataImage = ResquestAPI.getSearchImages(_textSearch.Text);
                reloadview();
            };
            _stackLayout.Children.Add(search);
        }