barteksc / AndroidPdfViewerV1

Android view for displaying PDFs rendered with PdfiumAndroid
Apache License 2.0
73 stars 31 forks source link

Ability to create PDFView programatically #17

Closed devxpy closed 6 years ago

devxpy commented 6 years ago

How do I use this without using a layout.xml?

for example, with Android's own TextView, we can do the following -

TextView textView = new TextView(context);

(Because, there, the AttributeSet object is optional.)

But cannot seem to do the same with PDFView, because it's constructor requires an AttributeSet set object as it's the second argument, and I have no idea where to get that from...

public PDFView(Context context, AttributeSet set) {

Why though?

I need to use it this way, in order to create a Flutter AndroidView, which will enable this library to be used from flutter as a widget!

More context