Example #1
0
        internal BookmarkToolbar(Context context, CustomToolBarPdfViewerDemo sampleView) : base(context)
        {
            this.sampleView = sampleView;
            bookmarkFont    = sampleView.bookmarkFont;
            var inflater = (LayoutInflater)context.GetSystemService(Context.LayoutInflaterService);

            bookmarkLayout      = (LinearLayout)inflater.Inflate(Resources.GetLayout(Resource.Layout.bookmarkAndroidToolbar), this, true);
            backToViewerButton  = bookmarkLayout.FindViewById <Button>(Resource.Id.backToViewerButton);
            bookmarkCloseButton = bookmarkLayout.FindViewById <Button>(Resource.Id.bookmarkCloseButton);
            bookmarkTitle       = bookmarkLayout.FindViewById <LinearLayout>(Resource.Id.bookmarkTitleBar);
            if (sampleView.IsDeviceTablet)
            {
                bookmarkTitle.LayoutParameters.Height = (int)(47 * Resources.DisplayMetrics.Density);
                backToViewerButton.Visibility         = ViewStates.Invisible;
                bookmarkCloseButton.Click            += M_bookmarkCloseButton_Click;
                bookmarkCloseButton.Typeface          = sampleView.font;
            }
            else
            {
                bookmarkCloseButton.Visibility        = ViewStates.Invisible;
                bookmarkTitle.LayoutParameters.Height = (int)(60 * Resources.DisplayMetrics.Density);
                backToViewerButton.Click   += BackToViewerButton_Click;
                backToViewerButton.Typeface = sampleView.bookmarkFont;
            }
            bookmarkView         = bookmarkLayout.FindViewById <ListView>(Resource.Id.bookmarkListView);
            listAdapter          = new BookmarkListAdapter(context, this, Resources.DisplayMetrics.Density);
            bookmarkView.Adapter = listAdapter;
            SetBackgroundColor(Color.White);
        }
        internal StampSelectionView(Context context, CustomToolBarPdfViewerDemo mainPage) : base(context)
        {
            this.mainPage = mainPage;
            LayoutInflater inflater = (LayoutInflater)context.GetSystemService(Context.LayoutInflaterService);

            root               = (FrameLayout)inflater.Inflate(Resources.GetLayout(Resource.Layout.StampViewList), this, true);
            linear             = root.FindViewById <LinearLayout>(Resource.Id.linearView);
            backButton         = root.FindViewById <Button>(Resource.Id.backButton);
            stampTitle         = root.FindViewById <LinearLayout>(Resource.Id.stampTitlebar);
            bottomBar          = root.FindViewById <LinearLayout>(Resource.Id.bottomBar);
            closeButton        = root.FindViewById <Button>(Resource.Id.closeBtn);
            closeButton.Click += CloseButton_Click;
            closeButton.SetBackgroundColor(Color.Transparent);
            closeButton.SetTextColor(mainPage.fontColor);
            backButton.Typeface = mainPage.bookmarkFont;
            backButton.Click   += BackButton_Click;
            title = root.FindViewById <TextView>(Resource.Id.title);
            linear.SetBackgroundColor(Color.White);

            if (mainPage.IsDeviceTablet)
            {
                LayoutParams newParams = new LayoutParams(600, 350);
                newParams.Gravity     = GravityFlags.Center;
                backButton.Visibility = ViewStates.Gone;
                LayoutParams titleLayoutParams = new LayoutParams(LayoutParams.MatchParent, LayoutParams.WrapContent);
                titleLayoutParams.Gravity = GravityFlags.Center;
                title.LayoutParameters    = titleLayoutParams;
                linear.LayoutParameters   = newParams;
                title.SetTextColor(Color.Black);
                title.Text = "Choose Stamp";
            }
            else
            {
                bottomBar.Visibility        = ViewStates.Invisible;
                stampTitle.LayoutParameters = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, 150);
                title.SetTextColor(mainPage.fontColor);
            }

            approved = root.FindViewById <ImageButton>(Resource.Id.approved);
            approved.SetBackgroundColor(Color.Transparent);
            approved.Click += StampChosen;
            notApproved     = root.FindViewById <ImageButton>(Resource.Id.notapproved);
            notApproved.SetBackgroundColor(Color.Transparent);
            notApproved.Click += StampChosen;
            draft              = root.FindViewById <ImageButton>(Resource.Id.draft);
            draft.SetBackgroundColor(Color.Transparent);
            draft.Click += StampChosen;
            expired      = root.FindViewById <ImageButton>(Resource.Id.expired);
            expired.SetBackgroundColor(Color.Transparent);
            expired.Click += StampChosen;
            confidential   = root.FindViewById <ImageButton>(Resource.Id.confidential);
            confidential.SetBackgroundColor(Color.Transparent);
            confidential.Click += StampChosen;
        }