Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Android development and PDF

Need more events

More
IP: 192.168.0.71 11 years 10 months ago #6210 by Botao.Lin
Need more events was created by Botao.Lin
Hi,

My application that runs on Android needs to know some events as below.

1. A pdf file has been opened.
2. Scrolling movement stops.
3. Thumbnails haved been loaded on the visible screen.
4. The rendering opration finishs after zooming in or out a pdf.

The screen-changed events are important for our application. We need to know the timing. Thanks.

Regards,
Matt
More
IP: 192.168.0.71 11 years 10 months ago #6212 by radaee
Replied by radaee on topic Need more events
1. PDF file opened before PDFReader.PDFOpen(), so before PDFReader.PDFOpen() invoked, you can do something like UI operation.
2. by method: m_view.vMovingFinished() to check current scrolling ended, in PDFReader.onDraw();
3. not sure what you mean.
4. it seems you need customize PDFView class, in PDFView.vOnTimer()
Code:
protected void vOnTimer(Object obj) { int cur = m_prange_start; int cnt = m_prange_end; if( m_drawbmp ) { while( cur < cnt ) { if( m_pages[cur].NeedBmp() ) break; cur++; } if( cur >= cnt ) { //here fire your owner event, to notify zoom end, and all pages rendered. m_drawbmp = false; cur = 0; while( cur < cnt ) { m_pages[cur].DeleteBmp(); cur++; } if( m_listener != null ) m_listener.OnPDFInvalidate(false); } } else { while( cur < cnt ) { if( !m_pages[cur].IsFinished() ) { if( m_listener != null ) m_listener.OnPDFInvalidate(false); break; } cur++; } } }
More
IP: 192.168.0.71 11 years 10 months ago - 11 years 10 months ago #6219 by Botao.Lin
Replied by Botao.Lin on topic Need more events
Hi,

"3. Thumbnails haved been loaded on the visible screen."

When a pdf file includes many pages and I try to scroll the thumbnail bar quickly, the thumbnails only contain a white background. After PDFViewer load more pages, the thumbnails only with a white background will display their real content. We need to know the timing when all the thumbnails on the screen display their actuial content.

Regards,
Matt
Last edit: 11 years 10 months ago by malhar.
More
IP: 192.168.0.71 11 years 10 months ago #6220 by radaee
Replied by radaee on topic Need more events
just like point 4, modify codes like:
Code:
protected void vOnTimer(Object obj) { int cur = m_prange_start; int cnt = m_prange_end; if( m_drawbmp ) { while( cur < cnt ) { if( m_pages[cur].NeedBmp() ) break; cur++; } if( cur >= cnt ) { //here fire your owner event, to notify zoom end, and all pages rendered. m_drawbmp = false; cur = 0; while( cur < cnt ) { m_pages[cur].DeleteBmp(); cur++; } if( m_listener != null ) m_listener.OnPDFInvalidate(false); } } else { while( cur < cnt ) { if( !m_pages[cur].IsFinished() ) { if( m_listener != null ) m_listener.OnPDFInvalidate(false); break; } cur++; } if( cur >= cnt ) { //here fire your owner event, to notify all pages rendered. } } }
More
IP: 192.168.0.71 11 years 10 months ago #6229 by Botao.Lin
Replied by Botao.Lin on topic Need more events
Hi,

"1. A pdf file has been opened."

After I open a pdf file, the screen will be covered by a white background. About 1 to 5 seconds later, we can see the content of the file being shown on the screen. We'd like to knoe the timing when we can actually seen the pdf's content.

Regards,
Matt
More
IP: 192.168.0.71 11 years 10 months ago #6230 by radaee
Replied by radaee on topic Need more events
same to point 3,4
Time to create page: 0.426 seconds
Powered by Kunena Forum