public ScaleImageView(Context context, CustomViewPager CVP) : base(context) { m_Context = context; CustVP = CVP; Initialize(); }
public SimplePagerAdapter(CustomViewPager CVP, Context C, int col) { this.CustVP = CVP; this.baseContext = C; kol = col; this.views = new ScaleImageView[col]; this.bitmaps = new Bitmap[col]; }
/// <summary> /// Initializes a new instance of the <see cref="SimplePagerAdapter"/> class able to present PDF documents. /// </summary> /// <param name="baseContext">The base context.</param> /// <param name="doc">The document.</param> public EasyPagerAdapter(Context baseContext, int kol,CustomViewPager VP,PdfFixedDocument docm) { this.col = kol; this.baseContext = baseContext; this.tVP = VP; views = new ScaleImageView[col]; bitmaps = new Bitmap[col]; cacheDirName = "PagesCache"; syncObject = new object(); doc = docm; InitializeCache(); }
protected override void OnCreate(Bundle bundle) { PdfFixedDocument doc; int count; var newFilename = "cache.pdf"; // My new filename to be stored on local device string documentsPath = System.Environment.GetFolderPath (System.Environment.SpecialFolder.Personal); var fullpath = System.IO.Path.Combine (documentsPath, newFilename); Java.IO.File file = new Java.IO.File (fullpath); file.SetReadable (true); Android.Net.Uri uri = Android.Net.Uri.FromFile (file); MemoryStream ms = new MemoryStream (); var contentUri = uri; using (Stream stream = ContentResolver.OpenInputStream (contentUri)) { stream.CopyTo (ms); } ms.Position = 0; doc = new PdfFixedDocument (ms); count = doc.Pages.Count; base.OnCreate (bundle); SetContentView (Resource.Layout.Main); VP = FindViewById <CustomViewPager> (Resource.Id.viewPager); //VP.Adapter = new SimplePagerAdapter(VP,this.BaseContext,count); VP.Background = Android.Graphics.Drawables.Drawable.CreateFromPath ("LoadingImage.jpg"); VP.Adapter = new EasyPagerAdapter(this.BaseContext, count,VP,doc); VP.SetPageTransformer(true, new FadeTransformer ()); VP.setPagingEnabled (true); }