Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1
  • 2

TOPIC:

Need more events 9 years 11 months ago #6210

  • Botao.Lin
  • Botao.Lin's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 9
  • Thank you received: 0
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

Please Log in or Create an account to join the conversation.

Need more events 9 years 11 months ago #6212

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
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()
	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++;
			}
		}
	}

Please Log in or Create an account to join the conversation.

Need more events 9 years 11 months ago #6219

  • Botao.Lin
  • Botao.Lin's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 9
  • Thank you received: 0
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

Please Log in or Create an account to join the conversation.

Last edit: by malhar.

Need more events 9 years 11 months ago #6220

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
just like point 4, modify codes like:
	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.
			}
		}
	}

Please Log in or Create an account to join the conversation.

Need more events 9 years 11 months ago #6229

  • Botao.Lin
  • Botao.Lin's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 9
  • Thank you received: 0
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

Please Log in or Create an account to join the conversation.

Need more events 9 years 11 months ago #6230

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
same to point 3,4

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Powered by Kunena Forum