public Feedback()
        {
            InitializeComponent();
            requestType = new LabelList(RequestType, headers.Select(t => t.Replace("+", " ")).ToList(), "Feedback Type")
            {
                SelectedIndex = 0
            };
            BackgroundColor = Settings.BlackRBGColor;

            SubmitBtt.Clicked += async(o, e) => {
                await Task.Run(() => {
                    string cor = IsCorrect();
                    if (cor == "")
                    {
                        if (!pending)
                        {
                            if (Submit())
                            {
                                Navigation.PopModalAsync();
                            }
                        }
                        else
                        {
                            App.ShowToast("Sending...");
                        }
                    }
                    else
                    {
                        Device.BeginInvokeOnMainThread(() => {
                            ErrorTxt.Text = cor;
                        });
                    }
                });
            };
        }
Esempio n. 2
0
        public Home()
        {
            InitializeComponent();
            baseImg.Source = App.GetImageSource("NoBookmarks.png");

            selectTabItems = new BorderView[] {
                HomeBtt, RelatedBtt, TopBtt, TrendingBtt,
            };
            selectTabLabels = new Label[] {
                HomeLbl, RelatedLbl, TopLbl, TrendingLbl,
            };
            FastTxtBtt.Clicked += async(o, e) => {
                string a = await ActionPopup.DisplayActionSheet("Clear watching", "Yes, clear currently watching", "No, dont clear currently watching");

                if (a.StartsWith('Y'))
                {
                    App.RemoveFolder(nameof(CachedCoreEpisode));
                    UpdateNextEpisode();
                }
            };
            ChangeSizeOfTabs();
            for (int i = 0; i < selectTabItems.Length; i++)
            {
                Commands.SetTap(selectTabItems[i], new Command((o) => {
                    int id          = int.Parse(o.ToString());
                    selectedTabItem = id;
                    ChangeSizeOfTabs();
                }));
                Commands.SetTapParameter(selectTabItems[i], i.ToString());
            }

            if (Settings.IS_TEST_BUILD)
            {
#pragma warning disable CS0162 // Unreachable code detected
                return;

#pragma warning restore CS0162 // Unreachable code detected
            }
            try {
                epView         = new MainEpisodeView();
                BindingContext = epView;

                BackgroundColor = Settings.BlackRBGColor;

                MovieTypePicker = new LabelList(MovieTypePickerBtt, genresNames)
                {
                    SelectedIndex = 0
                };

                MovieTypePicker.SelectedIndexChanged += (o, e) => {
                    ClearEpisodes(!IsRecommended);
                    if (IsRecommended)
                    {
                        CoreHelpers.Shuffle(iMDbTopList);
                        LoadMoreImages();
                    }
                    else
                    {
                        mainCore.PurgeThreads(21);
                        Fething = false;
                        GetFetch();
                    }
                };

                double lastScroll = 0;

                episodeView.Scrolled += (o, e) => {
                    MovieTypePickerBttScrollY -= lastScroll - e.ScrollY;
                    lastScroll = e.ScrollY;

                    if (MovieTypePickerBttScrollY > MovieTypePickerBttMinScrollY)
                    {
                        MovieTypePickerBttScrollY = MovieTypePickerBttMinScrollY;
                    }
                    else if (MovieTypePickerBttScrollY < 0)
                    {
                        MovieTypePickerBttScrollY = 0;
                    }

                    MovieTypePickerBtt.TranslationY = MovieTypePickerBttScrollY;

                    double maxY = episodeView.HeightRequest - episodeView.Height;
                    //print(maxY);
                    if (e.ScrollY >= maxY - 200)
                    {
                        LoadMoreImages();
                    }
                };


                if (Device.RuntimePlatform == Device.UWP)
                {
                    // BlueSeperator.IsVisible = false;
                    // BlueSeperator.IsEnabled = false;
                    OffBar.IsVisible = false;
                    OffBar.IsEnabled = false;
                }
                else
                {
                    OffBar.Source = App.GetImageSource("gradient.png"); OffBar.HeightRequest = 3; OffBar.HorizontalOptions = LayoutOptions.Fill; OffBar.ScaleX = 100; OffBar.Opacity = 0.3;
                }

                episodeView.VerticalScrollBarVisibility = Settings.ScrollBarVisibility;
            }
            catch (Exception _ex) {
                error(_ex);
            }

            /*
             * ImageScroller.Scrolled += (o, e) => {
             * double maxY = ImageScroller.ContentSize.Height - ImageScroller.Height;
             * if (e.ScrollY >= maxY - 200) {
             * LoadMoreImages();
             * }
             *
             * };*/
        }
Esempio n. 3
0
        public Home()
        {
            InitializeComponent();
            baseImg.Source = App.GetImageSource("NoBookmarks.png");

            selectTabItems = new BorderView[] {
                HomeBtt, RelatedBtt, TopBtt, TrendingBtt,
            };
            selectTabLabels = new Label[] {
                HomeLbl, RelatedLbl, TopLbl, TrendingLbl,
            };
            ChangeSizeOfTabs();
            for (int i = 0; i < selectTabItems.Length; i++)
            {
                Commands.SetTap(selectTabItems[i], new Command((o) => {
                    int id          = int.Parse(o.ToString());
                    selectedTabItem = id;
                    ChangeSizeOfTabs();
                }));
                Commands.SetTapParameter(selectTabItems[i], i.ToString());
            }

            if (Settings.IS_TEST_BUILD)
            {
                return;
            }
            try {
                epView         = new MainEpisodeView();
                BindingContext = epView;

                BackgroundColor = Settings.BlackRBGColor;

                MovieTypePicker = new LabelList(MovieTypePickerBtt, genresNames);

                // ImdbTypePicker = new LabelList(ImdbTypePickerBtt, recomendationTypes);

                //MovieTypePicker.ItemsSource = genresNames;
                // ImdbTypePicker.ItemsSource = recomendationTypes;
                //   UpdateBookmarks();

                MovieTypePicker.SelectedIndex = 0;

                /*
                 * ImdbTypePicker.SelectedIndex = -1;
                 *
                 * ImdbTypePicker.SelectedIndexChanged += (o, e) => {
                 *  ClearEpisodes();
                 *  mainCore.PurgeThreads(21);
                 *  Fething = false;
                 *  if (IsRecommended) {
                 *      GetFetchRecomended();
                 *  }
                 *  else {
                 *      GetFetch();
                 *  }
                 *  //    ImdbTypePickerBtt.Text = ImdbTypePicker.Items[ImdbTypePicker.SelectedIndex];
                 *
                 * };*/

                //   MovieTypePickerBtt.Text = MovieTypePicker.ItemsSource[MovieTypePicker.SelectedIndex];

                MovieTypePicker.SelectedIndexChanged += (o, e) => {
                    ClearEpisodes(!IsRecommended);
                    if (IsRecommended)
                    {
                        CoreHelpers.Shuffle(iMDbTopList);
                        LoadMoreImages();
                    }
                    else
                    {
                        mainCore.PurgeThreads(21);
                        Fething = false;
                        GetFetch();
                    }
                };

                double lastScroll = 0;

                episodeView.Scrolled += (o, e) => {
                    MovieTypePickerBttScrollY -= lastScroll - e.ScrollY;
                    lastScroll = e.ScrollY;

                    if (MovieTypePickerBttScrollY > MovieTypePickerBttMinScrollY)
                    {
                        MovieTypePickerBttScrollY = MovieTypePickerBttMinScrollY;
                    }
                    else if (MovieTypePickerBttScrollY < 0)
                    {
                        MovieTypePickerBttScrollY = 0;
                    }

                    MovieTypePickerBtt.TranslationY = MovieTypePickerBttScrollY;

                    double maxY = episodeView.HeightRequest - episodeView.Height;
                    //print(maxY);
                    if (e.ScrollY >= maxY - 200)
                    {
                        LoadMoreImages();
                    }
                };


                if (Device.RuntimePlatform == Device.UWP)
                {
                    // BlueSeperator.IsVisible = false;
                    // BlueSeperator.IsEnabled = false;
                    OffBar.IsVisible = false;
                    OffBar.IsEnabled = false;
                }
                else
                {
                    OffBar.Source = App.GetImageSource("gradient.png"); OffBar.HeightRequest = 3; OffBar.HorizontalOptions = LayoutOptions.Fill; OffBar.ScaleX = 100; OffBar.Opacity = 0.3;
                }

                episodeView.VerticalScrollBarVisibility = Settings.ScrollBarVisibility;
            }
            catch (Exception _ex) {
                error(_ex);
            }

            /*
             * ImageScroller.Scrolled += (o, e) => {
             *  double maxY = ImageScroller.ContentSize.Height - ImageScroller.Height;
             *  if (e.ScrollY >= maxY - 200) {
             *      LoadMoreImages();
             *  }
             *
             * };*/
        }
Esempio n. 4
0
        public Home()
        {
            InitializeComponent();
            epView         = new MainEpisodeView();
            BindingContext = epView;

            BackgroundColor = Settings.BlackRBGColor;

            MovieTypePicker = new LabelList(MovieTypePickerBtt, genresNames);
            ImdbTypePicker  = new LabelList(ImdbTypePickerBtt, recomendationTypes);

            // MovieTypePicker.ItemsSource = genresNames;
            // ImdbTypePicker.ItemsSource = recomendationTypes;
            //   UpdateBookmarks();

            MovieTypePicker.SelectedIndex = 0;
            ImdbTypePicker.SelectedIndex  = -1;



            ImdbTypePicker.SelectedIndexChanged += (o, e) => {
                ClearEpisodes();
                PurgeThreds(21);
                Fething = false;
                if (IsRecommended)
                {
                    GetFetchRecomended();
                }
                else
                {
                    GetFetch();
                }
                //    ImdbTypePickerBtt.Text = ImdbTypePicker.Items[ImdbTypePicker.SelectedIndex];
            };

            // MovieTypePickerBtt.Text = MovieTypePicker.Items[MovieTypePicker.SelectedIndex];

            MovieTypePicker.SelectedIndexChanged += (o, e) => {
                ClearEpisodes(!IsRecommended);
                if (IsRecommended)
                {
                    CloudStreamCore.Shuffle(iMDbTopList);
                    LoadMoreImages();
                }
                else
                {
                    PurgeThreds(21);
                    Fething = false;
                    GetFetch();
                }
                //    MovieTypePickerBtt.Text = MovieTypePicker.Items[MovieTypePicker.SelectedIndex];
                //GetFetchRecomended
                //  print(MovieTypePicker.SelectedIndex + "<<Selected");
            };

            episodeView.Scrolled += (o, e) => {
                double maxY = episodeView.HeightRequest - episodeView.Height;
                //print(maxY);
                if (e.ScrollY >= maxY - 200)
                {
                    LoadMoreImages();
                }
            };


            if (Device.RuntimePlatform == Device.UWP)
            {
                // BlueSeperator.IsVisible = false;
                // BlueSeperator.IsEnabled = false;
                OffBar.IsVisible = false;
                OffBar.IsEnabled = false;
            }
            else
            {
                OffBar.Source = App.GetImageSource("gradient.png"); OffBar.HeightRequest = 3; OffBar.HorizontalOptions = LayoutOptions.Fill; OffBar.ScaleX = 100; OffBar.Opacity = 0.3; OffBar.TranslationY = 9;
            }

            episodeView.VerticalScrollBarVisibility = Settings.ScrollBarVisibility;

            /*
             * ImageScroller.Scrolled += (o, e) => {
             *  double maxY = ImageScroller.ContentSize.Height - ImageScroller.Height;
             *  if (e.ScrollY >= maxY - 200) {
             *      LoadMoreImages();
             *  }
             *
             * };*/

            // MovieTypePicker.IsEnabled = false;
            //MovieTypePicker.IsVisible = false;
        }
Esempio n. 5
0
        public Settings()
        {
            InitializeComponent();

            displayElements = new VisualElement[] {
                G_GeneralTxt,
                G_InstatSearch,
                G_Subtitles,
                G_CacheData,
                G_Dubbed,
                G_PauseHistory,
                G_UITxt,
                G_Statusbar,
                G_Top100,
                G_VideoPlayer,
                G_Descript,
                G_ClearData,
                ClearHistoryTap,
                ClearBookmarksTap,
                ClearCachedTap,
                ResetallTap,
                G_TimeTxt,
                G_CastTime,
                G_SkipTime,
                G_BuildTxt,
                BuildNumber,
                G_GithubTxt,
                StarMe,
                SetTheme,
                // UpdateBtt,
            };

            for (int i = 0; i < displayElements.Length; i++)
            {
                Grid.SetRow(displayElements[i], i);
            }

            InstantSearchImg.Source = App.GetImageSource("searchIcon.png");
            SubtitlesImg.Source     = App.GetImageSource("outline_subtitles_white_48dp.png");
            CacheImg.Source         = App.GetImageSource("outline_cached_white_48dp.png");
            DubbedImg.Source        = App.GetImageSource("outline_record_voice_over_white_48dp.png");
            HistoryImg.Source       = App.GetImageSource("outline_history_white_48dp.png");

            StatusbarImg.Source = App.GetImageSource("outline_aspect_ratio_white_48dp.png");
            TopImg.Source       = App.GetImageSource("outline_reorder_white_48dp.png");
            DescriptImg.Source  = App.GetImageSource("outline_description_white_48dp.png");

            VideoImg.Source = App.GetImageSource("baseline_ondemand_video_white_48dp.png");

            var ClearSource = App.GetImageSource("outline_delete_white_48dp.png");

            ClearImg1.Source = ClearSource;
            ClearImg2.Source = ClearSource;
            ClearImg3.Source = ClearSource;

            ResetImg.Source = App.GetImageSource("baseline_refresh_white_48dp.png");


            ColorPicker = new LabelList(SetTheme, new List <string> {
                "Black", "Dark", "Netflix", "YouTube"
            });
            //outline_reorder_white_48dp.png


            BackgroundColor = Settings.BlackRBGColor;


            if (Device.RuntimePlatform == Device.UWP)
            {
                OffBar.IsVisible = false;
                OffBar.IsEnabled = false;
            }
            else
            {
                OffBar.Source = App.GetImageSource("gradient.png"); OffBar.HeightRequest = 3; OffBar.HorizontalOptions = LayoutOptions.Fill; OffBar.ScaleX = 100; OffBar.Opacity = 0.3; OffBar.TranslationY = 9;
            }

            //Main.print("COLOR: "+ BlackBgToggle.OnColor);
            //  if (Device.RuntimePlatform == Device.UWP) {
            BindingContext = this;
            // }
            StarMe.Clicked += (o, e) => {
                App.OpenBrowser("https://github.com/LagradOst/CloudStream-2");
            };
            BuildNumber.Text = "Build Version: " + App.GetBuildNumber();
            Apper();

            HistoryToggle.Toggled += (o, e) => {
                ViewHistory = !e.Value;
            };

            DubbedToggle.Toggled += (o, e) => {
                DefaultDub = e.Value;
            };

            VideoToggle.Toggled += (o, e) => {
                UseVideoPlayer = e.Value;
            };
            //  BlackBgToggle.OnChanged += (o, e) => {
            //     BlackBg = e.Value;
            //  };
            SubtitlesToggle.Toggled += (o, e) => {
                SubtitlesEnabled = e.Value;
            };

            /*
             * EpsDecToggle.OnChanged += (o, e) => {
             *  EpDecEnabled = e.Value;
             * };*/
            DescriptToggle.Toggled += (o, e) => {
                EpDecEnabled = e.Value;
            };
            InstantSearchToggle.Toggled += (o, e) => {
                SearchEveryCharEnabled = e.Value;
            };
            CacheDataToggle.Toggled += (o, e) => {
                CacheData = e.Value;
            };
            TopToggle.Toggled += (o, e) => {
                Top100Enabled = e.Value;
            };
            StatusbarToggle.Toggled += (o, e) => {
                HasStatusBar = e.Value;
                App.UpdateStatusBar();
            };


            Commands.SetTap(ClearHistoryTap, new Command((o) => {
                ClearHistory();
            }));

            Commands.SetTap(ClearCachedTap, new Command((o) => {
                ClearCache();
            }));
            Commands.SetTap(ClearBookmarksTap, new Command((o) => {
                ClearBookmarks();
            }));
            Commands.SetTap(ResetallTap, new Command((o) => {
                ResetToDef();
            }));



            ColorPicker.SelectedIndexChanged += (o, e) => {
                if (ColorPicker.SelectedIndex != -1)
                {
                    BlackBgType             = ColorPicker.SelectedIndex;
                    ColorPicker.button.Text = "Current Theme: " + ColorPicker.button.Text;
                    App.UpdateBackground();
                }
            };

            UpdateBtt.Clicked += (o, e) => {
                if (NewGithubUpdate)
                {
                    App.DownloadNewGithubUpdate(githubUpdateTag);
                }
            };

            /*
             * if (Device.RuntimePlatform != Device.Android) {
             *  for (int i = 0; i < SettingsTable.Count; i++) {
             *      if (i >= SettingsTable.Count) break;
             *      if (SettingsTable[i][0] is TextCell) {
             *          if (((TextCell)(SettingsTable[i][0])).DetailColor == Color.Transparent) {
             *              SettingsTable.RemoveAt(i);
             *              i--;
             *          }
             *      }
             *  }
             * }*/
        }