Пример #1
0
 public IndexFragment(string title, Pubblicazione pub, Documento doc, int page, MuPDFCore core = null) : base(title)
 {
     _pubblicazione = pub;
     _documento     = doc;
     _currentPage   = page;
     _pdfCore       = core;
 }
Пример #2
0
        public void OnItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            if (actionMode != null)
            {
                return;
            }

            var item = _Items[e.Position];

            if (item is Pubblicazione)
            {
                Console.WriteLine("click thumb" + e.Position);

                Pubblicazione doc = item as Pubblicazione;

                //se sta aggiornando non apro il documento
                var down = _downloads.Where(d => d.ID == doc.ID).FirstOrDefault();

                if (down != null)
                {
                    DownloadInfo downInfo = MBDownloadManager.DownloadInfo(down.Uri.AbsoluteUri);

                    if (downInfo != null && downInfo.Id != 0 && downInfo.Uri != "")
                    {
                        return;
                    }
                }

                if (DateTime.Now > doc.DataScadenza && !doc.IsPDF && doc.DataScadenza != DateTime.MinValue)
                {
                    var alert = new AlertDialog.Builder(Activity);
                    alert.SetTitle(GetString(Resource.String.gen_error));
                    alert.SetMessage(GetString(Resource.String.pub_expired));
                    alert.SetPositiveButton("Ok", (EventHandler <DialogClickEventArgs>)null);
                    alert.Show().SetDivider();
                    return;
                }

                Intent i = new Intent();
                i.SetClass(Activity, typeof(ViewerScreen));

                //i.SetFlags(ActivityFlags.NewTask);

                i.SetAction(Intent.ActionView);

                i.PutExtra("pubPath", doc.Path);
                Activity.StartActivityForResult(i, 0);
                //Activity.StartActivity(i);
            }
            else if (item is DirectoryInfo)
            {
                Console.WriteLine("click dir" + e.Position);

                DirectoryInfo dir = item as DirectoryInfo;

                _CurrentDir = dir;
                PopulateTable();
            }
        }
Пример #3
0
        public ViewerNoteEdit(NotaUtente nota, Pubblicazione pub)
        {
            _pubblicazione = pub;
            _nota          = nota;

            _noteManager = new NoteManager(_pubblicazione);
            _noteManager.LoadNota(_nota);
        }
Пример #4
0
 public PagesAdapter(Activity context, List <Articolo> pages, Pubblicazione pub, Documento doc, int index = -1, List <Bookmark> bookmarks = null)
 {
     _Items         = pages;
     _context       = context;
     _currentIndex  = index;
     _bookmarks     = bookmarks;
     _pubblicazione = pub;
     _documento     = doc;
 }
Пример #5
0
        private void DeleteItems(List <int> positions)
        {
            if (positions.Count == 0)
            {
                return;
            }

            var dialog = new AlertDialog.Builder(Activity);

            dialog.SetTitle("Elimina");

            if (positions.Count == 1)
            {
                dialog.SetMessage(GetString(Resource.String.edic_delete));
            }
            else
            {
                dialog.SetMessage(GetString(Resource.String.edic_deleteMulti));
            }

            dialog.SetNegativeButton(GetString(Resource.String.gen_cancel), delegate
            {
                return;
            });

            dialog.SetPositiveButton(GetString(Resource.String.gen_delete), delegate(object sender, DialogClickEventArgs e)
            {
                Console.WriteLine("ELIMINATO");

                foreach (int pos in positions)
                {
                    var item = _Items[pos];

                    if (item is Pubblicazione)
                    {
                        Pubblicazione doc = item as Pubblicazione;
                        FileSystemManager.Delete(doc.Path);
                    }
                    else if (item is DirectoryInfo)
                    {
                        DirectoryInfo dir = item as DirectoryInfo;
                        FileSystemManager.Delete(dir.FullName);
                    }
                }

                if (actionMode != null)
                {
                    actionMode.Finish();
                }

                PopulateTable();
            });

            dialog.Create();
            dialog.Show().SetDivider();
        }
Пример #6
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            this.SetContentView(Resource.Layout.ContentsTable);

            if (ActionBar != null)
            {
                ActionBar.SetDisplayUseLogoEnabled(false);
                ActionBar.SetIcon(new ColorDrawable(Color.Transparent));
                ActionBar.SetHomeButtonEnabled(false);
                ActionBar.SetDisplayHomeAsUpEnabled(true);
                ActionBar.SetDisplayShowHomeEnabled(true);
                ActionBar.SetDisplayShowTitleEnabled(true);
            }

            this.Title = "Contenuti";

            _currentPage   = Intent.GetIntExtra("currentPage", 0);
            _pubblicazione = (Pubblicazione)ActivitiesBringe.GetObject("pub");
            _documento     = (Documento)ActivitiesBringe.GetObject("doc");
            _pdfCore       = (MuPDFCore)ActivitiesBringe.GetObject("pdfCore");

            ViewPager viewPager = (ViewPager)this.FindViewById <ViewPager>(Resource.Id.pagesViewPager);
            ArrayList fragments = getFragments();

            TitleFragmentAdapter ama = new TitleFragmentAdapter(this.SupportFragmentManager, fragments);

            viewPager.Adapter = ama;

            TabPageIndicator indicator = this.FindViewById <TabPageIndicator> (Resource.Id.pagesIndicator);

            indicator.SetViewPager(viewPager);



            /*StateListDrawable bgColorList = new StateListDrawable();
             *
             * bgColorList.AddState(new int[] { Android.Resource.Attribute.StateActivated }, new ColorDrawable(Color.Transparent.FromHex("ff0000")));
             * bgColorList.AddState(new int[] { }, new ColorDrawable(Color.Transparent));
             *
             * indicator.Background = bgColorList;*/

            viewPager.CurrentItem = Intent.GetIntExtra("currentItem", 0);
        }
Пример #7
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            _currentPage   = Intent.GetIntExtra("currentPage", 0);
            _pubblicazione = (Pubblicazione)ActivitiesBringe.GetObject("pub");
            _documento     = (Documento)ActivitiesBringe.GetObject("doc");
            _pdfCore       = (MuPDFCore)ActivitiesBringe.GetObject("pdfCore");

            SetContentView(Resource.Layout.SearchDialog);

            Window.SetSoftInputMode(SoftInput.AdjustNothing);

            if (ActionBar != null)
            {
                this.Title = ActionBar.Title = GetString(Resource.String.search);

                ActionBar.SetDisplayUseLogoEnabled(false);
                ActionBar.SetIcon(new ColorDrawable(Color.Transparent));
                ActionBar.SetHomeButtonEnabled(false);
                ActionBar.SetDisplayHomeAsUpEnabled(true);
                ActionBar.SetDisplayShowHomeEnabled(true);
                ActionBar.SetDisplayShowTitleEnabled(true);
            }

            _pageList = (ListView)FindViewById <ListView>(Resource.Id.pageList);

            _searchView = (SearchView)FindViewById <SearchView>(Resource.Id.searchView);

            int  searchPlateId = _searchView.Context.Resources.GetIdentifier("android:id/search_plate", null, null);
            View searchPlate   = _searchView.FindViewById(searchPlateId);

            searchPlate.Background.Colorize(DataManager.Get <ISettingsManager>().Settings.ButtonColor);

            _searchView.Focusable = true;
            _searchView.Iconified = false;
            _searchView.RequestFocusFromTouch();

            _searchView.QueryTextChange += (sender, e) =>
            {
                SearchPages(e.NewText);
            };

            _searchView.QueryTextSubmit += (sender, e) =>
            {
                _searchView.ClearFocus();
            };

            _pageList.ItemClick += (sender, e) =>
            {
                var art = _articoli[e.Position];

                Intent myIntent = new Intent(this, typeof(ViewerScreen));
                myIntent.PutExtra("doc", art.IdDocumento);
                myIntent.PutExtra("page", (art.Index - 1).ToString());
                myIntent.PutExtra("action", "page");

                SetResult(Result.Ok, myIntent);
                Finish();
            };

            //paramentro ricerca
            var str = ActivitiesBringe.GetObject("search");

            if (str != null)
            {
                string search = (string)str;

                _searchView.SetQuery(search, true);

                _searchView.RequestFocus();
            }
        }
Пример #8
0
 public EdicolaDetails(Context context, Pubblicazione pub) : base(context)
 {
     _pubblicazione = pub;
 }
Пример #9
0
 public NoteFragment(string title, Pubblicazione pub) : base(title)
 {
     _pubblicazione = pub;
 }