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

TOPIC:

how to bring to normal size after double click 10 years 10 months ago #7930

  • asliyanage
  • asliyanage's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 100
  • Thank you received: 0
I found below method in pdfreader class.

public boolean OnPDFDoubleTapped(float x, float y)
{
if( m_status != STA_NORMAL ) return false;
m_view.vSetScale(m_view.vGetScale() + Global.zoomStep, x, y);
return true;
}

I need to bring the pdf when if double click happens when the pdf is in mazimum size.So how to identify the maximum size ?is there any status like STA_NORMAL for maximum size ?

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

how to bring to normal size after double click 10 years 10 months ago #7981

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
You can do it like:
if(m_view.vGetScale() == m_view.vGetMaxScale())
       Global.zoomStep *= -1; //this will reverse the zoom behavior

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

how to bring to normal size after double click 10 years 10 months ago #7985

  • asliyanage
  • asliyanage's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 100
  • Thank you received: 0
I change the code as below.Now it maximize if i double clicks the pdf and if i double click it comes to normal size.

public boolean OnPDFDoubleTapped(float x, float y)
{

if(m_view.vGetScale() == m_view.vGetMinScale()){
m_view.vSetScale(m_view.vGetMaxScale(),x,y );
}else{
m_view.vSetScale(m_view.vGetMinScale(),x,y );
}

}

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

  • Page:
  • 1
Powered by Kunena Forum