示例#1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.ax_Downloads, container, false);

            ax_downloads = this;
            Button btt = view.FindViewById <Button>(Resource.Id.newLink);

            btt.Click += (o, e) =>
            {
                Context context = view.Context;
                Intent  intent  = new Intent(context, typeof(LinkdownloadActivity));

                StartActivity(intent);
            };

            _w.RecyclerView re = view.FindViewById <_w.RecyclerView>(Resource.Id.recyclerView_links);
            _re = re;

            re.SetItemClickListener((rv, position, _view) =>
            {
                // try {

                DoLink(0, position);

                // }
                // catch (System.Exception) {

                //     print("Error getting:" + position);
                // }
            });

            SetUpRecyclerView(_re);

            return(view);
        }
示例#2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.ax_Links, container, false);
            // _w.RecyclerView rez = view as _w.RecyclerView;
            //  print(view.AccessibilityClassName);
            // System.Diagnostics.Debug.WriteLine("TTTTTTTTTTTTTTT" + view.);
            var         bar         = view.FindViewById <ProgressBar>(Resource.Id.progressBarLinks);
            ImageButton playListBtt = view.FindViewById <ImageButton>(Resource.Id.playList);

            playListBtt.Click += (o, e) =>
            {
                string path = MainActivity.GenerateM3UFileFromLoadedLinks("TempList", flinks: flink, reverse: movieIsAnime[movieSelectedID], placeInLinksFolder: false);
                if (path != "error")
                {
                    OpenPathAsVieo(path);
                }
            };
            if (currentMain && movieProvider[movieSelectedID] == 4)
            {
                playListBtt.Visibility = ViewStates.Gone;
            }

            bool m3uEnabled = true;// ax_Settings.SettingsGetChecked(10);

            // bar.layout

            if (showExtraListButtons)
            {
                Button copyM3U     = view.FindViewById <Button>(Resource.Id.copym3u);
                Button generateM3U = view.FindViewById <Button>(Resource.Id.generatem3u);

                copyM3U.Visibility     = ViewStates.Gone;
                generateM3U.Visibility = ViewStates.Gone;

                copyM3U.Visibility     = m3uEnabled ? ViewStates.Visible : ViewStates.Gone;
                generateM3U.Visibility = m3uEnabled ? ViewStates.Visible : ViewStates.Gone;
                copyM3U.Click         += (o, e) =>
                {
                    string           m3uCopy = MainActivity.GetM3UFileFromLoadedLinks();
                    ClipboardManager clip    = (ClipboardManager)Context.GetSystemService(Context.ClipboardService);
                    clip.PrimaryClip = ClipData.NewPlainText("m3u", m3uCopy);
                    ShowSnackBar("Copied m3u To Clipboard!", ax_links.View);
                };

                generateM3U.Click += (o, e) =>
                {
                    string        path   = MainActivity.GenerateM3UFileFromLoadedLinks();
                    Action <View> action = new Action <View>((View v) =>
                    {
                        OpenPathAsVieo(path);
                    });
                    ShowSnackBar("Download m3u to " + path, ax_links.View, "Play list", action);
                };
            }

            //bar.Visibility = ViewStates.Gone;
            pbar = bar;
            if (SearchResultsActivity.veiws == 0)
            {
                // pbar.Visibility = ViewStates.Gone;
                currentMain = true;
                ax_links    = this;
            }
            else
            {
                ax_links_sub = this;
            }
            if (SearchResultsActivity.veiws == 1)
            {
                ax_Links_all = new List <ax_Links>();
            }
            ax_Links_all.Add(this);
            currnView = SearchResultsActivity.veiws;
            SearchResultsActivity.veiws++;

            // _w.RecyclerView rez = view as _w.RecyclerView; //inflater.Inflate(Resource.Layout.ax_Search, container, false) as _w.RecyclerView;
            _w.RecyclerView re = view.FindViewById <_w.RecyclerView>(Resource.Id.recyclerView_links);
            _re    = re;
            __view = view;


            // ---------- ON LINK CLICKED ----------

            re.SetItemClickListener((rv, position, _view) =>
            {
                var check = view.FindViewById <CheckBox>(Resource.Id.checkBox1);

                string linkName = activeLinksNames[flink[position]];

                bool overideSettings = (movieProvider[movieSelectedID] == 4 && linkName.StartsWith("Episode") && currentMain);

                int rAct = 0;

                if (!check.Checked)
                {
                    //Toast t = new Toast(Context);
                    print("Loading: " + movieTitles[movieSelectedID] + " | " + activeLinksNames[flink[position]]);

                    rAct = 0;


                    if (!overideSettings)
                    {
                        rAct = ax_Settings.SettingsGetDef(0, true);
                        print("PRIMARY: " + rAct);
                    }

                    if (ax_Settings.SettingsGetChecked(4) && (rAct == 0 || rAct == 5))
                    {
                        //  DoLink(ax_Settings.SettingsGetDef(1), position);
                        DoLink(9, position);
                    }
                    ChangeBar(pbar.Progress);


                    //  bool downloadFile = false;
                    //  string link = activeLinks[flink[position]];
                    //  if (!downloadFile) {
                    // }
                    // else {
                    // HistoryPressTitle("D___" + movieTitles[movieSelectedID] + "|" + activeLinksNames[flink[position]]);
                    //      DoLink(2, position);

                    // }
                }
                else
                {
                    //  DoLink(1, position);

                    rAct = 1;

                    if (!overideSettings)
                    {
                        rAct = ax_Settings.SettingsGetDef(1, true);
                        print("SECONDARY: " + rAct);
                    }
                }

                DoLink(rAct, position);
            });

            // ---------- LOADED ALL LINKS ----------

            Action onCompleted = () =>
            {
                //print("daaaaaaaaaaaaaaaa")
                // UpdateList();
                // ChangeBar(100);
                if (movieSelectedID >= movieTitles.Count || movieSelectedID < 0)
                {
                }
                else
                {
                    ChangeBar(100);
                    if (ax_links_sub != null)
                    {
                        if (movieProvider[movieSelectedID] == 0)
                        {
                            ax_links_sub.ChangeBar(100);
                        }
                    }
                    print(movieProvider[movieSelectedID].ToString());
                    linksDone = true;
                }
                //
            };

            // ---------- LOAD LINKS ----------

            if (currentMain)    // not request twice
            {
                thredNumber++;
                sThred = new Java.Lang.Thread(
                    () =>
                {
                    try {
                        ChangeBar(0);

                        GetURLFromTitle(movieSelectedID);
                        //Thread.Sleep(1000);
                    }
                    finally {
                        onCompleted();
                        sThred.Join();
                        //invoke(onCompleted);
                    }
                });
                sThred.Start();
            }

            UpdateList();


            /*
             * var buttons = view.FindViewById<LinearLayout>(Resource.Id.s_Buttons);
             *
             * LinearLayout linearLayout = buttons; //new LinearLayout(this);
             * linearLayout.Orientation = (Android.Widget.Orientation.Vertical);
             *
             * for (int i = 0; i < 100; i++) {
             *  var button = new Button(this.Context);
             *  button.Text = "Button " + i;
             *  button.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
             *  button.Click += (o, e) =>
             *  {
             *      //selectedTitle = button.Text;
             *      //ClosePoster(ViewStates.Visible);
             *      Intent intent = new Intent(search.Context, typeof(SearchResultsActivity));
             *      StartActivity(intent);
             *  };
             *  linearLayout.AddView(button);
             *  btts.Add(button);
             * }*/


            // bar.Progress = MainActivity.bar_progress;

            //IRunnable
            //Activity.OnBackPressed();
            return(view);
        }
示例#3
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.ax_Bookmarks, container, false);

            // _w.RecyclerView rez = view as _w.RecyclerView;

            __view       = view;
            ___view      = view;
            ax_bookmarks = this;

            // _w.RecyclerView rez = view as _w.RecyclerView; //inflater.Inflate(Resource.Layout.ax_Search, container, false) as _w.RecyclerView;
            _w.RecyclerView re = view.FindViewById <_w.RecyclerView>(Resource.Id.recyclerView_movies);
            _re = re;

            refreshButton = view.FindViewById <ImageButton>(Resource.Id.reloadbtt);
            refreshBar    = view.FindViewById <ProgressBar>(Resource.Id.refreshBar);
            // refreshBar.Visibility = ViewStates.Gone;

            refreshButton.Click += (o, e) =>
            {
                //  refreshBar.Visibility = ViewStates.Visible;
                // if(!refreshing) {
                thredNum++;
                thredNumber++;
                print("RefreshBtt clicked");

                if (!refreshing)
                {
                    ShowSnackBar("Loading the amount of links");


                    MethodInvoker simpleDelegate;
                    simpleDelegate = new MethodInvoker(GetAllEps);
                    simpleDelegate.BeginInvoke(null, null);
                }
                else
                {
                    ShowSnackBar("Loading Progress Aborted");

                    refreshBar.Progress    = 0;
                    refreshButton.Rotation = 0;
                    refreshRot             = 0;
                    ax_Bookmarks.ax_bookmarks.UpdateList();
                }

                refreshing = !refreshing;
            };


            re.SetItemClickListener((rv, position, _view) =>
            {
                //An item has been clicked
                print(wlink.Count.ToString());
                print(position.ToString());

                movieSelectedID = wlink[position];
                Context context = _view.Context;
                Intent intent   = new Intent(context, typeof(SearchResultsActivity));
                // intent.PutExtra(CheeseDetailActivity.EXTRA_NAME, values[position]);

                context.StartActivity(intent);
            });
            GetBookMarks();
            SetUpRecyclerView(_re);



            /*
             * refresher = view.FindViewById<SwipeRefreshLayout>(Resource.Id.refresher);
             *
             * refresher.Refresh += (o,e) =>
             * {
             *  print("DAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaLLLLLLLLLLLLLLLLLLLLLLLL");
             *  MethodInvoker simpleDelegate;
             *      simpleDelegate = new MethodInvoker(GetAllEps);
             *      simpleDelegate.BeginInvoke(null, null);
             *
             *
             *
             * };
             */


            return(view);
        }
示例#4
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.ax_Search, container, false);

            // _w.RecyclerView rez = view as _w.RecyclerView;

            __view    = view;
            ___view   = view;
            ax_search = this;

            var bar = __view.FindViewById <ProgressBar>(Resource.Id.progressBar1);

            //bar.Visibility = ViewStates.Gone;
            pbar = bar;

            // _w.RecyclerView rez = view as _w.RecyclerView; //inflater.Inflate(Resource.Layout.ax_Search, container, false) as _w.RecyclerView;
            SearchView search = view.FindViewById <SearchView>(Resource.Id.movie_seach);

            _w.RecyclerView re = view.FindViewById <_w.RecyclerView>(Resource.Id.recyclerView_movies);
            _re = re;

            search.SetQueryHint(new Java.Lang.String("Movie Search"));
            //search.SetQuery(new Java.Lang.String("HELLO"), true);

            search.QueryTextSubmit += async(o, e) =>
            {
                search.ClearFocus();

                if (searchDone)
                {
                    searchDone             = false;
                    MainActivity.searchFor = e.Query;
                    // Intent intent = new Intent(search.Context, typeof(SearchResultsActivity));
                    //StartActivity(intent);
                    Action onCompleted = () =>
                    {
                        //print("daaaaaaaaaaaaaaaa")
                        // UpdateList();
                        ChangeBar(100);
                        searchDone = true;
                        //
                    };

                    sThred = new Java.Lang.Thread(
                        () =>
                    {
                        try {
                            Search(e.Query);
                            //Thread.Sleep(1000);
                        }
                        finally {
                            onCompleted();
                            sThred.Join();
                            //invoke(onCompleted);
                        }
                    });
                    sThred.Start();

                    ChangeBar(0);
                }
            };
            re.SetItemClickListener((rv, position, _view) =>
            {
                SelectMovie(rv, position, _view);
            });

            re.LongClickable = true;

            /*
             * re.LongClickable = true;
             * re.SetOnLongClickListener((rv, position, _view) =>
             * {
             *  //An item has been clicked
             *  HistoryPressTitle(movieTitles[wlink[position]]);
             *  movieSelectedID = wlink[position];
             *  Context context = _view.Context;
             *  Intent intent = new Intent(context, typeof(SearchResultsActivity));
             *  // intent.PutExtra(CheeseDetailActivity.EXTRA_NAME, values[position]);
             *
             *  context.StartActivity(intent);
             *
             * });
             */
            /*
             * var buttons = view.FindViewById<LinearLayout>(Resource.Id.s_Buttons);
             *
             * LinearLayout linearLayout = buttons; //new LinearLayout(this);
             * linearLayout.Orientation = (Android.Widget.Orientation.Vertical);
             *
             * for (int i = 0; i < 100; i++) {
             *  var button = new Button(this.Context);
             *  button.Text = "Button " + i;
             *  button.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
             *  button.Click += (o, e) =>
             *  {
             *      //selectedTitle = button.Text;
             *      //ClosePoster(ViewStates.Visible);
             *      Intent intent = new Intent(search.Context, typeof(SearchResultsActivity));
             *      StartActivity(intent);
             *  };
             *  linearLayout.AddView(button);
             *  btts.Add(button);
             * }*/


            // bar.Progress = MainActivity.bar_progress;

            //IRunnable
            // search.SetQuery("test", true);
            //  search.SetFocusable(ViewFocusability.Focusable);
            //search.SetIconifiedByDefault(false);
            search.OnActionViewExpanded();
            search.ClearFocus();
            searchView = view.FindViewById <SearchView>(Resource.Id.movie_seach);

            // imm.HideSoftInputFromInputMethod(search.WindowToken, HideSoftInputFlags.None);
            //search.RequestFocusFromTouch();


            return(view);
        }