Example #1
0
        void InitOutlineViewAndButton()
        {
            // Extract the remaining views from our custom layout.
            pdfOutlineView = FindViewById <PdfOutlineView> (Resource.Id.outlineView);
            if (pdfOutlineView == null)
            {
                throw new IllegalStateException("Error while loading CustomFragmentActivity. The example layout was missing the outline view.");
            }

            var outlineViewListener = new DefaultOutlineViewListener(fragment);

            pdfOutlineView.SetOnAnnotationTapListener(outlineViewListener);
            pdfOutlineView.SetOnOutlineElementTapListener(outlineViewListener);
            pdfOutlineView.SetBookmarkAdapter(new DefaultBookmarkAdapter(fragment));

            var openOutlineButton = FindViewById <ImageView> (Resource.Id.openOutlineButton);

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