Some test text!

Using a Fragmentkeyboard_arrow_down

Using a Fragment

This article only applies to Xamarin.Android.

Using PdfViewCtrlTabHostFragment in Xamarin.Android is identical to using PdfViewCtrlTabHostFragment in Android. See tutorial here.

You can also see a working version in CompleteReaderAndroid sample project included in the download package. See sample code in MyReaderActivity.cs.

For example, the equivalent of the example provided in the Android guide will be:

First declare your Activity to extend AppCompatActivity and use AppCompat theme:

[Activity(Label = "MyReaderActivity",
    ConfigurationChanges = Android.Content.PM.ConfigChanges.ScreenSize | Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.KeyboardHidden,
    Theme = "@style/CustomAppTheme", 
    WindowSoftInputMode = SoftInput.AdjustPan)]
public class MyReaderActivity : Android.Support.V7.App.AppCompatActivity
{
  ...
}

To show the Fragment:

Bundle args = PdfViewCtrlTabFragment.CreateBasicPdfViewCtrlTabBundle(this, fileUri, password, viewerConfig);
args.PutParcelable(PdfViewCtrlTabHostFragment.BundleTabHostConfig, viewerConfig);
Android.Support.V4.App.FragmentTransaction ft = this.SupportFragmentManager.BeginTransaction();
var pdfViewCtrlTabHostFragment = PdfViewCtrlTabHostFragment.NewInstance(args);
pdfViewCtrlTabHostFragment.NavButtonPressed += (sender, e) =>
{
    Finish();
};
pdfViewCtrlTabHostFragment.LastTabClosed += (sender, e) =>
{
    Finish();
};
ft.Replace(Resource.Id.container, pdfViewCtrlTabHostFragment, null);
ft.Commit();