Пример #1
0
        void InitThumbnailGridAndButton()
        {
            thumbnailGrid = FindViewById <PdfThumbnailGrid> (Resource.Id.thumbnailGrid);
            if (thumbnailGrid == null)
            {
                throw new IllegalStateException("Error while loading CustomFragmentActivity. The example layout was missing the thumbnail grid view.");
            }

            thumbnailGrid.PageClick += (sender, e) => {
                fragment.PageIndex = e.P1;
                (sender as PdfThumbnailGrid)?.Hide();
            };

            // The thumbnail grid is hidden by default. Set up a click listener to show it.
            var openTumbnailGridButton = FindViewById <ImageView> (Resource.Id.openThumbnailGridButton);

            openTumbnailGridButton.Click += (sender, e) => thumbnailGrid.Show();
            openTumbnailGridButton.SetImageDrawable(TintDrawable(openTumbnailGridButton.Drawable, ContextCompat.GetColor(this, Resource.Color.pspdf__color_white)));
        }